diff options
author | Seungha Yang <seungha@centricular.com> | 2020-10-13 17:57:53 +0900 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2020-10-14 15:51:47 +0100 |
commit | c7c870e045a942ca06d81ef1f955e54388004fe1 (patch) | |
tree | 531d6467a26ff30c1feba78e1b206e036e7c9b56 | |
parent | e054b1b7058005d9b8bc720125329d872369f8a1 (diff) | |
download | gstreamer-plugins-base-c7c870e045a942ca06d81ef1f955e54388004fe1.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.
-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) |