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.
This commit is contained in:
Tim-Philipp Müller 2016-02-16 15:44:48 +00:00
parent 26abec3e26
commit 38fbe58999

View file

@ -865,7 +865,13 @@ gst_vaapisink_navigation_send_event (GstNavigation * navigation,
(gdouble) y * yscale, NULL); (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); gst_object_unref (peer);
} }
} }