From 38fbe5899943afe4a08b664136484fe270fcbb6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Tue, 16 Feb 2016 15:44:48 +0000 Subject: [PATCH] vaapisink: post message for application for unhandled keyboard/mouse events Makes (most) keyboard shortcuts work in gst-play-1.0 when the video window has focus. --- gst/vaapi/gstvaapisink.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gst/vaapi/gstvaapisink.c b/gst/vaapi/gstvaapisink.c index 4da72bc0c2..0bdc714497 100644 --- a/gst/vaapi/gstvaapisink.c +++ b/gst/vaapi/gstvaapisink.c @@ -865,7 +865,13 @@ gst_vaapisink_navigation_send_event (GstNavigation * navigation, (gdouble) y * yscale, NULL); } - gst_pad_send_event (peer, event); + if (!gst_pad_send_event (peer, 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_event_unref (event); gst_object_unref (peer); } }