mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-15 07:00:05 -05:00
conf: support config section extensions
Add support for loading an additional config section when the config.ext property was set. This makes it possible to have per module config of stream.properties and rules sections. One use case is when there are multiple module-protocol-pulse modules loaded where each module will use a different set of *.properties and *.rules from the config. Each module will have a config.ext property in the args with the suffix of the section that is loaded.
This commit is contained in:
parent
59461113ba
commit
2402904e1e
1 changed files with 20 additions and 1 deletions
|
|
@ -897,8 +897,16 @@ int pw_context_conf_update_props(struct pw_context *context,
|
|||
{
|
||||
struct data data = { .context = context, .props = props };
|
||||
int res;
|
||||
const char *str = pw_properties_get(props, "config.ext");
|
||||
|
||||
res = pw_context_conf_section_for_each(context, section,
|
||||
update_props, &data);
|
||||
if (res == 0 && str != NULL) {
|
||||
char key[128];
|
||||
snprintf(key, sizeof(key), "%s.%s", section, str);
|
||||
res = pw_context_conf_section_for_each(context, key,
|
||||
update_props, &data);
|
||||
}
|
||||
return res == 0 ? data.count : res;
|
||||
}
|
||||
|
||||
|
|
@ -1049,5 +1057,16 @@ int pw_context_conf_section_match_rules(struct pw_context *context, const char *
|
|||
.props = props,
|
||||
.matched = callback,
|
||||
.data = data };
|
||||
return pw_context_conf_section_for_each(context, section, match_rules, &match);
|
||||
int res;
|
||||
const char *str = spa_dict_lookup(props, "config.ext");
|
||||
|
||||
res = pw_context_conf_section_for_each(context, section,
|
||||
match_rules, &match);
|
||||
if (res == 0 && str != NULL) {
|
||||
char key[128];
|
||||
snprintf(key, sizeof(key), "%s.%s", section, str);
|
||||
res = pw_context_conf_section_for_each(context, key,
|
||||
match_rules, &match);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue