mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
module-adapter: make it possible to pass the slave node pointer
This commit is contained in:
parent
0a6ee19018
commit
01d9f4eb3a
1 changed files with 24 additions and 14 deletions
|
|
@ -101,27 +101,37 @@ static void *create_object(void *_data,
|
||||||
struct factory_data *d = _data;
|
struct factory_data *d = _data;
|
||||||
struct pw_client *client;
|
struct pw_client *client;
|
||||||
struct pw_node *adapter, *slave;
|
struct pw_node *adapter, *slave;
|
||||||
const char *factory_name;
|
const char *str, *factory_name;
|
||||||
int res;
|
int res;
|
||||||
struct node_data *nd;
|
struct node_data *nd;
|
||||||
|
|
||||||
if (properties == NULL)
|
if (properties == NULL)
|
||||||
goto error_properties;
|
goto error_properties;
|
||||||
|
|
||||||
factory_name = pw_properties_get(properties, SPA_KEY_FACTORY_NAME);
|
slave = NULL;
|
||||||
if (factory_name == NULL)
|
str = pw_properties_get(properties, "adapt.slave.node");
|
||||||
goto error_properties;
|
if (str != NULL) {
|
||||||
|
if (sscanf(str, "pointer:%p", &slave) != 1)
|
||||||
|
goto error_properties;
|
||||||
|
|
||||||
slave = pw_spa_node_load(d->core,
|
pw_properties_setf(properties, "audio.adapt.slave", "pointer:%p", slave);
|
||||||
NULL,
|
}
|
||||||
pw_factory_get_global(d->this),
|
if (slave == NULL) {
|
||||||
factory_name,
|
factory_name = pw_properties_get(properties, SPA_KEY_FACTORY_NAME);
|
||||||
"slave-node",
|
if (factory_name == NULL)
|
||||||
PW_SPA_NODE_FLAG_ACTIVATE |
|
goto error_properties;
|
||||||
PW_SPA_NODE_FLAG_NO_REGISTER,
|
|
||||||
pw_properties_copy(properties), 0);
|
slave = pw_spa_node_load(d->core,
|
||||||
if (slave == NULL)
|
NULL,
|
||||||
goto error_no_mem;
|
pw_factory_get_global(d->this),
|
||||||
|
factory_name,
|
||||||
|
"slave-node",
|
||||||
|
PW_SPA_NODE_FLAG_ACTIVATE |
|
||||||
|
PW_SPA_NODE_FLAG_NO_REGISTER,
|
||||||
|
pw_properties_copy(properties), 0);
|
||||||
|
if (slave == NULL)
|
||||||
|
goto error_no_mem;
|
||||||
|
}
|
||||||
|
|
||||||
adapter = pw_adapter_new(pw_module_get_core(d->module),
|
adapter = pw_adapter_new(pw_module_get_core(d->module),
|
||||||
slave,
|
slave,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue