diff options
author | Yannick Gicquel <yannick.gicquel@iot.bzh> | 2016-11-10 14:55:11 +0100 |
---|---|---|
committer | Jan-Simon Moeller <jsmoeller@linuxfoundation.org> | 2016-11-14 08:39:06 +0000 |
commit | 0c615e0a7d176c53981b3526528c7a61169b5cf1 (patch) | |
tree | 6553376633ca1057d122103e2921e5410855de23 /meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/gstreamer/gstreamer1.0/inputselector-sticky-events-haven-t-send-out-when-ac-1-4-1.patch | |
parent | 3fc6095e75879cb66ca21d1c51140822f0f36ea5 (diff) |
meta-agl-bsp: backport: gstreamer1.0 v1.4.5 recipes
This is a backport from Jethro as meta-rcar-gen3 append on following:
- gstreamer1.0-libav_1.4.5
- gstreamer1.0-omx_1.2.0
- gstreamer1.0-plugins-bad_1.4.5
- gstreamer1.0-plugins-good_1.4.5
v2 (jsmoeller): Move into meta-rcar-gen3 subfolder as it only affects that layer.
Change-Id: Iefc9a2c10e76c172f1cb1f8d3babf3544828310e
Signed-off-by: Yannick Gicquel <yannick.gicquel@iot.bzh>
Signed-off-by: Jan-Simon Möller <jsmoeller@linuxfoundation.org>
Diffstat (limited to 'meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/gstreamer/gstreamer1.0/inputselector-sticky-events-haven-t-send-out-when-ac-1-4-1.patch')
-rwxr-xr-x | meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/gstreamer/gstreamer1.0/inputselector-sticky-events-haven-t-send-out-when-ac-1-4-1.patch | 167 |
1 files changed, 167 insertions, 0 deletions
diff --git a/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/gstreamer/gstreamer1.0/inputselector-sticky-events-haven-t-send-out-when-ac-1-4-1.patch b/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/gstreamer/gstreamer1.0/inputselector-sticky-events-haven-t-send-out-when-ac-1-4-1.patch new file mode 100755 index 000000000..f50ce6ff2 --- /dev/null +++ b/meta-agl-bsp/meta-rcar-gen3/recipes-multimedia/gstreamer/gstreamer1.0/inputselector-sticky-events-haven-t-send-out-when-ac-1-4-1.patch @@ -0,0 +1,167 @@ +From 83bed90c306ed3185d48febf6441177d638f7341 Mon Sep 17 00:00:00 2001 +From: Song Bing <b06498@freescale.com> +Date: Wed, 24 Dec 2014 10:13:51 +0800 +Subject: [PATCH] inputselector: sticky events haven't send out when active + track reach EOS + +EOS event hasn't been send to down-element. The resolution is block EOS event +of inactive pad, send the event after the pad actived. + +https://bugzilla.gnome.org/show_bug.cgi?id=740949 + +Upstream-Status: Backport [1.5.1] + +Signed-off-by: Song Bing <b06498@freescale.com> +--- + plugins/elements/gstinputselector.c | 58 ++++++++++++++++++++++++++--------- + plugins/elements/gstinputselector.h | 1 + + 2 files changed, 45 insertions(+), 14 deletions(-) + +diff --git a/plugins/elements/gstinputselector.c b/plugins/elements/gstinputselector.c +index fb50802..4461f7c 100644 +--- a/plugins/elements/gstinputselector.c ++++ b/plugins/elements/gstinputselector.c +@@ -440,6 +440,17 @@ gst_selector_pad_iterate_linked_pads (GstPad * pad, GstObject * parent) + } + + static gboolean ++gst_input_selector_eos_wait (GstInputSelector * self, GstSelectorPad * pad) ++{ ++ while (!self->eos && !self->flushing && !pad->flushing) { ++ /* we can be unlocked here when we are shutting down (flushing) or when we ++ * get unblocked */ ++ GST_INPUT_SELECTOR_WAIT (self); ++ } ++ return self->flushing; ++} ++ ++static gboolean + gst_selector_pad_event (GstPad * pad, GstObject * parent, GstEvent * event) + { + gboolean res = TRUE; +@@ -486,6 +497,7 @@ gst_selector_pad_event (GstPad * pad, GstObject * parent, GstEvent * event) + case GST_EVENT_FLUSH_START: + /* Unblock the pad if it's waiting */ + selpad->flushing = TRUE; ++ sel->eos = FALSE; + GST_INPUT_SELECTOR_BROADCAST (sel); + break; + case GST_EVENT_FLUSH_STOP: +@@ -523,21 +535,12 @@ gst_selector_pad_event (GstPad * pad, GstObject * parent, GstEvent * event) + case GST_EVENT_EOS: + selpad->eos = TRUE; + +- if (forward) { +- selpad->eos_sent = TRUE; +- } else { +- GstSelectorPad *active_selpad; +- +- /* If the active sinkpad is in EOS state but EOS +- * was not sent downstream this means that the pad +- * got EOS before it was set as active pad and that +- * the previously active pad got EOS after it was +- * active +- */ +- active_selpad = GST_SELECTOR_PAD (active_sinkpad); +- forward = (active_selpad->eos && !active_selpad->eos_sent); +- active_selpad->eos_sent = TRUE; ++ if (!forward) { ++ /* blocked until active the sind pad or flush */ ++ gst_input_selector_eos_wait (sel, selpad); ++ forward = TRUE; + } ++ selpad->eos_sent = TRUE; + GST_DEBUG_OBJECT (pad, "received EOS"); + break; + case GST_EVENT_GAP:{ +@@ -676,6 +679,12 @@ gst_input_selector_wait_running_time (GstInputSelector * sel, + gst_input_selector_activate_sinkpad (sel, GST_PAD_CAST (selpad)); + active_selpad = GST_SELECTOR_PAD_CAST (active_sinkpad); + ++ if (sel->eos) { ++ GST_DEBUG_OBJECT (sel, "Not waiting because inputselector reach EOS."); ++ GST_INPUT_SELECTOR_UNLOCK (sel); ++ return FALSE; ++ } ++ + if (seg->format != GST_FORMAT_TIME) { + GST_DEBUG_OBJECT (selpad, + "Not waiting because we don't have a TIME segment"); +@@ -971,6 +980,12 @@ gst_selector_pad_chain (GstPad * pad, GstObject * parent, GstBuffer * buf) + GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf))); + + GST_INPUT_SELECTOR_LOCK (sel); ++ if (sel->eos) { ++ GST_DEBUG_OBJECT (pad, "inputselector eos."); ++ GST_INPUT_SELECTOR_UNLOCK (sel); ++ goto eos; ++ } ++ + /* wait or check for flushing */ + if (gst_input_selector_wait (sel, selpad)) { + GST_INPUT_SELECTOR_UNLOCK (sel); +@@ -1151,6 +1166,13 @@ flushing: + res = GST_FLOW_FLUSHING; + goto done; + } ++eos: ++ { ++ GST_DEBUG_OBJECT (pad, "We are eos, discard buffer %p", buf); ++ gst_buffer_unref (buf); ++ res = GST_FLOW_EOS; ++ goto done; ++ } + } + + static void gst_input_selector_dispose (GObject * object); +@@ -1309,6 +1331,7 @@ gst_input_selector_init (GstInputSelector * sel) + g_mutex_init (&sel->lock); + g_cond_init (&sel->cond); + sel->blocked = FALSE; ++ sel->eos = FALSE; + + /* lets give a change for downstream to do something on + * active-pad change before we start pushing new buffers */ +@@ -1377,6 +1400,11 @@ gst_input_selector_set_active_pad (GstInputSelector * self, GstPad * pad) + GST_DEBUG_OBJECT (self, "New active pad is %" GST_PTR_FORMAT, + self->active_sinkpad); + ++ if (old != new && new->eos && !new->eos_sent) { ++ self->eos = TRUE; ++ GST_INPUT_SELECTOR_BROADCAST (self); ++ } ++ + return TRUE; + } + +@@ -1771,6 +1799,7 @@ gst_input_selector_change_state (GstElement * element, + switch (transition) { + case GST_STATE_CHANGE_READY_TO_PAUSED: + GST_INPUT_SELECTOR_LOCK (self); ++ self->eos = FALSE; + self->blocked = FALSE; + self->flushing = FALSE; + GST_INPUT_SELECTOR_UNLOCK (self); +@@ -1779,6 +1808,7 @@ gst_input_selector_change_state (GstElement * element, + /* first unlock before we call the parent state change function, which + * tries to acquire the stream lock when going to ready. */ + GST_INPUT_SELECTOR_LOCK (self); ++ self->eos = TRUE; + self->blocked = FALSE; + self->flushing = TRUE; + GST_INPUT_SELECTOR_BROADCAST (self); +diff --git a/plugins/elements/gstinputselector.h b/plugins/elements/gstinputselector.h +index 96c680f..9bf924f 100644 +--- a/plugins/elements/gstinputselector.h ++++ b/plugins/elements/gstinputselector.h +@@ -77,6 +77,7 @@ struct _GstInputSelector { + GMutex lock; + GCond cond; + gboolean blocked; ++ gboolean eos; + gboolean flushing; + }; + +-- +1.7.9.5 + |