mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
improve properties on objects
This commit is contained in:
parent
9c4e5f4e27
commit
6e0c279bc1
7 changed files with 56 additions and 10 deletions
|
|
@ -85,6 +85,7 @@ static void *create_object(void *_data,
|
|||
struct pw_device *device;
|
||||
const char *factory_name;
|
||||
struct device_data *nd;
|
||||
struct pw_client *client;
|
||||
int res;
|
||||
|
||||
if (properties == NULL)
|
||||
|
|
@ -94,6 +95,16 @@ static void *create_object(void *_data,
|
|||
if (factory_name == NULL)
|
||||
goto error_properties;
|
||||
|
||||
pw_properties_setf(properties, PW_KEY_FACTORY_ID, "%d",
|
||||
pw_global_get_id(pw_factory_get_global(data->this)));
|
||||
|
||||
client = resource ? pw_resource_get_client(resource) : NULL;
|
||||
|
||||
if (client) {
|
||||
pw_properties_setf(properties, PW_KEY_CLIENT_ID, "%d",
|
||||
pw_global_get_id(pw_client_get_global(client)));
|
||||
}
|
||||
|
||||
device = pw_spa_device_load(core,
|
||||
factory_name,
|
||||
0,
|
||||
|
|
@ -110,12 +121,12 @@ static void *create_object(void *_data,
|
|||
|
||||
pw_device_add_listener(device, &nd->device_listener, &device_events, nd);
|
||||
|
||||
if (resource)
|
||||
if (client) {
|
||||
pw_global_bind(pw_device_get_global(device),
|
||||
pw_resource_get_client(resource),
|
||||
PW_PERM_RWX,
|
||||
version, new_id);
|
||||
|
||||
client,
|
||||
PW_PERM_RWX, version,
|
||||
new_id);
|
||||
}
|
||||
return device;
|
||||
|
||||
error_properties:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue