mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
alsa: add profile description in node description
This commit is contained in:
parent
a655e8f6df
commit
79937676a4
1 changed files with 6 additions and 2 deletions
|
|
@ -192,7 +192,7 @@ static struct node *alsa_create_node(struct device *device, uint32_t id,
|
||||||
struct node *node;
|
struct node *node;
|
||||||
struct impl *impl = device->impl;
|
struct impl *impl = device->impl;
|
||||||
int res;
|
int res;
|
||||||
const char *dev, *subdev, *stream, *profile;
|
const char *dev, *subdev, *stream, *profile, *profile_desc;
|
||||||
int priority;
|
int priority;
|
||||||
|
|
||||||
pw_log_debug("new node %u", id);
|
pw_log_debug("new node %u", id);
|
||||||
|
|
@ -223,6 +223,7 @@ static struct node *alsa_create_node(struct device *device, uint32_t id,
|
||||||
stream = "unknown";
|
stream = "unknown";
|
||||||
if ((profile = pw_properties_get(node->props, "device.profile.name")) == NULL)
|
if ((profile = pw_properties_get(node->props, "device.profile.name")) == NULL)
|
||||||
profile = "unknown";
|
profile = "unknown";
|
||||||
|
profile_desc = pw_properties_get(node->props, "device.profile.description");
|
||||||
|
|
||||||
if (!strcmp(stream, "capture"))
|
if (!strcmp(stream, "capture"))
|
||||||
node->direction = PW_DIRECTION_OUTPUT;
|
node->direction = PW_DIRECTION_OUTPUT;
|
||||||
|
|
@ -276,7 +277,10 @@ static struct node *alsa_create_node(struct device *device, uint32_t id,
|
||||||
if (name == NULL)
|
if (name == NULL)
|
||||||
name = dev;
|
name = dev;
|
||||||
|
|
||||||
if (strcmp(subdev, "0")) {
|
if (profile_desc != NULL) {
|
||||||
|
pw_properties_setf(node->props, PW_KEY_NODE_DESCRIPTION, "%s %s",
|
||||||
|
desc, profile_desc);
|
||||||
|
} else if (strcmp(subdev, "0")) {
|
||||||
pw_properties_setf(node->props, PW_KEY_NODE_DESCRIPTION, "%s (%s %s)",
|
pw_properties_setf(node->props, PW_KEY_NODE_DESCRIPTION, "%s (%s %s)",
|
||||||
desc, name, subdev);
|
desc, name, subdev);
|
||||||
} else if (strcmp(dev, "0")) {
|
} else if (strcmp(dev, "0")) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue