context: make method to get config section

Applications will likely need a section of the config, not the
whole thing.
This commit is contained in:
Wim Taymans 2021-02-16 13:22:42 +01:00
parent b62771c3cb
commit d1f21a939a
2 changed files with 5 additions and 5 deletions

View file

@ -470,9 +470,9 @@ const struct pw_properties *pw_context_get_properties(struct pw_context *context
}
SPA_EXPORT
const struct pw_properties *pw_context_get_config(struct pw_context *context)
const char *pw_context_get_conf_section(struct pw_context *context, const char *section)
{
return context->conf;
return pw_properties_get(context->conf, section);
}
/** Update context properties

View file

@ -129,12 +129,12 @@ void pw_context_add_listener(struct pw_context *context,
/** Get the context properties */
const struct pw_properties *pw_context_get_properties(struct pw_context *context);
/** Get the config for this context. Since 0.3.22 */
const struct pw_properties *pw_context_get_config(struct pw_context *context);
/** Update the context properties */
int pw_context_update_properties(struct pw_context *context, const struct spa_dict *dict);
/** Get a config section for this context. Since 0.3.22 */
const char *pw_context_get_conf_section(struct pw_context *context, const char *section);
/** Get the context support objects */
const struct spa_support *pw_context_get_support(struct pw_context *context, uint32_t *n_support);