From f18d14db4527381e390352730eaa955f51c08e66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florent=20Thi=C3=A9ry?= Date: Sat, 26 Dec 2015 22:34:29 +0100 Subject: [PATCH] glimagesink: Post unhandled navigation events on the bus Based off xvimagesink implementation https://bugzilla.gnome.org/show_bug.cgi?id=759869 --- ext/gl/gstglimagesink.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/ext/gl/gstglimagesink.c b/ext/gl/gstglimagesink.c index dc25e66653..4f7529e375 100644 --- a/ext/gl/gstglimagesink.c +++ b/ext/gl/gstglimagesink.c @@ -409,8 +409,8 @@ gst_glimage_sink_navigation_send_event (GstNavigation * navigation, GstStructure * structure) { GstGLImageSink *sink = GST_GLIMAGE_SINK (navigation); + gboolean handled = FALSE; GstEvent *event = NULL; - GstPad *pad = NULL; GstGLWindow *window; guint width, height; gdouble x, y; @@ -427,9 +427,6 @@ gst_glimage_sink_navigation_send_event (GstNavigation * navigation, GstStructure height = GST_VIDEO_SINK_HEIGHT (sink); gst_gl_window_get_surface_dimensions (window, &width, &height); - event = gst_event_new_navigation (structure); - - pad = gst_pad_get_peer (GST_VIDEO_SINK_PAD (sink)); /* Converting pointer coordinates to the non scaled geometry */ if (width != 0 && gst_structure_get_double (structure, "pointer_x", &x) && height != 0 && gst_structure_get_double (structure, "pointer_y", &y)) { @@ -441,10 +438,17 @@ gst_glimage_sink_navigation_send_event (GstNavigation * navigation, GstStructure stream_x, "pointer_y", G_TYPE_DOUBLE, stream_y, NULL); } - if (GST_IS_PAD (pad) && GST_IS_EVENT (event)) - gst_pad_send_event (pad, event); + event = gst_event_new_navigation (structure); + if (event) { + gst_event_ref (event); + handled = gst_pad_push_event (GST_VIDEO_SINK_PAD (sink), event); - gst_object_unref (pad); + if (!handled) + gst_element_post_message ((GstElement *) sink, + gst_navigation_message_new_event ((GstObject *) sink, event)); + + gst_event_unref (event); + } gst_object_unref (window); }