proxy-registry-impl: run every proxy through the plugins' provide_interfaces

This allows plugins to provide custom interfaces on proxies
This commit is contained in:
George Kiagiadakis
2019-04-17 19:20:39 +03:00
parent ce43cf5f0c
commit eeb99f908a
2 changed files with 12 additions and 2 deletions

View File

@@ -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

View File

@@ -7,8 +7,10 @@
*/
#include "proxy-registry-impl.h"
#include "plugin-registry-impl.h"
#include <wp/proxy.h>
#include <wp/plugin.h>
#include <pipewire/pipewire.h>
#include <pipewire/map.h>
@@ -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