mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
pulse-server: apply node.name to all streams
Pass properties as global properties so that they are applied to both streams. Make sure node.name is set on both streams so that they look good in tools like carla.
This commit is contained in:
parent
5d104994c0
commit
53cd601869
2 changed files with 10 additions and 12 deletions
|
|
@ -65,7 +65,6 @@ static const struct pw_impl_module_events module_events = {
|
|||
static void serialize_dict(FILE *f, const struct spa_dict *dict)
|
||||
{
|
||||
const struct spa_dict_item *it;
|
||||
fprintf(f, "{");
|
||||
spa_dict_for_each(it, dict) {
|
||||
size_t len = it->value ? strlen(it->value) : 0;
|
||||
fprintf(f, " \"%s\" = ", it->key);
|
||||
|
|
@ -82,7 +81,6 @@ static void serialize_dict(FILE *f, const struct spa_dict *dict)
|
|||
fprintf(f, "%s", str);
|
||||
}
|
||||
}
|
||||
fprintf(f, " }");
|
||||
}
|
||||
|
||||
static int module_remap_sink_load(struct client *client, struct module *module)
|
||||
|
|
@ -97,11 +95,12 @@ static int module_remap_sink_load(struct client *client, struct module *module)
|
|||
|
||||
f = open_memstream(&args, &size);
|
||||
fprintf(f, "{");
|
||||
fprintf(f, " capture.props = ");
|
||||
serialize_dict(f, &module->props->dict);
|
||||
fprintf(f, " capture.props = {");
|
||||
serialize_dict(f, &data->capture_props->dict);
|
||||
fprintf(f, " playback.props = ");
|
||||
fprintf(f, " } playback.props = {");
|
||||
serialize_dict(f, &data->playback_props->dict);
|
||||
fprintf(f, " }");
|
||||
fprintf(f, " } }");
|
||||
fclose(f);
|
||||
|
||||
data->mod = pw_context_load_module(module->impl->context,
|
||||
|
|
@ -192,7 +191,7 @@ struct module *create_module_remap_sink(struct impl *impl, const char *argument)
|
|||
module_args_add_props(props, argument);
|
||||
|
||||
if ((str = pw_properties_get(props, "sink_name")) != NULL) {
|
||||
pw_properties_set(capture_props, PW_KEY_NODE_NAME, str);
|
||||
pw_properties_set(props, PW_KEY_NODE_NAME, str);
|
||||
pw_properties_set(props, "sink_name", NULL);
|
||||
} else {
|
||||
pw_properties_set(props, PW_KEY_NODE_NAME, "null");
|
||||
|
|
|
|||
|
|
@ -65,7 +65,6 @@ static const struct pw_impl_module_events module_events = {
|
|||
static void serialize_dict(FILE *f, const struct spa_dict *dict)
|
||||
{
|
||||
const struct spa_dict_item *it;
|
||||
fprintf(f, "{");
|
||||
spa_dict_for_each(it, dict) {
|
||||
size_t len = it->value ? strlen(it->value) : 0;
|
||||
fprintf(f, " \"%s\" = ", it->key);
|
||||
|
|
@ -82,7 +81,6 @@ static void serialize_dict(FILE *f, const struct spa_dict *dict)
|
|||
fprintf(f, "%s", str);
|
||||
}
|
||||
}
|
||||
fprintf(f, " }");
|
||||
}
|
||||
|
||||
static int module_remap_source_load(struct client *client, struct module *module)
|
||||
|
|
@ -97,11 +95,12 @@ static int module_remap_source_load(struct client *client, struct module *module
|
|||
|
||||
f = open_memstream(&args, &size);
|
||||
fprintf(f, "{");
|
||||
fprintf(f, " capture.props = ");
|
||||
serialize_dict(f, &module->props->dict);
|
||||
fprintf(f, " capture.props = { ");
|
||||
serialize_dict(f, &data->capture_props->dict);
|
||||
fprintf(f, " playback.props = ");
|
||||
fprintf(f, " } playback.props = { ");
|
||||
serialize_dict(f, &data->playback_props->dict);
|
||||
fprintf(f, " }");
|
||||
fprintf(f, " } }");
|
||||
fclose(f);
|
||||
|
||||
data->mod = pw_context_load_module(module->impl->context,
|
||||
|
|
@ -192,7 +191,7 @@ struct module *create_module_remap_source(struct impl *impl, const char *argumen
|
|||
module_args_add_props(props, argument);
|
||||
|
||||
if ((str = pw_properties_get(props, "source_name")) != NULL) {
|
||||
pw_properties_set(playback_props, PW_KEY_NODE_NAME, str);
|
||||
pw_properties_set(props, PW_KEY_NODE_NAME, str);
|
||||
pw_properties_set(props, "source_name", NULL);
|
||||
} else {
|
||||
pw_properties_set(props, PW_KEY_NODE_NAME, "null");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue