From eeb99f908a92acdf3350840300d0aa8e5f482c45 Mon Sep 17 00:00:00 2001 From: George Kiagiadakis Date: Wed, 17 Apr 2019 19:20:39 +0300 Subject: [PATCH] proxy-registry-impl: run every proxy through the plugins' provide_interfaces This allows plugins to provide custom interfaces on proxies --- src/plugin-registry-impl.h | 2 +- src/proxy-registry-impl.c | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/plugin-registry-impl.h b/src/plugin-registry-impl.h index 3cb9a4f2..0b4fb792 100644 --- a/src/plugin-registry-impl.h +++ b/src/plugin-registry-impl.h @@ -30,7 +30,7 @@ gboolean wp_plugin_registry_impl_invoke_internal (WpPluginRegistryImpl * self, wp_plugin_registry_impl_invoke_internal ( \ WP_PLUGIN_REGISTRY_IMPL (r), (WpPluginFunc) func, \ (gpointer) data))) { \ - g_warning ("No plugin handled invocation to " ##func); \ + g_warning ("No plugin handled invocation to " #func); \ } \ } G_STMT_END diff --git a/src/proxy-registry-impl.c b/src/proxy-registry-impl.c index 68ae8eae..c171903b 100644 --- a/src/proxy-registry-impl.c +++ b/src/proxy-registry-impl.c @@ -7,8 +7,10 @@ */ #include "proxy-registry-impl.h" +#include "plugin-registry-impl.h" #include +#include #include #include @@ -85,7 +87,10 @@ registry_global (void * data, uint32_t id, uint32_t parent_id, const struct spa_dict * props) { WpProxyRegistryImpl *self = WP_PROXY_REGISTRY_IMPL (data); - WpProxy *proxy = g_object_new (WP_TYPE_PROXY, + WpProxy *proxy; + g_autoptr (WpPluginRegistry) plugin_registry = NULL; + + proxy = g_object_new (WP_TYPE_PROXY, "id", id, "parent-id", parent_id, "spa-type", type, @@ -93,6 +98,11 @@ registry_global (void * data, uint32_t id, uint32_t parent_id, NULL); map_insert (&self->globals, id, proxy); + plugin_registry = wp_interface_impl_get_sibling (WP_INTERFACE_IMPL (self), + WP_TYPE_PLUGIN_REGISTRY); + wp_plugin_registry_impl_invoke (plugin_registry, + wp_plugin_provide_interfaces, WP_OBJECT (proxy)); + /* * defer notifications until we return to the main loop; * this allows the pipewire event loop to finish emitting