aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-multimedia
diff options
context:
space:
mode:
authorYuqing Zhu <b54851@freescale.com>2015-08-21 22:29:54 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-12 22:47:07 +0100
commit68591de72e27a985242d6ff19fffb80f69869003 (patch)
treea7923756e1bcddc619f85ff106a74e63a0b532ef /meta/recipes-multimedia
parent19a2016bff489809af4852a20b9feebcc835a446 (diff)
downloadopenembedded-core-contrib-68591de72e27a985242d6ff19fffb80f69869003.tar.gz
gstreamer1.0: Fix QoS/lateness checking if subclass implements prepare/prepare_list vfuncs
In function gst_base_sink_chain_unlocked(), it should calculate jitter based on current media clock, rather than just passing 0. Or it will drop all the frames when rewind in slow speed, such as -2X. Signed-off-by: Yuqing Zhu <b54851@freescale.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/recipes-multimedia')
-rw-r--r--meta/recipes-multimedia/gstreamer/gstreamer1.0/0002-basesink-Fix-QoS-lateness-checking-if-subclass-imple.patch70
-rw-r--r--meta/recipes-multimedia/gstreamer/gstreamer1.0_1.4.5.bb1
2 files changed, 71 insertions, 0 deletions
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0/0002-basesink-Fix-QoS-lateness-checking-if-subclass-imple.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0/0002-basesink-Fix-QoS-lateness-checking-if-subclass-imple.patch
new file mode 100644
index 0000000000..b6edda1cf7
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0/0002-basesink-Fix-QoS-lateness-checking-if-subclass-imple.patch
@@ -0,0 +1,70 @@
+From 6914566ed6a89c96973a578aa5ecd01ee68cdcfd Mon Sep 17 00:00:00 2001
+From: Jian <Jian.Li@freescale.com>
+Date: Thu, 14 May 2015 15:49:43 +0800
+Subject: [PATCH] basesink: Fix QoS/lateness checking if subclass implements
+ prepare/prepare_list vfuncs
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+In basesink functions gst_base_sink_chain_unlocked(), below code is used to
+checking if buffer is late before doing prepare call to save some effort:
+ if (syncable && do_sync)
+ late =
+ gst_base_sink_is_too_late (basesink, obj, rstart, rstop,
+ GST_CLOCK_EARLY, 0, FALSE);
+
+ if (G_UNLIKELY (late))
+ goto dropped;
+
+But this code has problem, it should calculate jitter based on current media
+clock, rather than just passing 0. I found it will drop all the frames when
+rewind in slow speed, such as -2X.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=749258
+
+Upstream-Status: Backport [1.5.1]
+---
+ libs/gst/base/gstbasesink.c | 26 ++++++++++++++++++++++----
+ 1 file changed, 22 insertions(+), 4 deletions(-)
+
+diff --git a/libs/gst/base/gstbasesink.c b/libs/gst/base/gstbasesink.c
+index a505695..5fb2d6a 100644
+--- a/libs/gst/base/gstbasesink.c
++++ b/libs/gst/base/gstbasesink.c
+@@ -3369,10 +3369,28 @@ gst_base_sink_chain_unlocked (GstBaseSink * basesink, GstPad * pad,
+ if (G_UNLIKELY (stepped))
+ goto dropped;
+
+- if (syncable && do_sync)
+- late =
+- gst_base_sink_is_too_late (basesink, obj, rstart, rstop,
+- GST_CLOCK_EARLY, 0, FALSE);
++ if (syncable && do_sync) {
++ GstClock *clock;
++
++ GST_OBJECT_LOCK (basesink);
++ clock = GST_ELEMENT_CLOCK (basesink);
++ if (clock && GST_STATE (basesink) == GST_STATE_PLAYING) {
++ GstClockTime base_time;
++ GstClockTime stime;
++ GstClockTime now;
++
++ base_time = GST_ELEMENT_CAST (basesink)->base_time;
++ stime = base_time + gst_base_sink_adjust_time (basesink, rstart);
++ now = gst_clock_get_time (clock);
++ GST_OBJECT_UNLOCK (basesink);
++
++ late =
++ gst_base_sink_is_too_late (basesink, obj, rstart, rstop,
++ GST_CLOCK_EARLY, GST_CLOCK_DIFF (stime, now), FALSE);
++ } else {
++ GST_OBJECT_UNLOCK (basesink);
++ }
++ }
+
+ if (G_UNLIKELY (late))
+ goto dropped;
+--
+1.7.9.5
+
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.4.5.bb b/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.4.5.bb
index 902f79d60d..db58754a68 100644
--- a/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.4.5.bb
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0_1.4.5.bb
@@ -8,6 +8,7 @@ SRC_URI = " \
file://0001-Fix-crash-with-gst-inspect.patch \
file://0001-gstinfo-Shorten-__FILE__-on-all-platforms.patch \
file://inputselector-sticky-events-haven-t-send-out-when-ac-1-4-1.patch \
+ file://0002-basesink-Fix-QoS-lateness-checking-if-subclass-imple.patch \
"
SRC_URI[md5sum] = "88a9289c64a4950ebb4f544980234289"
SRC_URI[sha256sum] = "40801aa7f979024526258a0e94707ba42b8ab6f7d2206e56adbc4433155cb0ae"