mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-06 13:30:01 -05:00
media-session: give bluez5 objects driver.priority
Makes bluez devices as automatic default devices, with priority slightly larger than alsa devices. The priority.driver is also used by pulse-server on determining automatic default devices, when no default has been manually set.
This commit is contained in:
parent
8fd120cb23
commit
f7db158bd6
1 changed files with 12 additions and 0 deletions
|
|
@ -132,6 +132,7 @@ static struct node *bluez5_create_node(struct device *device, uint32_t id,
|
||||||
struct pw_impl_factory *factory;
|
struct pw_impl_factory *factory;
|
||||||
int res;
|
int res;
|
||||||
const char *prefix, *str, *profile, *rules;
|
const char *prefix, *str, *profile, *rules;
|
||||||
|
int priority;
|
||||||
|
|
||||||
pw_log_debug("new node %u", id);
|
pw_log_debug("new node %u", id);
|
||||||
|
|
||||||
|
|
@ -177,6 +178,16 @@ static struct node *bluez5_create_node(struct device *device, uint32_t id,
|
||||||
pw_properties_setf(node->props, PW_KEY_NODE_NAME, "%s.%s.%s", prefix, str, profile);
|
pw_properties_setf(node->props, PW_KEY_NODE_NAME, "%s.%s.%s", prefix, str, profile);
|
||||||
pw_properties_set(node->props, PW_KEY_FACTORY_NAME, info->factory_name);
|
pw_properties_set(node->props, PW_KEY_FACTORY_NAME, info->factory_name);
|
||||||
|
|
||||||
|
if (pw_properties_get(node->props, PW_KEY_PRIORITY_DRIVER) == NULL) {
|
||||||
|
priority = device->priority + 10;
|
||||||
|
|
||||||
|
if (strcmp(prefix, "bluez_output") == 0)
|
||||||
|
priority += 1000;
|
||||||
|
|
||||||
|
pw_properties_setf(node->props, PW_KEY_PRIORITY_DRIVER, "%d", priority);
|
||||||
|
pw_properties_setf(node->props, PW_KEY_PRIORITY_SESSION, "%d", priority);
|
||||||
|
}
|
||||||
|
|
||||||
node->impl = impl;
|
node->impl = impl;
|
||||||
node->device = device;
|
node->device = device;
|
||||||
node->id = id;
|
node->id = id;
|
||||||
|
|
@ -408,6 +419,7 @@ static struct device *bluez5_create_device(struct impl *impl, uint32_t id,
|
||||||
|
|
||||||
device->impl = impl;
|
device->impl = impl;
|
||||||
device->id = id;
|
device->id = id;
|
||||||
|
device->priority = 1000;
|
||||||
device->handle = handle;
|
device->handle = handle;
|
||||||
device->device = iface;
|
device->device = iface;
|
||||||
device->props = pw_properties_new_dict(info->props);
|
device->props = pw_properties_new_dict(info->props);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue