From 743097060e47e9db2754c5c1a401e5d4fa549124 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Dzi=C4=99giel?= Date: Sat, 2 Aug 2025 20:25:40 +0200 Subject: [PATCH] gst: sink: Remove unused posting of navigation messages We only need to post events in the pipeline for navigation to work. This was never used for anything and it generates a lot of noise in the pipeline bus when cursor is moving over video. --- src/lib/gst/plugin/gstclappersink.c | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/src/lib/gst/plugin/gstclappersink.c b/src/lib/gst/plugin/gstclappersink.c index d4fe23fe..cb631560 100644 --- a/src/lib/gst/plugin/gstclappersink.c +++ b/src/lib/gst/plugin/gstclappersink.c @@ -411,24 +411,18 @@ gst_clapper_sink_navigation_send_event (GstNavigation *navigation, { GstClapperSink *sink = GST_CLAPPER_SINK_CAST (navigation); GstEvent *event; + GstPad *pad; GST_TRACE_OBJECT (sink, "Navigation event: %" GST_PTR_FORMAT, structure); - event = gst_event_new_navigation (structure); + event = gst_event_new_navigation (structure); // transfer full + pad = gst_pad_get_peer (GST_VIDEO_SINK_PAD (sink)); - if (G_LIKELY (event)) { - GstPad *pad; + if (G_LIKELY (pad != NULL)) { + if (!gst_pad_send_event (pad, event)) // transfer full + GST_LOG_OBJECT (sink, "Upstream did not handle navigation event"); - pad = gst_pad_get_peer (GST_VIDEO_SINK_PAD (sink)); - - if (G_LIKELY (pad)) { - if (!gst_pad_send_event (pad, gst_event_ref (event))) { - /* If upstream didn't handle the event we'll post a message with it - * for the application in case it wants to do something with it */ - gst_element_post_message (GST_ELEMENT_CAST (sink), - gst_navigation_message_new_event (GST_OBJECT_CAST (sink), event)); - } - gst_object_unref (pad); - } + gst_object_unref (pad); + } else { gst_event_unref (event); } }