mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-11 13:30:07 -05:00
parent
498b4bd080
commit
b4f359ed77
2 changed files with 28 additions and 4 deletions
|
|
@ -122,8 +122,8 @@ static struct node *v4l2_create_node(struct device *dev, uint32_t id,
|
|||
{
|
||||
struct node *node;
|
||||
struct impl *impl = dev->impl;
|
||||
int res;
|
||||
const char *str;
|
||||
int i, res;
|
||||
const char *str, *d;
|
||||
|
||||
pw_log_debug("new node %u", id);
|
||||
|
||||
|
|
@ -150,6 +150,17 @@ static struct node *v4l2_create_node(struct device *dev, uint32_t id,
|
|||
str = "v4l2-device";
|
||||
pw_properties_setf(node->props, PW_KEY_NODE_NAME, "%s.%s", info->factory_name, str);
|
||||
|
||||
for (i = 2; i <= 99; i++) {
|
||||
if ((d = pw_properties_get(node->props, PW_KEY_NODE_NAME)) == NULL)
|
||||
break;
|
||||
|
||||
if (v4l2_find_node(dev, SPA_ID_INVALID, d) == NULL)
|
||||
break;
|
||||
|
||||
pw_properties_setf(node->props, PW_KEY_NODE_NAME, "%s.%s.%d",
|
||||
info->factory_name, str, i);
|
||||
}
|
||||
|
||||
str = pw_properties_get(dev->props, SPA_KEY_DEVICE_DESCRIPTION);
|
||||
if (str == NULL)
|
||||
str = "v4l2-device";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue