From 1b258f4ecc2a8148c550c65b03de71071ad44fcc Mon Sep 17 00:00:00 2001 From: Arun Raghavan Date: Fri, 28 Mar 2025 09:48:35 -0400 Subject: [PATCH] gst: sink: Only add VideoCrop meta for video --- src/gst/gstpipewiresink.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/gst/gstpipewiresink.c b/src/gst/gstpipewiresink.c index 2afcbbd78..c40fd32ec 100644 --- a/src/gst/gstpipewiresink.c +++ b/src/gst/gstpipewiresink.c @@ -305,6 +305,7 @@ gst_pipewire_sink_update_params (GstPipeWireSink *sink) struct spa_pod_builder b = { NULL }; uint8_t buffer[1024]; struct spa_pod_frame f; + guint n_params = 0; config = gst_buffer_pool_get_config (GST_BUFFER_POOL (pool)); gst_buffer_pool_config_get_params (config, &caps, &size, &min_buffers, &max_buffers); @@ -337,20 +338,22 @@ gst_pipewire_sink_update_params (GstPipeWireSink *sink) (1<is_video) { + port_params[n_params++] = spa_pod_builder_add_object (&b, + SPA_TYPE_OBJECT_ParamMeta, SPA_PARAM_Meta, + SPA_PARAM_META_type, SPA_POD_Id(SPA_META_VideoCrop), + SPA_PARAM_META_size, SPA_POD_Int(sizeof (struct spa_meta_region))); + } pw_thread_loop_lock (sink->stream->core->loop); - pw_stream_update_params (sink->stream->pwstream, port_params, 3); + pw_stream_update_params (sink->stream->pwstream, port_params, n_params); pw_thread_loop_unlock (sink->stream->core->loop); }