mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-28 08:57:33 -05:00
improve properties on objects
This commit is contained in:
parent
9c4e5f4e27
commit
6e0c279bc1
7 changed files with 56 additions and 10 deletions
|
|
@ -104,6 +104,7 @@ static void *create_object(void *_data,
|
|||
const char *factory_name;
|
||||
struct node_data *nd;
|
||||
int res;
|
||||
struct pw_client *client;
|
||||
|
||||
if (properties == NULL)
|
||||
goto error_properties;
|
||||
|
|
@ -112,9 +113,16 @@ static void *create_object(void *_data,
|
|||
if (factory_name == NULL)
|
||||
goto error_properties;
|
||||
|
||||
client = resource ? pw_resource_get_client(resource) : NULL;
|
||||
|
||||
pw_properties_setf(properties, PW_KEY_FACTORY_ID, "%d",
|
||||
pw_global_get_id(pw_factory_get_global(data->this)));
|
||||
|
||||
if (client) {
|
||||
pw_properties_setf(properties, PW_KEY_CLIENT_ID, "%d",
|
||||
pw_global_get_id(pw_client_get_global(client)));
|
||||
}
|
||||
|
||||
node = pw_spa_node_load(core,
|
||||
factory_name,
|
||||
PW_SPA_NODE_FLAG_ACTIVATE,
|
||||
|
|
@ -130,9 +138,8 @@ static void *create_object(void *_data,
|
|||
|
||||
pw_node_add_listener(node, &nd->node_listener, &node_events, nd);
|
||||
|
||||
if (resource) {
|
||||
if (client) {
|
||||
struct pw_resource *bound_resource;
|
||||
struct pw_client *client = pw_resource_get_client(resource);
|
||||
|
||||
res = pw_global_bind(pw_node_get_global(node),
|
||||
client,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue