diff options
author | Seungha Yang <seungha@centricular.com> | 2020-10-13 17:57:53 +0900 |
---|---|---|
committer | GStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2020-10-14 18:24:11 +0000 |
commit | bcabdfb0f9cbf9671a9f387738b72a7b1b45219c (patch) | |
tree | 3ad756eaee10e9aef939ed5441cdf66fa54e6a74 /gst/playback | |
parent | 615b1ac5798475bb1666d7952beab5c5f1033b2c (diff) | |
download | gstreamer-plugins-base-bcabdfb0f9cbf9671a9f387738b72a7b1b45219c.tar.gz |
uridecodebin3: Forward upstream events to decodebin3 directly
Otherwise default handler will try to forward it to sink element
or srcpad which might not be available at that moment.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/867>
Diffstat (limited to 'gst/playback')
-rw-r--r-- | gst/playback/gsturidecodebin3.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gst/playback/gsturidecodebin3.c b/gst/playback/gsturidecodebin3.c index 0286d95be..fcfdbf4a0 100644 --- a/gst/playback/gsturidecodebin3.c +++ b/gst/playback/gsturidecodebin3.c @@ -345,6 +345,8 @@ static GstSourceHandler *new_source_handler (GstURIDecodeBin3 * uridecodebin, static GstStateChangeReturn gst_uri_decode_bin3_change_state (GstElement * element, GstStateChange transition); +static gboolean gst_uri_decodebin3_send_event (GstElement * element, + GstEvent * event); static gboolean _gst_int_accumulator (GSignalInvocationHint * ihint, @@ -515,6 +517,8 @@ gst_uri_decode_bin3_class_init (GstURIDecodeBin3Class * klass) "Edward Hervey <edward@centricular.com>, Jan Schmidt <jan@centricular.com>"); gstelement_class->change_state = gst_uri_decode_bin3_change_state; + gstelement_class->send_event = + GST_DEBUG_FUNCPTR (gst_uri_decodebin3_send_event); klass->select_stream = gst_uridecodebin3_select_stream; } @@ -1118,6 +1122,16 @@ failure: } } +static gboolean +gst_uri_decodebin3_send_event (GstElement * element, GstEvent * event) +{ + GstURIDecodeBin3 *self = GST_URI_DECODE_BIN3 (element); + + if (GST_EVENT_IS_UPSTREAM (event) && self->decodebin) + return gst_element_send_event (self->decodebin, event); + + return GST_ELEMENT_CLASS (parent_class)->send_event (element, event); +} gboolean gst_uri_decode_bin3_plugin_init (GstPlugin * plugin) |