From f79c347667999f2c8c23d2bdb4529588d2fe3f28 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 5 Aug 2020 12:29:19 +0200 Subject: [PATCH] global: add method to update global keys --- src/pipewire/global.c | 10 ++++++++++ src/pipewire/global.h | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/src/pipewire/global.c b/src/pipewire/global.c index 2247ce193..43403e91b 100644 --- a/src/pipewire/global.c +++ b/src/pipewire/global.c @@ -211,6 +211,16 @@ const struct pw_properties *pw_global_get_properties(struct pw_global *global) return global->properties; } +SPA_EXPORT +int pw_global_update_keys(struct pw_global *global, + const struct spa_dict *dict, const char *keys[]) +{ + struct impl *impl = SPA_CONTAINER_OF(global, struct impl, this); + if (impl->registered) + return -EINVAL; + return pw_properties_update_keys(global->properties, dict, keys); +} + SPA_EXPORT void * pw_global_get_object(struct pw_global *global) { diff --git a/src/pipewire/global.h b/src/pipewire/global.h index 399a8d4cc..d0edad7bb 100644 --- a/src/pipewire/global.h +++ b/src/pipewire/global.h @@ -113,6 +113,10 @@ uint32_t pw_global_get_version(struct pw_global *global); /** Get the global properties */ const struct pw_properties *pw_global_get_properties(struct pw_global *global); +/** Update the global properties, must be done when unregistered */ +int pw_global_update_keys(struct pw_global *global, + const struct spa_dict *dict, const char *keys[]); + /** Get the object associated with the global. This depends on the type of the * global */ void *pw_global_get_object(struct pw_global *global);