diff options
Diffstat (limited to 'meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx')
4 files changed, 138 insertions, 0 deletions
diff --git a/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx/0001-Don-t-try-to-acquire-buffer-when-src-pad-isn-t-activ.patch b/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx/0001-Don-t-try-to-acquire-buffer-when-src-pad-isn-t-activ.patch new file mode 100644 index 0000000000..c8af7da0e0 --- /dev/null +++ b/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx/0001-Don-t-try-to-acquire-buffer-when-src-pad-isn-t-activ.patch @@ -0,0 +1,48 @@ +From 160181edf5fc73288abfe99fa04de4a550cd9c65 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Thu, 11 Feb 2016 12:53:20 -0800 +Subject: [PATCH] Don't try to acquire buffer when src pad isn't active + +From: =?UTF-8?q?Enrique=20Oca=C3=B1a=20Gonz=C3=A1lez?= <eocanha@igalia.com> + +This solves a race condition when setting the pipeline from PAUSE to +NULL while the decoder loop is still running. Without this patch, the +thread which interacts with the decode sink pad gets blocked here: + + gst_element_change_state() + gst_element_change_state_func() + gst_element_pads_activate() --> Deactivating pads + activate_pads() + gst_pad_set_active() + gst_pad_activate_mode() + post_activate() + GST_PAD_STREAM_LOCK() + +while gst_omx_port_acquire_buffer() gets stalled forever in +gst_omx_component_wait_message() waiting for a message that will never +arrive: + + gst_omx_video_dec_loop() + gst_omx_port_acquire_buffer() + gst_omx_component_wait_message() + +--- + omx/gstomxvideodec.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/omx/gstomxvideodec.c b/omx/gstomxvideodec.c +index abe6e30..c4dc33f 100644 +--- a/omx/gstomxvideodec.c ++++ b/omx/gstomxvideodec.c +@@ -1598,6 +1598,11 @@ gst_omx_video_dec_loop (GstOMXVideoDec * self) + GstOMXAcquireBufferReturn acq_return; + OMX_ERRORTYPE err; + ++ if (!gst_pad_is_active(GST_VIDEO_DECODER_SRC_PAD (self))) { ++ GST_DEBUG_OBJECT (self, "Src pad not active, not acquiring buffer and flushing instead"); ++ goto flushing; ++ } ++ + #if defined (USE_OMX_TARGET_RPI) && defined (HAVE_GST_GL) + port = self->eglimage ? self->egl_out_port : self->dec_out_port; + #else diff --git a/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx/0003-no-timeout-on-get-state.patch b/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx/0003-no-timeout-on-get-state.patch new file mode 100644 index 0000000000..434232661e --- /dev/null +++ b/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx/0003-no-timeout-on-get-state.patch @@ -0,0 +1,24 @@ +From 21f776bff596bc0bd09708efa6497f8bdcd065c0 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Sat, 13 Feb 2016 11:42:29 -0800 + +--- + omx/gstomxvideodec.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/omx/gstomxvideodec.c b/omx/gstomxvideodec.c +index c4dc33f..ba5304f 100644 +--- a/omx/gstomxvideodec.c ++++ b/omx/gstomxvideodec.c +@@ -2021,9 +2021,9 @@ gst_omx_video_dec_stop (GstVideoDecoder * decoder) + g_cond_broadcast (&self->drain_cond); + g_mutex_unlock (&self->drain_lock); + +- gst_omx_component_get_state (self->dec, 5 * GST_SECOND); ++ gst_omx_component_get_state (self->dec, 0); + #if defined (USE_OMX_TARGET_RPI) && defined (HAVE_GST_GL) +- gst_omx_component_get_state (self->egl_render, 1 * GST_SECOND); ++ gst_omx_component_get_state (self->egl_render, 0); + #endif + + gst_buffer_replace (&self->codec_data, NULL); diff --git a/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx/0004-Properly-handle-drain-requests-while-flushing.patch b/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx/0004-Properly-handle-drain-requests-while-flushing.patch new file mode 100644 index 0000000000..144ced6ab7 --- /dev/null +++ b/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx/0004-Properly-handle-drain-requests-while-flushing.patch @@ -0,0 +1,30 @@ +From 140bf8548843a98b0af2ddc1765ab59c16c8994c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Enrique=20Oca=C3=B1a=20Gonz=C3=A1lez?= <eocanha@igalia.com> +Date: Tue, 17 Nov 2015 16:51:27 +0000 +Subject: [PATCH] Properly handle drain requests while flushing + +Without this commit the decoder streaming thread stops without ever attending +the drain request, leaving the decoder input thread waiting forever. + +--- + omx/gstomx.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/omx/gstomx.c b/omx/gstomx.c +index 038ce32..5202d33 100644 +--- a/omx/gstomx.c ++++ b/omx/gstomx.c +@@ -1011,6 +1011,13 @@ gst_omx_component_new (GstObject * parent, const gchar * core_name, + + g_mutex_lock (&comp->lock); + gst_omx_component_handle_messages (comp); ++ ++ if (err != OMX_ErrorNone && comp->last_error == OMX_ErrorNone) { ++ GST_ERROR_OBJECT (comp->parent, ++ "Last operation returned an error. Setting last_error manually."); ++ comp->last_error = err; ++ } ++ + g_mutex_unlock (&comp->lock); + + return comp; diff --git a/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx/0005-Don-t-abort-gst_omx_video_dec_set_format-if-there-s-.patch b/meta-raspberrypi/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 0000000000..3245294eae --- /dev/null +++ b/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx/0005-Don-t-abort-gst_omx_video_dec_set_format-if-there-s-.patch @@ -0,0 +1,36 @@ +From cf6cf2060c5a7a7ddc0396a0c20c234fc56c79b6 Mon Sep 17 00:00:00 2001 +From: Andrei Gherzan <andrei@gherzan.ro> +Date: Tue, 28 May 2019 18:02:24 +0100 +Subject: [PATCH] Don't abort gst_omx_video_dec_set_format() if there's a + timeout releasing the buffers taken by the egl_render out port + +From 0d2ad639e6158c8023c157e206ef3ff7abdc089c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Enrique=20Oca=C3=B1a=20Gonz=C3=A1lez?= +<eocanha@igalia.com> +Date: Fri, 4 Dec 2015 18:39:59 +0100 +Subject: [PATCH] Don't abort gst_omx_video_dec_set_format() if there's a +timeout releasing the buffers taken by the egl_render out port + +Upstream-status: Pending +Signed-off-by: Andrei Gherzan <andrei@gherzan.ro> +--- + omx/gstomxvideodec.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/omx/gstomxvideodec.c b/omx/gstomxvideodec.c +index ba5304f..8bd5d3d 100644 +--- a/omx/gstomxvideodec.c ++++ b/omx/gstomxvideodec.c +@@ -2229,7 +2229,9 @@ gst_omx_video_dec_disable (GstOMXVideoDec * self) + return FALSE; + if (gst_omx_port_wait_buffers_released (out_port, + 1 * GST_SECOND) != OMX_ErrorNone) ++#if !(defined (USE_OMX_TARGET_RPI) && defined (HAVE_GST_GL)) + return FALSE; ++#endif + if (!gst_omx_video_dec_deallocate_output_buffers (self)) + return FALSE; + if (gst_omx_port_wait_enabled (out_port, 1 * GST_SECOND) != OMX_ErrorNone) +-- +2.17.1 + |