doc: Add some explanation about the logic of when to post navigation message in code

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/9130>
This commit is contained in:
Thibault Saunier 2025-05-30 09:40:21 +02:00 committed by GStreamer Marge Bot
parent dab38ddaac
commit 450f2343cf
2 changed files with 6 additions and 1 deletions

View File

@ -1348,9 +1348,12 @@ gst_xv_image_sink_navigation_send_event (GstNavigation * navigation,
gst_event_ref (event);
handled = gst_pad_push_event (GST_VIDEO_SINK_PAD (xvimagesink), event);
if (!handled)
if (!handled) {
/* If the event was not handled/used upstream,
* we post it as a message on the bus so that applications can handle it */
gst_element_post_message ((GstElement *) xvimagesink,
gst_navigation_message_new_event ((GstObject *) xvimagesink, event));
}
gst_event_unref (event);
}

View File

@ -507,6 +507,8 @@ gst_osx_video_sink_navigation_send_event (GstNavigation * navigation,
gst_event_ref (event);
if (!gst_pad_push_event (GST_VIDEO_SINK_PAD (osxvideosink), event)) {
/* If the event was not handled/used upstream,
* we post it as a message on the bus so that applications can handle it */
gst_element_post_message (GST_ELEMENT_CAST (osxvideosink),
gst_navigation_message_new_event (GST_OBJECT_CAST (osxvideosink), event));
}