mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
jack: use PIPEWIRE_PROPS env to add properties to jack nodes
This commit is contained in:
parent
d4d80c16c1
commit
ca066fbf3b
1 changed files with 12 additions and 1 deletions
|
|
@ -246,6 +246,7 @@ struct client {
|
||||||
struct context context;
|
struct context context;
|
||||||
|
|
||||||
struct pw_data_loop *loop;
|
struct pw_data_loop *loop;
|
||||||
|
struct pw_properties *props;
|
||||||
|
|
||||||
struct pw_core *core;
|
struct pw_core *core;
|
||||||
struct spa_hook core_listener;
|
struct spa_hook core_listener;
|
||||||
|
|
@ -2334,6 +2335,13 @@ jack_client_t * jack_client_open (const char *client_name,
|
||||||
&client->registry_listener,
|
&client->registry_listener,
|
||||||
®istry_events, client);
|
®istry_events, client);
|
||||||
|
|
||||||
|
if ((str = getenv("PIPEWIRE_PROPS")) != NULL)
|
||||||
|
client->props = pw_properties_new_string(str);
|
||||||
|
if (client->props == NULL)
|
||||||
|
client->props = pw_properties_new(NULL, NULL);
|
||||||
|
if (client->props == NULL)
|
||||||
|
goto init_failed;
|
||||||
|
|
||||||
props = SPA_DICT_INIT(items, 0);
|
props = SPA_DICT_INIT(items, 0);
|
||||||
items[props.n_items++] = SPA_DICT_ITEM_INIT(PW_KEY_NODE_NAME, client_name);
|
items[props.n_items++] = SPA_DICT_ITEM_INIT(PW_KEY_NODE_NAME, client_name);
|
||||||
items[props.n_items++] = SPA_DICT_ITEM_INIT(PW_KEY_MEDIA_TYPE, "Audio");
|
items[props.n_items++] = SPA_DICT_ITEM_INIT(PW_KEY_MEDIA_TYPE, "Audio");
|
||||||
|
|
@ -2343,11 +2351,13 @@ jack_client_t * jack_client_open (const char *client_name,
|
||||||
items[props.n_items++] = SPA_DICT_ITEM_INIT(PW_KEY_NODE_LATENCY, str);
|
items[props.n_items++] = SPA_DICT_ITEM_INIT(PW_KEY_NODE_LATENCY, str);
|
||||||
items[props.n_items++] = SPA_DICT_ITEM_INIT(PW_KEY_NODE_ALWAYS_PROCESS, "true");
|
items[props.n_items++] = SPA_DICT_ITEM_INIT(PW_KEY_NODE_ALWAYS_PROCESS, "true");
|
||||||
|
|
||||||
|
pw_properties_add(client->props, &props);
|
||||||
|
|
||||||
client->node = pw_core_create_object(client->core,
|
client->node = pw_core_create_object(client->core,
|
||||||
"client-node",
|
"client-node",
|
||||||
PW_TYPE_INTERFACE_ClientNode,
|
PW_TYPE_INTERFACE_ClientNode,
|
||||||
PW_VERSION_CLIENT_NODE,
|
PW_VERSION_CLIENT_NODE,
|
||||||
&props,
|
&client->props->dict,
|
||||||
0);
|
0);
|
||||||
if (client->node == NULL)
|
if (client->node == NULL)
|
||||||
goto init_failed;
|
goto init_failed;
|
||||||
|
|
@ -2445,6 +2455,7 @@ int jack_client_close (jack_client_t *client)
|
||||||
pw_log_debug(NAME" %p: free", client);
|
pw_log_debug(NAME" %p: free", client);
|
||||||
pthread_mutex_destroy(&c->context.lock);
|
pthread_mutex_destroy(&c->context.lock);
|
||||||
pw_data_loop_destroy(c->loop);
|
pw_data_loop_destroy(c->loop);
|
||||||
|
pw_properties_free(c->props);
|
||||||
free(c);
|
free(c);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue