Commit d4f882d7 authored by George Kiagiadakis's avatar George Kiagiadakis

Update for the pw_global "parent" concept removal

parent fbf8de84
...@@ -113,7 +113,7 @@ static guint signals[LAST_SIGNAL] = { 0 }; ...@@ -113,7 +113,7 @@ static guint signals[LAST_SIGNAL] = { 0 };
G_DEFINE_TYPE (WpRemotePipewire, wp_remote_pipewire, WP_TYPE_REMOTE) G_DEFINE_TYPE (WpRemotePipewire, wp_remote_pipewire, WP_TYPE_REMOTE)
static void static void
registry_global(void *data, uint32_t id, uint32_t parent_id, registry_global(void *data, uint32_t id,
uint32_t permissions, uint32_t type, uint32_t version, uint32_t permissions, uint32_t type, uint32_t version,
const struct spa_dict *props) const struct spa_dict *props)
{ {
...@@ -145,8 +145,7 @@ registry_global(void *data, uint32_t id, uint32_t parent_id, ...@@ -145,8 +145,7 @@ registry_global(void *data, uint32_t id, uint32_t parent_id,
break; break;
} }
g_signal_emit (data, signals[SIGNAL_GLOBAL_ADDED], detail, id, parent_id, g_signal_emit (data, signals[SIGNAL_GLOBAL_ADDED], detail, id, props);
props);
} }
static void static void
...@@ -337,8 +336,7 @@ wp_remote_pipewire_class_init (WpRemotePipewireClass *klass) ...@@ -337,8 +336,7 @@ wp_remote_pipewire_class_init (WpRemotePipewireClass *klass)
/* Signals */ /* Signals */
signals[SIGNAL_GLOBAL_ADDED] = g_signal_new ("global-added", signals[SIGNAL_GLOBAL_ADDED] = g_signal_new ("global-added",
G_TYPE_FROM_CLASS (klass), G_SIGNAL_DETAILED | G_SIGNAL_RUN_LAST, G_TYPE_FROM_CLASS (klass), G_SIGNAL_DETAILED | G_SIGNAL_RUN_LAST,
0, NULL, NULL, NULL, G_TYPE_NONE, 3, G_TYPE_UINT, G_TYPE_UINT, 0, NULL, NULL, NULL, G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_POINTER);
G_TYPE_POINTER);
signals[SIGNAL_GLOBAL_REMOVED] = g_signal_new ("global-removed", signals[SIGNAL_GLOBAL_REMOVED] = g_signal_new ("global-removed",
G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
0, NULL, NULL, NULL, G_TYPE_NONE, 1, G_TYPE_UINT); 0, NULL, NULL, NULL, G_TYPE_NONE, 1, G_TYPE_UINT);
...@@ -412,9 +410,9 @@ wp_remote_pipewire_export (WpRemotePipewire *self, guint type, ...@@ -412,9 +410,9 @@ wp_remote_pipewire_export (WpRemotePipewire *self, guint type,
gpointer gpointer
wp_remote_pipewire_module_load (WpRemotePipewire *self, const char *name, wp_remote_pipewire_module_load (WpRemotePipewire *self, const char *name,
const char *args, gpointer owner, gpointer parent, gpointer properties) const char *args, gpointer properties)
{ {
g_return_val_if_fail (WP_IS_REMOTE_PIPEWIRE(self), NULL); g_return_val_if_fail (WP_IS_REMOTE_PIPEWIRE(self), NULL);
return pw_module_load (self->core, name, args, owner, parent, properties); return pw_module_load (self->core, name, args, properties);
} }
...@@ -30,8 +30,7 @@ gpointer wp_remote_pipewire_load_spa_handle(WpRemotePipewire *self, ...@@ -30,8 +30,7 @@ gpointer wp_remote_pipewire_load_spa_handle(WpRemotePipewire *self,
gpointer wp_remote_pipewire_export (WpRemotePipewire *self, guint type, gpointer wp_remote_pipewire_export (WpRemotePipewire *self, guint type,
gpointer props, gpointer object, size_t user_data_size); gpointer props, gpointer object, size_t user_data_size);
gpointer wp_remote_pipewire_module_load (WpRemotePipewire *self, gpointer wp_remote_pipewire_module_load (WpRemotePipewire *self,
const char *name, const char *args, gpointer owner, gpointer parent, const char *name, const char *args, gpointer properties);
gpointer properties);
G_END_DECLS G_END_DECLS
......
...@@ -100,7 +100,7 @@ static const struct pw_client_proxy_events client_events = { ...@@ -100,7 +100,7 @@ static const struct pw_client_proxy_events client_events = {
}; };
static void static void
client_added (WpRemotePipewire * remote, guint32 id, guint32 parent_id, client_added (WpRemotePipewire * remote, guint32 id,
const struct spa_dict *properties, gpointer data) const struct spa_dict *properties, gpointer data)
{ {
struct client_data *d; struct client_data *d;
......
...@@ -35,9 +35,8 @@ wireplumber__module_init (WpModule * module, WpCore * core, GVariant * args) ...@@ -35,9 +35,8 @@ wireplumber__module_init (WpModule * module, WpCore * core, GVariant * args)
/* Load the client-device and adapter modules */ /* Load the client-device and adapter modules */
wp_remote_pipewire_module_load(rp, "libpipewire-module-client-device", NULL, wp_remote_pipewire_module_load(rp, "libpipewire-module-client-device", NULL,
NULL, NULL, NULL); NULL);
wp_remote_pipewire_module_load(rp, "libpipewire-module-adapter", NULL, NULL, wp_remote_pipewire_module_load(rp, "libpipewire-module-adapter", NULL, NULL);
NULL, NULL);
/* Register simple-endpoint and simple-endpoint-link */ /* Register simple-endpoint and simple-endpoint-link */
wp_factory_new (core, "pipewire-simple-endpoint", wp_factory_new (core, "pipewire-simple-endpoint",
......
...@@ -201,18 +201,23 @@ on_proxy_port_created(GObject *initable, GAsyncResult *res, gpointer data) ...@@ -201,18 +201,23 @@ on_proxy_port_created(GObject *initable, GAsyncResult *res, gpointer data)
} }
static void static void
on_port_added(WpRemotePipewire *rp, guint id, guint parent_id, gconstpointer p, on_port_added(WpRemotePipewire *rp, guint id, gconstpointer p, gpointer d)
gpointer d)
{ {
WpPipewireSimpleEndpoint *self = d; WpPipewireSimpleEndpoint *self = d;
struct pw_port_proxy *port_proxy = NULL; struct pw_port_proxy *port_proxy = NULL;
const struct spa_dict *props = p;
const char *s;
guint node_id = 0;
/* Don't do anything if we are aborting */ /* Don't do anything if we are aborting */
if (self->init_abort) if (self->init_abort)
return; return;
if ((s = spa_dict_lookup(props, PW_KEY_NODE_ID)))
node_id = atoi(s);
/* Only handle ports owned by this endpoint */ /* Only handle ports owned by this endpoint */
if (parent_id != self->global_id) if (node_id != self->global_id)
return; return;
/* Create the proxy port async */ /* Create the proxy port async */
......
...@@ -90,8 +90,7 @@ on_endpoint_created(GObject *initable, GAsyncResult *res, gpointer d) ...@@ -90,8 +90,7 @@ on_endpoint_created(GObject *initable, GAsyncResult *res, gpointer d)
} }
static void static void
on_node_added(WpRemotePipewire *rp, guint id, guint parent_id, gconstpointer p, on_node_added(WpRemotePipewire *rp, guint id, gconstpointer p, gpointer d)
gpointer d)
{ {
struct impl *impl = d; struct impl *impl = d;
const struct spa_dict *props = p; const struct spa_dict *props = p;
......
...@@ -51,8 +51,7 @@ on_endpoint_created(GObject *initable, GAsyncResult *res, gpointer d) ...@@ -51,8 +51,7 @@ on_endpoint_created(GObject *initable, GAsyncResult *res, gpointer d)
} }
static void static void
on_node_added (WpRemotePipewire *rp, guint id, guint parent_id, gconstpointer p, on_node_added (WpRemotePipewire *rp, guint id, gconstpointer p, gpointer d)
gpointer d)
{ {
struct module_data *data = d; struct module_data *data = d;
const struct spa_dict *props = p; const struct spa_dict *props = p;
......
...@@ -117,12 +117,15 @@ on_audio_stream_port_created(GObject *initable, GAsyncResult *res, ...@@ -117,12 +117,15 @@ on_audio_stream_port_created(GObject *initable, GAsyncResult *res,
} }
static void static void
on_audio_stream_port_added(WpRemotePipewire *rp, guint id, guint parent_id, on_audio_stream_port_added(WpRemotePipewire *rp, guint id, gconstpointer p,
gconstpointer p, gpointer d) gpointer d)
{ {
WpAudioStream *self = d; WpAudioStream *self = d;
const struct pw_node_info *info = NULL; const struct pw_node_info *info = NULL;
struct pw_proxy *proxy = NULL; struct pw_proxy *proxy = NULL;
const struct spa_dict *props = p;
const char *s;
guint node_id = 0;
/* Get the node id */ /* Get the node id */
g_return_if_fail (WP_AUDIO_STREAM_GET_CLASS (self)->get_info); g_return_if_fail (WP_AUDIO_STREAM_GET_CLASS (self)->get_info);
...@@ -130,8 +133,11 @@ on_audio_stream_port_added(WpRemotePipewire *rp, guint id, guint parent_id, ...@@ -130,8 +133,11 @@ on_audio_stream_port_added(WpRemotePipewire *rp, guint id, guint parent_id,
if (!info) if (!info)
return; return;
if ((s = spa_dict_lookup(props, PW_KEY_NODE_ID)))
node_id = atoi(s);
/* Skip ports that are not owned by this stream */ /* Skip ports that are not owned by this stream */
if (info->id != parent_id) if (info->id != node_id)
return; return;
/* Create the port proxy async */ /* Create the port proxy async */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment