summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2016-02-13 11:42:29 -0800
committerAndrei Gherzan <andrei@gherzan.ro>2016-03-10 14:56:07 +0100
commitf248d7cf8c6a421b43dcd3afdf74600e414266e4 (patch)
tree606d20322bc4635d7bbd0e915e856a6ed58df397
parent53e17683c5ee23097bc74184328a181c79977b40 (diff)
downloadmeta-raspberrypi-f248d7cf8c6a421b43dcd3afdf74600e414266e4.tar.gz
gstreamer1.0-omx: Backports and fixes for smooth video playback
Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--recipes-multimedia/gstreamer/gstreamer1.0-omx/0003-no-timeout-on-get-state.patch16
-rw-r--r--recipes-multimedia/gstreamer/gstreamer1.0-omx/0004-Properly-handle-drain-requests-while-flushing.patch69
-rw-r--r--recipes-multimedia/gstreamer/gstreamer1.0-omx/0005-Don-t-abort-gst_omx_video_dec_set_format-if-there-s-.patch30
-rw-r--r--recipes-multimedia/gstreamer/gstreamer1.0-omx_%.bbappend3
4 files changed, 118 insertions, 0 deletions
diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-omx/0003-no-timeout-on-get-state.patch b/recipes-multimedia/gstreamer/gstreamer1.0-omx/0003-no-timeout-on-get-state.patch
new file mode 100644
index 0000000..0a0050d
--- /dev/null
+++ b/recipes-multimedia/gstreamer/gstreamer1.0-omx/0003-no-timeout-on-get-state.patch
@@ -0,0 +1,16 @@
1diff --git a/omx/gstomxvideodec.c b/omx/gstomxvideodec.c
2index 0d4e7a1..a0d9c74 100644
3--- a/omx/gstomxvideodec.c
4+++ b/omx/gstomxvideodec.c
5@@ -1697,9 +1697,9 @@ gst_omx_video_dec_stop (GstVideoDecoder * decoder)
6 g_cond_broadcast (&self->drain_cond);
7 g_mutex_unlock (&self->drain_lock);
8
9- gst_omx_component_get_state (self->dec, 5 * GST_SECOND);
10+ gst_omx_component_get_state (self->dec, 0);
11 #if defined (USE_OMX_TARGET_RPI) && defined (HAVE_GST_GL)
12- gst_omx_component_get_state (self->egl_render, 1 * GST_SECOND);
13+ gst_omx_component_get_state (self->egl_render, 0);
14 #endif
15
16 gst_buffer_replace (&self->codec_data, NULL);
diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-omx/0004-Properly-handle-drain-requests-while-flushing.patch b/recipes-multimedia/gstreamer/gstreamer1.0-omx/0004-Properly-handle-drain-requests-while-flushing.patch
new file mode 100644
index 0000000..98689f3
--- /dev/null
+++ b/recipes-multimedia/gstreamer/gstreamer1.0-omx/0004-Properly-handle-drain-requests-while-flushing.patch
@@ -0,0 +1,69 @@
1From 80dddfd13aaf2fe7272765f8cf291215fe375e28 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Enrique=20Oca=C3=B1a=20Gonz=C3=A1lez?= <eocanha@igalia.com>
3Date: Tue, 17 Nov 2015 16:51:27 +0000
4Subject: [PATCH] Properly handle drain requests while flushing
5
6Without this commit the decoder streaming thread stops without ever attending
7the drain request, leaving the decoder input thread waiting forever.
8---
9 omx/gstomx.c | 7 +++++++
10 omx/gstomxvideodec.c | 13 +++++++++++++
11 2 files changed, 20 insertions(+)
12
13diff --git a/omx/gstomx.c b/omx/gstomx.c
14index 69696c4..f0cd890 100644
15--- a/omx/gstomx.c
16+++ b/omx/gstomx.c
17@@ -830,6 +830,13 @@ gst_omx_component_set_state (GstOMXComponent * comp, OMX_STATETYPE state)
18 done:
19
20 gst_omx_component_handle_messages (comp);
21+
22+ if (err != OMX_ErrorNone && comp->last_error == OMX_ErrorNone) {
23+ GST_ERROR_OBJECT (comp->parent,
24+ "Last operation returned an error. Setting last_error manually.");
25+ comp->last_error = err;
26+ }
27+
28 g_mutex_unlock (&comp->lock);
29
30 if (err != OMX_ErrorNone) {
31diff --git a/omx/gstomxvideodec.c b/omx/gstomxvideodec.c
32index d531f75..a26c4a6 100644
33--- a/omx/gstomxvideodec.c
34+++ b/omx/gstomxvideodec.c
35@@ -1539,9 +1539,16 @@ component_error:
36 flushing:
37 {
38 GST_DEBUG_OBJECT (self, "Flushing -- stopping task");
39+
40+ g_mutex_lock (&self->drain_lock);
41+ if (self->draining) {
42+ self->draining = FALSE;
43+ g_cond_broadcast (&self->drain_cond);
44+ }
45 gst_pad_pause_task (GST_VIDEO_DECODER_SRC_PAD (self));
46 self->downstream_flow_ret = GST_FLOW_FLUSHING;
47 self->started = FALSE;
48+ g_mutex_unlock (&self->drain_lock);
49 return;
50 }
51
52@@ -1599,8 +1606,14 @@ flow_error:
53 self->started = FALSE;
54 } else if (flow_ret == GST_FLOW_FLUSHING) {
55 GST_DEBUG_OBJECT (self, "Flushing -- stopping task");
56+ g_mutex_lock (&self->drain_lock);
57+ if (self->draining) {
58+ self->draining = FALSE;
59+ g_cond_broadcast (&self->drain_cond);
60+ }
61 gst_pad_pause_task (GST_VIDEO_DECODER_SRC_PAD (self));
62 self->started = FALSE;
63+ g_mutex_unlock (&self->drain_lock);
64 }
65 GST_VIDEO_DECODER_STREAM_UNLOCK (self);
66 return;
67--
681.8.3.2
69
diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-omx/0005-Don-t-abort-gst_omx_video_dec_set_format-if-there-s-.patch b/recipes-multimedia/gstreamer/gstreamer1.0-omx/0005-Don-t-abort-gst_omx_video_dec_set_format-if-there-s-.patch
new file mode 100644
index 0000000..b7a8753
--- /dev/null
+++ b/recipes-multimedia/gstreamer/gstreamer1.0-omx/0005-Don-t-abort-gst_omx_video_dec_set_format-if-there-s-.patch
@@ -0,0 +1,30 @@
1From 12103842d5f347cf245e71071d0c44297bcdb1f9 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Enrique=20Oca=C3=B1a=20Gonz=C3=A1lez?= <eocanha@igalia.com>
3Date: Fri, 4 Dec 2015 18:39:59 +0100
4Subject: [PATCH] Don't abort gst_omx_video_dec_set_format() if there's a
5 timeout releasing the buffers taken by the egl_render out port
6
7---
8 omx/gstomxvideodec.c | 5 ++++-
9 1 file changed, 4 insertions(+), 1 deletion(-)
10
11diff --git a/omx/gstomxvideodec.c b/omx/gstomxvideodec.c
12index 2368f34..da35e0d 100644
13--- a/omx/gstomxvideodec.c
14+++ b/omx/gstomxvideodec.c
15@@ -1905,8 +1905,11 @@ gst_omx_video_dec_set_format (GstVideoDecoder * decoder,
16 5 * GST_SECOND) != OMX_ErrorNone)
17 return FALSE;
18 if (gst_omx_port_wait_buffers_released (out_port,
19- 1 * GST_SECOND) != OMX_ErrorNone)
20+ 1 * GST_SECOND) != OMX_ErrorNone) {
21+#if !(defined (USE_OMX_TARGET_RPI) && defined (HAVE_GST_GL))
22 return FALSE;
23+#endif
24+ }
25 if (gst_omx_port_deallocate_buffers (self->dec_in_port) != OMX_ErrorNone)
26 return FALSE;
27 if (gst_omx_video_dec_deallocate_output_buffers (self) != OMX_ErrorNone)
28--
292.1.4
30
diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-omx_%.bbappend b/recipes-multimedia/gstreamer/gstreamer1.0-omx_%.bbappend
index b313acd..a13aad7 100644
--- a/recipes-multimedia/gstreamer/gstreamer1.0-omx_%.bbappend
+++ b/recipes-multimedia/gstreamer/gstreamer1.0-omx_%.bbappend
@@ -5,6 +5,9 @@ SRC_URI_append_rpi = " \
5 file://0001-config-files-path.patch \ 5 file://0001-config-files-path.patch \
6 file://0002-Don-t-try-to-acquire-buffer-when-src-pad-isn-t-activ.patch \ 6 file://0002-Don-t-try-to-acquire-buffer-when-src-pad-isn-t-activ.patch \
7 file://0003-fix-decoder-flushing.patch \ 7 file://0003-fix-decoder-flushing.patch \
8 file://0003-no-timeout-on-get-state.patch \
9 file://0004-Properly-handle-drain-requests-while-flushing.patch \
10 file://0005-Don-t-abort-gst_omx_video_dec_set_format-if-there-s-.patch \
8" 11"
9 12
10FILESEXTRAPATHS_prepend := "${THISDIR}/gstreamer1.0-omx:" 13FILESEXTRAPATHS_prepend := "${THISDIR}/gstreamer1.0-omx:"