From 21358526d5a0decf1f25f1fac92cdb48d5f2dc7f Mon Sep 17 00:00:00 2001 From: Michael Tretter Date: Wed, 19 Jun 2024 17:40:55 +0200 Subject: [PATCH] gst: pipewiresink: extract gst_pipewire_sink_update_params Add a helper function for updating the params instead of handling it in the pool_activated callback. This allows to explicitly set the params from the element. --- src/gst/gstpipewiresink.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/gst/gstpipewiresink.c b/src/gst/gstpipewiresink.c index 128995bc5..b4f9c39e0 100644 --- a/src/gst/gstpipewiresink.c +++ b/src/gst/gstpipewiresink.c @@ -244,8 +244,9 @@ gst_pipewire_sink_class_init (GstPipeWireSinkClass * klass) } static void -pool_activated (GstPipeWirePool *pool, GstPipeWireSink *sink) +gst_pipewire_sink_update_params (GstPipeWireSink *sink) { + GstPipeWirePool *pool = sink->stream->pool; GstStructure *config; GstCaps *caps; guint size; @@ -292,6 +293,13 @@ pool_activated (GstPipeWirePool *pool, GstPipeWireSink *sink) pw_thread_loop_unlock (sink->stream->core->loop); } +static void +pool_activated (GstPipeWirePool *pool, GstPipeWireSink *sink) +{ + GST_DEBUG_OBJECT (pool, "activated"); + gst_pipewire_sink_update_params (sink); +} + static void gst_pipewire_sink_init (GstPipeWireSink * sink) { @@ -577,7 +585,7 @@ on_param_changed (void *data, uint32_t id, const struct spa_pod *param) return; if (gst_buffer_pool_is_active (GST_BUFFER_POOL_CAST (pwsink->stream->pool))) - pool_activated (pwsink->stream->pool, pwsink); + gst_pipewire_sink_update_params (pwsink); } static gboolean