mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-16 08:56:45 -05:00
acp: improve debug
This commit is contained in:
parent
0da406d304
commit
38276d126c
4 changed files with 40 additions and 33 deletions
|
|
@ -42,29 +42,6 @@ struct data {
|
|||
bool quit;
|
||||
};
|
||||
|
||||
static const char *str_available(enum acp_available status)
|
||||
{
|
||||
switch (status) {
|
||||
case ACP_AVAILABLE_UNKNOWN:
|
||||
return "unknown";
|
||||
case ACP_AVAILABLE_NO:
|
||||
return "no";
|
||||
case ACP_AVAILABLE_YES:
|
||||
return "yes";
|
||||
}
|
||||
return "error";
|
||||
}
|
||||
|
||||
static const char *str_direction(enum acp_direction direction)
|
||||
{
|
||||
switch (direction) {
|
||||
case ACP_DIRECTION_CAPTURE:
|
||||
return "capture";
|
||||
case ACP_DIRECTION_PLAYBACK:
|
||||
return "playback";
|
||||
}
|
||||
return "error";
|
||||
}
|
||||
static const char *str_port_type(enum acp_port_type type)
|
||||
{
|
||||
switch (type) {
|
||||
|
|
@ -182,7 +159,7 @@ static void card_profile_available(void *data, uint32_t index,
|
|||
struct data *d = data;
|
||||
struct acp_card *card = d->card;
|
||||
struct acp_card_profile *p = card->profiles[index];
|
||||
fprintf(stderr, "*** profile %s available %s\n", p->name, str_available(available));
|
||||
fprintf(stderr, "*** profile %s available %s\n", p->name, acp_available_str(available));
|
||||
}
|
||||
|
||||
static void card_port_available(void *data, uint32_t index,
|
||||
|
|
@ -191,7 +168,7 @@ static void card_port_available(void *data, uint32_t index,
|
|||
struct data *d = data;
|
||||
struct acp_card *card = d->card;
|
||||
struct acp_port *p = card->ports[index];
|
||||
fprintf(stderr, "*** port %s available %s\n", p->name, str_available(available));
|
||||
fprintf(stderr, "*** port %s available %s\n", p->name, acp_available_str(available));
|
||||
}
|
||||
|
||||
static void on_volume_changed(void *data, struct acp_device *dev)
|
||||
|
|
@ -257,9 +234,9 @@ static void print_port(struct data *data, struct acp_port *p, int indent, int le
|
|||
|
||||
fprintf(stderr, "%*s %c port %u: name:\"%s\" direction:%s prio:%d group:%s type:%s (available: %s)\n",
|
||||
indent, "", p->flags & ACP_PORT_ACTIVE ? '*' : ' ', p->index,
|
||||
p->name, str_direction(p->direction), p->priority,
|
||||
p->name, acp_direction_str(p->direction), p->priority,
|
||||
p->availability_group, str_port_type(p->type),
|
||||
str_available(p->available));
|
||||
acp_available_str(p->available));
|
||||
if (level > 0) {
|
||||
acp_debug_dict(&p->props, indent + 8);
|
||||
}
|
||||
|
|
@ -284,7 +261,7 @@ static void print_device(struct data *data, struct acp_device *d, int indent, in
|
|||
|
||||
fprintf(stderr, "%*s %c device %u: direction:%s name:\"%s\" prio:%d flags:%08x devices: ",
|
||||
indent, "", d->flags & ACP_DEVICE_ACTIVE ? '*' : ' ', d->index,
|
||||
str_direction(d->direction), d->name, d->priority, d->flags);
|
||||
acp_direction_str(d->direction), d->name, d->priority, d->flags);
|
||||
for (s = d->device_strings; *s; s++)
|
||||
fprintf(stderr, "\"%s\" ", *s);
|
||||
fprintf(stderr, "\n");
|
||||
|
|
@ -308,7 +285,7 @@ static void print_profile(struct data *data, struct acp_card_profile *p, int ind
|
|||
|
||||
fprintf(stderr, "%*s %c profile %u: name:\"%s\" prio:%d (available: %s)\n",
|
||||
indent, "", p->flags & ACP_PROFILE_ACTIVE ? '*' : ' ', p->index,
|
||||
p->name, p->priority, str_available(p->available));
|
||||
p->name, p->priority, acp_available_str(p->available));
|
||||
if (level > 0) {
|
||||
fprintf(stderr, "%*sdescription:\"%s\"\n",
|
||||
indent+8, "", p->description);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue