mirror of
https://gitlab.freedesktop.org/pipewire/wireplumber.git
synced 2026-05-05 22:58:02 +02:00
Update for the pw_global "parent" concept removal
This commit is contained in:
parent
fbf8de84fa
commit
d4f882d731
8 changed files with 28 additions and 23 deletions
|
|
@ -113,7 +113,7 @@ static guint signals[LAST_SIGNAL] = { 0 };
|
|||
G_DEFINE_TYPE (WpRemotePipewire, wp_remote_pipewire, WP_TYPE_REMOTE)
|
||||
|
||||
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,
|
||||
const struct spa_dict *props)
|
||||
{
|
||||
|
|
@ -145,8 +145,7 @@ registry_global(void *data, uint32_t id, uint32_t parent_id,
|
|||
break;
|
||||
}
|
||||
|
||||
g_signal_emit (data, signals[SIGNAL_GLOBAL_ADDED], detail, id, parent_id,
|
||||
props);
|
||||
g_signal_emit (data, signals[SIGNAL_GLOBAL_ADDED], detail, id, props);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -337,8 +336,7 @@ wp_remote_pipewire_class_init (WpRemotePipewireClass *klass)
|
|||
/* Signals */
|
||||
signals[SIGNAL_GLOBAL_ADDED] = g_signal_new ("global-added",
|
||||
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,
|
||||
G_TYPE_POINTER);
|
||||
0, NULL, NULL, NULL, G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_POINTER);
|
||||
signals[SIGNAL_GLOBAL_REMOVED] = g_signal_new ("global-removed",
|
||||
G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST,
|
||||
0, NULL, NULL, NULL, G_TYPE_NONE, 1, G_TYPE_UINT);
|
||||
|
|
@ -412,9 +410,9 @@ wp_remote_pipewire_export (WpRemotePipewire *self, guint type,
|
|||
|
||||
gpointer
|
||||
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);
|
||||
|
||||
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,
|
|||
gpointer wp_remote_pipewire_export (WpRemotePipewire *self, guint type,
|
||||
gpointer props, gpointer object, size_t user_data_size);
|
||||
gpointer wp_remote_pipewire_module_load (WpRemotePipewire *self,
|
||||
const char *name, const char *args, gpointer owner, gpointer parent,
|
||||
gpointer properties);
|
||||
const char *name, const char *args, gpointer properties);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ static const struct pw_client_proxy_events client_events = {
|
|||
};
|
||||
|
||||
static void
|
||||
client_added (WpRemotePipewire * remote, guint32 id, guint32 parent_id,
|
||||
client_added (WpRemotePipewire * remote, guint32 id,
|
||||
const struct spa_dict *properties, gpointer data)
|
||||
{
|
||||
struct client_data *d;
|
||||
|
|
|
|||
|
|
@ -35,9 +35,8 @@ wireplumber__module_init (WpModule * module, WpCore * core, GVariant * args)
|
|||
|
||||
/* Load the client-device and adapter modules */
|
||||
wp_remote_pipewire_module_load(rp, "libpipewire-module-client-device", NULL,
|
||||
NULL, NULL, NULL);
|
||||
wp_remote_pipewire_module_load(rp, "libpipewire-module-adapter", NULL, NULL,
|
||||
NULL, NULL);
|
||||
NULL);
|
||||
wp_remote_pipewire_module_load(rp, "libpipewire-module-adapter", NULL, NULL);
|
||||
|
||||
/* Register simple-endpoint and simple-endpoint-link */
|
||||
wp_factory_new (core, "pipewire-simple-endpoint",
|
||||
|
|
|
|||
|
|
@ -201,18 +201,23 @@ on_proxy_port_created(GObject *initable, GAsyncResult *res, gpointer data)
|
|||
}
|
||||
|
||||
static void
|
||||
on_port_added(WpRemotePipewire *rp, guint id, guint parent_id, gconstpointer p,
|
||||
gpointer d)
|
||||
on_port_added(WpRemotePipewire *rp, guint id, gconstpointer p, gpointer d)
|
||||
{
|
||||
WpPipewireSimpleEndpoint *self = d;
|
||||
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 */
|
||||
if (self->init_abort)
|
||||
return;
|
||||
|
||||
if ((s = spa_dict_lookup(props, PW_KEY_NODE_ID)))
|
||||
node_id = atoi(s);
|
||||
|
||||
/* Only handle ports owned by this endpoint */
|
||||
if (parent_id != self->global_id)
|
||||
if (node_id != self->global_id)
|
||||
return;
|
||||
|
||||
/* Create the proxy port async */
|
||||
|
|
|
|||
|
|
@ -90,8 +90,7 @@ on_endpoint_created(GObject *initable, GAsyncResult *res, gpointer d)
|
|||
}
|
||||
|
||||
static void
|
||||
on_node_added(WpRemotePipewire *rp, guint id, guint parent_id, gconstpointer p,
|
||||
gpointer d)
|
||||
on_node_added(WpRemotePipewire *rp, guint id, gconstpointer p, gpointer d)
|
||||
{
|
||||
struct impl *impl = d;
|
||||
const struct spa_dict *props = p;
|
||||
|
|
|
|||
|
|
@ -51,8 +51,7 @@ on_endpoint_created(GObject *initable, GAsyncResult *res, gpointer d)
|
|||
}
|
||||
|
||||
static void
|
||||
on_node_added (WpRemotePipewire *rp, guint id, guint parent_id, gconstpointer p,
|
||||
gpointer d)
|
||||
on_node_added (WpRemotePipewire *rp, guint id, gconstpointer p, gpointer d)
|
||||
{
|
||||
struct module_data *data = d;
|
||||
const struct spa_dict *props = p;
|
||||
|
|
|
|||
|
|
@ -117,12 +117,15 @@ on_audio_stream_port_created(GObject *initable, GAsyncResult *res,
|
|||
}
|
||||
|
||||
static void
|
||||
on_audio_stream_port_added(WpRemotePipewire *rp, guint id, guint parent_id,
|
||||
gconstpointer p, gpointer d)
|
||||
on_audio_stream_port_added(WpRemotePipewire *rp, guint id, gconstpointer p,
|
||||
gpointer d)
|
||||
{
|
||||
WpAudioStream *self = d;
|
||||
const struct pw_node_info *info = NULL;
|
||||
struct pw_proxy *proxy = NULL;
|
||||
const struct spa_dict *props = p;
|
||||
const char *s;
|
||||
guint node_id = 0;
|
||||
|
||||
/* Get the node id */
|
||||
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,
|
|||
if (!info)
|
||||
return;
|
||||
|
||||
if ((s = spa_dict_lookup(props, PW_KEY_NODE_ID)))
|
||||
node_id = atoi(s);
|
||||
|
||||
/* Skip ports that are not owned by this stream */
|
||||
if (info->id != parent_id)
|
||||
if (info->id != node_id)
|
||||
return;
|
||||
|
||||
/* Create the port proxy async */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue