diff options
Diffstat (limited to 'meta-raspberrypi/recipes-multimedia/gstreamer')
9 files changed, 334 insertions, 0 deletions
diff --git a/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx-1.12/0001-Don-t-try-to-acquire-buffer-when-src-pad-isn-t-activ.patch b/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx-1.12/0001-Don-t-try-to-acquire-buffer-when-src-pad-isn-t-activ.patch new file mode 100644 index 000000000..85fea67be --- /dev/null +++ b/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx-1.12/0001-Don-t-try-to-acquire-buffer-when-src-pad-isn-t-activ.patch @@ -0,0 +1,46 @@ +From cfb432fcd8868c7a4f32010c61e47e2bf0ff80c6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Enrique=20Oca=C3=B1a=20Gonz=C3=A1lez?= <eocanha@igalia.com> +Date: Mon, 25 May 2015 14:53:35 +0200 +Subject: [PATCH] Don't try to acquire buffer when src pad isn't active + +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 d12ee8f..fb0100a 100644 +--- a/omx/gstomxvideodec.c ++++ b/omx/gstomxvideodec.c +@@ -1250,6 +1250,11 @@ gst_omx_video_dec_loop (GstOMXVideoDec * self) + GstClockTimeDiff deadline; + 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-1.12/0001-config-files-path.patch b/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx-1.12/0001-config-files-path.patch new file mode 100644 index 000000000..6903c1770 --- /dev/null +++ b/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx-1.12/0001-config-files-path.patch @@ -0,0 +1,150 @@ +From 0dc88ed881eb8420dad4cf0934a900d85b6ef313 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Thu, 11 Feb 2016 12:53:20 -0800 + +--- + config/bellagio/gstomx.conf | 8 ++++---- + config/rpi/gstomx.conf | 22 +++++++++++----------- + 2 files changed, 15 insertions(+), 15 deletions(-) + +diff --git a/config/bellagio/gstomx.conf b/config/bellagio/gstomx.conf +index 5ca8ba6..8931255 100644 +--- a/config/bellagio/gstomx.conf ++++ b/config/bellagio/gstomx.conf +@@ -1,6 +1,6 @@ + [omxmpeg4videodec] + type-name=GstOMXMPEG4VideoDec +-core-name=/usr/local/lib/libomxil-bellagio.so.0 ++core-name=/usr/lib/libomxil-bellagio.so.0 + component-name=OMX.st.video_decoder.mpeg4 + rank=257 + in-port-index=0 +@@ -9,7 +9,7 @@ hacks=event-port-settings-changed-ndata-parameter-swap;event-port-settings-chang + + [omxh264dec] + type-name=GstOMXH264Dec +-core-name=/usr/local/lib/libomxil-bellagio.so.0 ++core-name=/usr/lib/libomxil-bellagio.so.0 + component-name=OMX.st.video_decoder.avc + rank=257 + in-port-index=0 +@@ -18,7 +18,7 @@ hacks=event-port-settings-changed-ndata-parameter-swap;event-port-settings-chang + + [omxmpeg4videoenc] + type-name=GstOMXMPEG4VideoEnc +-core-name=/usr/local/lib/libomxil-bellagio.so.0 ++core-name=/usr/lib/libomxil-bellagio.so.0 + component-name=OMX.st.video_encoder.mpeg4 + rank=0 + in-port-index=0 +@@ -27,7 +27,7 @@ hacks=event-port-settings-changed-ndata-parameter-swap;video-framerate-integer;s + + [omxaacenc] + type-name=GstOMXAACEnc +-core-name=/usr/local/lib/libomxil-bellagio.so.0 ++core-name=/usr/lib/libomxil-bellagio.so.0 + component-name=OMX.st.audio_encoder.aac + rank=0 + in-port-index=0 +diff --git a/config/rpi/gstomx.conf b/config/rpi/gstomx.conf +index d3ea56a..2508dae 100644 +--- a/config/rpi/gstomx.conf ++++ b/config/rpi/gstomx.conf +@@ -1,6 +1,6 @@ + [omxmpeg2videodec] + type-name=GstOMXMPEG2VideoDec +-core-name=/opt/vc/lib/libopenmaxil.so ++core-name=/usr/lib/libopenmaxil.so + component-name=OMX.broadcom.video_decode + rank=257 + in-port-index=130 +@@ -9,7 +9,7 @@ hacks=no-component-role + + [omxmpeg4videodec] + type-name=GstOMXMPEG4VideoDec +-core-name=/opt/vc/lib/libopenmaxil.so ++core-name=/usr/lib/libopenmaxil.so + component-name=OMX.broadcom.video_decode + rank=257 + in-port-index=130 +@@ -18,7 +18,7 @@ hacks=no-component-role + + [omxh263dec] + type-name=GstOMXH263Dec +-core-name=/opt/vc/lib/libopenmaxil.so ++core-name=/usr/lib/libopenmaxil.so + component-name=OMX.broadcom.video_decode + rank=257 + in-port-index=130 +@@ -27,7 +27,7 @@ hacks=no-component-role + + [omxh264dec] + type-name=GstOMXH264Dec +-core-name=/opt/vc/lib/libopenmaxil.so ++core-name=/usr/lib/libopenmaxil.so + component-name=OMX.broadcom.video_decode + rank=257 + in-port-index=130 +@@ -36,7 +36,7 @@ hacks=no-component-role;signals-premature-eos + + [omxtheoradec] + type-name=GstOMXTheoraDec +-core-name=/opt/vc/lib/libopenmaxil.so ++core-name=/usr/lib/libopenmaxil.so + component-name=OMX.broadcom.video_decode + rank=257 + in-port-index=130 +@@ -45,7 +45,7 @@ hacks=no-component-role + + [omxvp8dec] + type-name=GstOMXVP8Dec +-core-name=/opt/vc/lib/libopenmaxil.so ++core-name=/usr/lib/libopenmaxil.so + component-name=OMX.broadcom.video_decode + rank=257 + in-port-index=130 +@@ -54,7 +54,7 @@ hacks=no-component-role + + [omxmjpegdec] + type-name=GstOMXMJPEGDec +-core-name=/opt/vc/lib/libopenmaxil.so ++core-name=/usr/lib/libopenmaxil.so + component-name=OMX.broadcom.video_decode + rank=257 + in-port-index=130 +@@ -63,7 +63,7 @@ hacks=no-component-role + + [omxvc1dec] + type-name=GstOMXWMVDec +-core-name=/opt/vc/lib/libopenmaxil.so ++core-name=/usr/lib/libopenmaxil.so + component-name=OMX.broadcom.video_decode + rank=257 + in-port-index=130 +@@ -73,7 +73,7 @@ sink-template-caps=video/x-wmv,wmvversion=(int)3,format=(string){WMV3,WVC1},widt + + [omxh264enc] + type-name=GstOMXH264Enc +-core-name=/opt/vc/lib/libopenmaxil.so ++core-name=/usr/lib/libopenmaxil.so + component-name=OMX.broadcom.video_encode + rank=257 + in-port-index=200 +@@ -82,7 +82,7 @@ hacks=no-component-role;no-component-reconfigure + + [omxanalogaudiosink] + type-name=GstOMXAnalogAudioSink +-core-name=/opt/vc/lib/libopenmaxil.so ++core-name=/usr/lib/libopenmaxil.so + component-name=OMX.broadcom.audio_render + rank=257 + in-port-index=100 +@@ -92,7 +92,7 @@ sink-template-caps=audio/x-raw,format=(string){S16LE,S32LE},layout=(string)inter + + [omxhdmiaudiosink] + type-name=GstOMXHdmiAudioSink +-core-name=/opt/vc/lib/libopenmaxil.so ++core-name=/usr/lib/libopenmaxil.so + component-name=OMX.broadcom.audio_render + rank=258 + in-port-index=100 diff --git a/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx-1.12/0002-fix-decoder-flushing.patch b/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx-1.12/0002-fix-decoder-flushing.patch new file mode 100644 index 000000000..122ddb397 --- /dev/null +++ b/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx-1.12/0002-fix-decoder-flushing.patch @@ -0,0 +1,23 @@ +From fc4773f36aa31b4ae0fc97d3aa3f94db0c88f194 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Thu, 11 Feb 2016 12:53:20 -0800 + +--- + omx/gstomx.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/omx/gstomx.c b/omx/gstomx.c +index 0237f3c..45732c3 100644 +--- a/omx/gstomx.c ++++ b/omx/gstomx.c +@@ -1538,8 +1538,8 @@ gst_omx_port_set_flushing (GstOMXPort * port, GstClockTime timeout, + last_error = OMX_ErrorNone; + gst_omx_component_handle_messages (comp); + while (signalled && last_error == OMX_ErrorNone && !port->flushed +- && port->buffers +- && port->buffers->len > g_queue_get_length (&port->pending_buffers)) { ++ /* && port->buffers ++ && port->buffers->len > g_queue_get_length (&port->pending_buffers) */) { + signalled = gst_omx_component_wait_message (comp, timeout); + if (signalled) + gst_omx_component_handle_messages (comp); diff --git a/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx-1.12/0003-no-timeout-on-get-state.patch b/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx-1.12/0003-no-timeout-on-get-state.patch new file mode 100644 index 000000000..4124bccf8 --- /dev/null +++ b/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx-1.12/0003-no-timeout-on-get-state.patch @@ -0,0 +1,24 @@ +From 02e49cba402a783fa1b30e445b83a5c280949c1e 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 fb0100a..bad6335 100644 +--- a/omx/gstomxvideodec.c ++++ b/omx/gstomxvideodec.c +@@ -1713,9 +1713,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-1.12/0004-Properly-handle-drain-requests-while-flushing.patch b/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx-1.12/0004-Properly-handle-drain-requests-while-flushing.patch new file mode 100644 index 000000000..b02072a4a --- /dev/null +++ b/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx-1.12/0004-Properly-handle-drain-requests-while-flushing.patch @@ -0,0 +1,30 @@ +From f00912f0628aff15e882bdc1619f5de1ddf5c720 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 45732c3..784a5d7 100644 +--- a/omx/gstomx.c ++++ b/omx/gstomx.c +@@ -737,6 +737,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-1.12/0005-Don-t-abort-gst_omx_video_dec_set_format-if-there-s-.patch b/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx-1.12/0005-Don-t-abort-gst_omx_video_dec_set_format-if-there-s-.patch new file mode 100644 index 000000000..fdfdd1b5a --- /dev/null +++ b/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx-1.12/0005-Don-t-abort-gst_omx_video_dec_set_format-if-there-s-.patch @@ -0,0 +1,27 @@ +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 + +--- + omx/gstomxvideodec.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/omx/gstomxvideodec.c b/omx/gstomxvideodec.c +index bad6335..c63b972 100644 +--- a/omx/gstomxvideodec.c ++++ b/omx/gstomxvideodec.c +@@ -1911,8 +1911,11 @@ gst_omx_video_dec_set_format (GstVideoDecoder * decoder, + 5 * GST_SECOND) != OMX_ErrorNone) + return FALSE; + if (gst_omx_port_wait_buffers_released (out_port, +- 1 * GST_SECOND) != OMX_ErrorNone) ++ 1 * GST_SECOND) != OMX_ErrorNone) { ++#if !(defined (USE_OMX_TARGET_RPI) && defined (HAVE_GST_GL)) + return FALSE; ++#endif ++ } + if (gst_omx_port_deallocate_buffers (self->dec_in_port) != OMX_ErrorNone) + return FALSE; + if (gst_omx_video_dec_deallocate_output_buffers (self) != OMX_ErrorNone) diff --git a/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx_%.bbappend b/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx_%.bbappend new file mode 100644 index 000000000..67e46de95 --- /dev/null +++ b/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx_%.bbappend @@ -0,0 +1,9 @@ +GSTREAMER_1_0_OMX_TARGET_rpi = "rpi" +GSTREAMER_1_0_OMX_CORE_NAME_rpi = "${libdir}/libopenmaxil.so" + + +# How to make this RPI specific? +EXTRA_OECONF_append_rpi = " CFLAGS="$CFLAGS -I${STAGING_DIR_TARGET}/usr/include/IL -I${STAGING_DIR_TARGET}/usr/include/interface/vcos/pthreads -I${STAGING_DIR_TARGET}/usr/include/interface/vmcs_host/linux"" +#examples only build with GL but not GLES, so disable it for RPI +EXTRA_OECONF_append_rpi = " --disable-examples" + diff --git a/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx_1.12%.bbappend b/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx_1.12%.bbappend new file mode 100644 index 000000000..93381a4e0 --- /dev/null +++ b/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-omx_1.12%.bbappend @@ -0,0 +1,13 @@ +# +# Need to make this conditional to gstreamer1 +# +SRC_URI_append_rpi = " \ + file://0001-config-files-path.patch \ + file://0001-Don-t-try-to-acquire-buffer-when-src-pad-isn-t-activ.patch \ + file://0002-fix-decoder-flushing.patch \ + file://0003-no-timeout-on-get-state.patch \ + file://0004-Properly-handle-drain-requests-while-flushing.patch \ + file://0005-Don-t-abort-gst_omx_video_dec_set_format-if-there-s-.patch \ +" + +FILESEXTRAPATHS_prepend := "${THISDIR}/gstreamer1.0-omx-1.12:" diff --git a/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_%.bbappend b/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_%.bbappend new file mode 100644 index 000000000..7292f90ce --- /dev/null +++ b/meta-raspberrypi/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_%.bbappend @@ -0,0 +1,12 @@ +EXTRA_OECONF_append_rpi = " CPPFLAGS='-I${STAGING_INCDIR}/interface/vcos/pthreads \ + -I${STAGING_INCDIR}/interface/vmcs_host/linux'" + +# if using bcm driver enable dispmanx not when using VC4 driver + +PACKAGECONFIG_append_rpi = "${@bb.utils.contains('MACHINE_FEATURES', 'vc4graphics', '', ' dispmanx', d)}" + +PACKAGECONFIG_GL_rpi = "egl gles2" + +PACKAGECONFIG_append_rpi = " hls libmms faad" + +PACKAGECONFIG[dispmanx] = "--enable-dispmanx,--disable-dispmanx,userland" |