mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-10 13:30:05 -05:00
cleanups
Remove signals. Rename callbacks -> events, use listeners to listen for events. Callbacks are still used in spa for things you can listen to only once.
This commit is contained in:
parent
b898eb46cd
commit
1b79419554
64 changed files with 779 additions and 880 deletions
|
|
@ -327,13 +327,13 @@ struct node_data {
|
|||
struct pw_node_proxy *node;
|
||||
uint32_t id;
|
||||
uint32_t parent_id;
|
||||
struct pw_callback_info node_listener;
|
||||
struct pw_listener node_listener;
|
||||
};
|
||||
|
||||
struct registry_data {
|
||||
GstPipeWireDeviceProvider *self;
|
||||
struct pw_registry_proxy *registry;
|
||||
struct pw_callback_info registry_listener;
|
||||
struct pw_listener registry_listener;
|
||||
};
|
||||
|
||||
static void node_event_info(void *data, struct pw_node_info *info)
|
||||
|
|
@ -351,8 +351,8 @@ static void node_event_info(void *data, struct pw_node_info *info)
|
|||
}
|
||||
}
|
||||
|
||||
static const struct pw_node_events node_events = {
|
||||
PW_VERSION_NODE_EVENTS,
|
||||
static const struct pw_node_proxy_events node_events = {
|
||||
PW_VERSION_NODE_PROXY_EVENTS,
|
||||
.info = node_event_info
|
||||
};
|
||||
|
||||
|
|
@ -399,16 +399,16 @@ static void registry_event_global_remove(void *data, uint32_t id)
|
|||
}
|
||||
}
|
||||
|
||||
static const struct pw_registry_events registry_events = {
|
||||
PW_VERSION_REGISTRY_EVENTS,
|
||||
static const struct pw_registry_proxy_events registry_events = {
|
||||
PW_VERSION_REGISTRY_PROXY_EVENTS,
|
||||
.global = registry_event_global,
|
||||
.global_remove = registry_event_global_remove,
|
||||
};
|
||||
|
||||
static const struct pw_remote_callbacks remote_callbacks = {
|
||||
PW_VERSION_REMOTE_CALLBACKS,
|
||||
.state_changed = on_state_changed,
|
||||
.sync_reply = on_sync_reply,
|
||||
static const struct pw_remote_events remote_events = {
|
||||
PW_VERSION_REMOTE_EVENTS,
|
||||
.state_changed = on_state_changed,
|
||||
.sync_reply = on_sync_reply,
|
||||
};
|
||||
|
||||
static GList *
|
||||
|
|
@ -421,7 +421,7 @@ gst_pipewire_device_provider_probe (GstDeviceProvider * provider)
|
|||
struct pw_remote *r = NULL;
|
||||
struct pw_registry_proxy *reg = NULL;
|
||||
struct registry_data *data;
|
||||
struct pw_callback_info callbacks;
|
||||
struct pw_listener listener;
|
||||
|
||||
GST_DEBUG_OBJECT (self, "starting probe");
|
||||
|
||||
|
|
@ -436,7 +436,7 @@ gst_pipewire_device_provider_probe (GstDeviceProvider * provider)
|
|||
if (!(r = pw_remote_new (c, NULL)))
|
||||
goto failed;
|
||||
|
||||
pw_remote_add_callbacks(r, &callbacks, &remote_callbacks, self);
|
||||
pw_remote_add_listener(r, &listener, &remote_events, self);
|
||||
|
||||
pw_remote_connect (r);
|
||||
|
||||
|
|
@ -528,7 +528,7 @@ gst_pipewire_device_provider_start (GstDeviceProvider * provider)
|
|||
goto failed_remote;
|
||||
}
|
||||
|
||||
pw_remote_add_callbacks (self->remote, &self->remote_callbacks, &remote_callbacks, self);
|
||||
pw_remote_add_listener (self->remote, &self->remote_listener, &remote_events, self);
|
||||
|
||||
pw_remote_connect (self->remote);
|
||||
for (;;) {
|
||||
|
|
|
|||
|
|
@ -86,14 +86,16 @@ struct _GstPipeWireDeviceProvider {
|
|||
|
||||
struct pw_core *core;
|
||||
struct pw_type *type;
|
||||
|
||||
struct pw_remote *remote;
|
||||
struct pw_listener remote_listener;
|
||||
|
||||
struct pw_core_proxy *core_proxy;
|
||||
struct pw_registry_proxy *registry;
|
||||
|
||||
gboolean end;
|
||||
gboolean list_only;
|
||||
GList **devices;
|
||||
struct pw_callback_info remote_callbacks;
|
||||
};
|
||||
|
||||
struct _GstPipeWireDeviceProviderClass {
|
||||
|
|
|
|||
|
|
@ -734,8 +734,8 @@ copy_properties (GQuark field_id,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static const struct pw_stream_callbacks stream_callbacks = {
|
||||
PW_VERSION_STREAM_CALLBACKS,
|
||||
static const struct pw_stream_events stream_events = {
|
||||
PW_VERSION_STREAM_EVENTS,
|
||||
.state_changed = on_state_changed,
|
||||
.format_changed = on_format_changed,
|
||||
.add_buffer = on_add_buffer,
|
||||
|
|
@ -763,10 +763,10 @@ gst_pipewire_sink_start (GstBaseSink * basesink)
|
|||
pwsink->stream = pw_stream_new (pwsink->remote, pwsink->client_name, props);
|
||||
pwsink->pool->stream = pwsink->stream;
|
||||
|
||||
pw_stream_add_callbacks(pwsink->stream,
|
||||
&pwsink->stream_callbacks,
|
||||
&stream_callbacks,
|
||||
pwsink);
|
||||
pw_stream_add_listener(pwsink->stream,
|
||||
&pwsink->stream_listener,
|
||||
&stream_events,
|
||||
pwsink);
|
||||
|
||||
pw_thread_loop_unlock (pwsink->main_loop);
|
||||
|
||||
|
|
@ -812,8 +812,8 @@ on_remote_state_changed (void *data, enum pw_remote_state old, enum pw_remote_st
|
|||
pw_thread_loop_signal (pwsink->main_loop, FALSE);
|
||||
}
|
||||
|
||||
static const struct pw_remote_callbacks remote_callbacks = {
|
||||
PW_VERSION_REMOTE_CALLBACKS,
|
||||
static const struct pw_remote_events remote_events = {
|
||||
PW_VERSION_REMOTE_EVENTS,
|
||||
.state_changed = on_remote_state_changed,
|
||||
};
|
||||
|
||||
|
|
@ -828,9 +828,9 @@ gst_pipewire_sink_open (GstPipeWireSink * pwsink)
|
|||
pw_thread_loop_lock (pwsink->main_loop);
|
||||
pwsink->remote = pw_remote_new (pwsink->core, NULL);
|
||||
|
||||
pw_remote_add_callbacks (pwsink->remote,
|
||||
&pwsink->remote_callbacks,
|
||||
&remote_callbacks, pwsink);
|
||||
pw_remote_add_listener (pwsink->remote,
|
||||
&pwsink->remote_listener,
|
||||
&remote_events, pwsink);
|
||||
|
||||
pw_remote_connect (pwsink->remote);
|
||||
|
||||
|
|
|
|||
|
|
@ -83,10 +83,10 @@ struct _GstPipeWireSink {
|
|||
struct pw_core *core;
|
||||
struct pw_type *type;
|
||||
struct pw_remote *remote;
|
||||
struct pw_callback_info remote_callbacks;
|
||||
struct pw_listener remote_listener;
|
||||
|
||||
struct pw_stream *stream;
|
||||
struct pw_callback_info stream_callbacks;
|
||||
struct pw_listener stream_listener;
|
||||
|
||||
GstAllocator *allocator;
|
||||
GstStructure *properties;
|
||||
|
|
|
|||
|
|
@ -1008,13 +1008,13 @@ copy_properties (GQuark field_id,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static const struct pw_remote_callbacks remote_callbacks = {
|
||||
PW_VERSION_REMOTE_CALLBACKS,
|
||||
static const struct pw_remote_events remote_events = {
|
||||
PW_VERSION_REMOTE_EVENTS,
|
||||
.state_changed = on_remote_state_changed,
|
||||
};
|
||||
|
||||
static const struct pw_stream_callbacks stream_callbacks = {
|
||||
PW_VERSION_STREAM_CALLBACKS,
|
||||
static const struct pw_stream_events stream_events = {
|
||||
PW_VERSION_STREAM_EVENTS,
|
||||
.state_changed = on_state_changed,
|
||||
.format_changed = on_format_changed,
|
||||
.add_buffer = on_add_buffer,
|
||||
|
|
@ -1035,9 +1035,9 @@ gst_pipewire_src_open (GstPipeWireSrc * pwsrc)
|
|||
if ((pwsrc->remote = pw_remote_new (pwsrc->core, NULL)) == NULL)
|
||||
goto no_remote;
|
||||
|
||||
pw_remote_add_callbacks (pwsrc->remote,
|
||||
&pwsrc->remote_callbacks,
|
||||
&remote_callbacks, pwsrc);
|
||||
pw_remote_add_listener (pwsrc->remote,
|
||||
&pwsrc->remote_listener,
|
||||
&remote_events, pwsrc);
|
||||
|
||||
pw_remote_connect (pwsrc->remote);
|
||||
|
||||
|
|
@ -1065,10 +1065,10 @@ gst_pipewire_src_open (GstPipeWireSrc * pwsrc)
|
|||
goto no_stream;
|
||||
|
||||
|
||||
pw_stream_add_callbacks(pwsrc->stream,
|
||||
&pwsrc->stream_callbacks,
|
||||
&stream_callbacks,
|
||||
pwsrc);
|
||||
pw_stream_add_listener(pwsrc->stream,
|
||||
&pwsrc->stream_listener,
|
||||
&stream_events,
|
||||
pwsrc);
|
||||
|
||||
|
||||
pwsrc->clock = gst_pipewire_clock_new (pwsrc->stream);
|
||||
|
|
|
|||
|
|
@ -70,10 +70,10 @@ struct _GstPipeWireSrc {
|
|||
struct pw_core *core;
|
||||
struct pw_type *type;
|
||||
struct pw_remote *remote;
|
||||
struct pw_callback_info remote_callbacks;
|
||||
struct pw_listener remote_listener;
|
||||
|
||||
struct pw_stream *stream;
|
||||
struct pw_callback_info stream_callbacks;
|
||||
struct pw_listener stream_listener;
|
||||
|
||||
GstAllocator *fd_allocator;
|
||||
GstStructure *properties;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue