summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWim Taymans <wtaymans@redhat.com>2020-08-05 12:29:19 +0200
committerWim Taymans <wtaymans@redhat.com>2020-08-05 12:29:19 +0200
commitf79c347667999f2c8c23d2bdb4529588d2fe3f28 (patch)
treea31132c85b388176c704522a64d2ee26fa11efa7
parent3abd46b619de2c14c7b9e373a1f7b131ddabcaf0 (diff)
global: add method to update global keys
-rw-r--r--src/pipewire/global.c10
-rw-r--r--src/pipewire/global.h4
2 files changed, 14 insertions, 0 deletions
diff --git a/src/pipewire/global.c b/src/pipewire/global.c
index 2247ce19..43403e91 100644
--- a/src/pipewire/global.c
+++ b/src/pipewire/global.c
@@ -212,6 +212,16 @@ const struct pw_properties *pw_global_get_properties(struct pw_global *global)
}
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)
{
return global->object;
diff --git a/src/pipewire/global.h b/src/pipewire/global.h
index 399a8d4c..d0edad7b 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);