From f7e2e8bd2c5ebb46e69ed285a068f630622860d1 Mon Sep 17 00:00:00 2001 From: Javier Viguera Date: Fri, 23 Oct 2015 11:50:04 +0200 Subject: [PATCH] meta-digi-dey: fix overlay sink in FSL gst1.0 plugins The mutex locking was not well resolved and a basic pipeline like: gst-launch-1.0 playbin uri=file:///run/media/mmcblk0p5/big_buck_bunny_480p_h264.mov was failing with: Attempt to unlock mutex that was not locked https://jira.digi.com/browse/DEL-1850 Signed-off-by: Javier Viguera --- ...plugin-fix-mutex-lock-unlock-problem.patch | 43 +++++++++++++++++++ .../gst1.0-fsl-plugin_4.0.3.bbappend | 5 +++ 2 files changed, 48 insertions(+) create mode 100644 meta-digi-dey/recipes-multimedia/gstreamer/gst1.0-fsl-plugin-4.0.3/0001-gst1.0-fsl-plugin-fix-mutex-lock-unlock-problem.patch create mode 100644 meta-digi-dey/recipes-multimedia/gstreamer/gst1.0-fsl-plugin_4.0.3.bbappend diff --git a/meta-digi-dey/recipes-multimedia/gstreamer/gst1.0-fsl-plugin-4.0.3/0001-gst1.0-fsl-plugin-fix-mutex-lock-unlock-problem.patch b/meta-digi-dey/recipes-multimedia/gstreamer/gst1.0-fsl-plugin-4.0.3/0001-gst1.0-fsl-plugin-fix-mutex-lock-unlock-problem.patch new file mode 100644 index 000000000..585889120 --- /dev/null +++ b/meta-digi-dey/recipes-multimedia/gstreamer/gst1.0-fsl-plugin-4.0.3/0001-gst1.0-fsl-plugin-fix-mutex-lock-unlock-problem.patch @@ -0,0 +1,43 @@ +From: Javier Viguera +Date: Thu, 22 Oct 2015 18:52:10 +0200 +Subject: [PATCH] gst1.0-fsl-plugin: fix mutex lock/unlock problem + +Otherwise a basic pipeline as: + + gst-launch-1.0 playbin uri=file:///run/media/mmcblk0p5/big_buck_bunny_480p_h264.mov + +fails with: + + Attempt to unlock mutex that was not locked + +Signed-off-by: Javier Viguera +--- + plugins/overlay_sink/compositor.c | 15 +++++++++++++-- + 1 file changed, 13 insertions(+), 2 deletions(-) + +diff --git a/plugins/overlay_sink/compositor.c b/plugins/overlay_sink/compositor.c +index 47f8496d991a..8a04d37295c4 100755 +--- a/plugins/overlay_sink/compositor.c ++++ b/plugins/overlay_sink/compositor.c +@@ -36,8 +36,19 @@ GST_DEBUG_CATEGORY_EXTERN (overlay_sink_debug); + (((a)->right <= (b)->left) || ((a)->left >= (b)->right) \ + || ((a)->bottom <= (b)->top) || ((a)->top >= (b)->bottom)) + +-#define COMPOSITOR_WAIT_SURFACE(h) (g_cond_wait (&((h)->cond), &((h)->lock))) +-#define COMPOSITOR_POST_SURFACE(h) (g_cond_signal (&((h)->cond))) ++#define COMPOSITOR_WAIT_SURFACE(h) \ ++ do { \ ++ g_mutex_lock(&((h)->lock)); \ ++ g_cond_wait (&((h)->cond), &((h)->lock)); \ ++ g_mutex_unlock(&((h)->lock)); \ ++ } while (0); ++ ++#define COMPOSITOR_POST_SURFACE(h) \ ++ do { \ ++ g_mutex_lock(&((h)->lock)); \ ++ g_cond_signal (&((h)->cond)); \ ++ g_mutex_unlock(&((h)->lock)); \ ++ } while (0); + + typedef struct _Surface Surface; + struct _Surface{ diff --git a/meta-digi-dey/recipes-multimedia/gstreamer/gst1.0-fsl-plugin_4.0.3.bbappend b/meta-digi-dey/recipes-multimedia/gstreamer/gst1.0-fsl-plugin_4.0.3.bbappend new file mode 100644 index 000000000..a5826abf9 --- /dev/null +++ b/meta-digi-dey/recipes-multimedia/gstreamer/gst1.0-fsl-plugin_4.0.3.bbappend @@ -0,0 +1,5 @@ +# Copyright (C) 2015 Digi International + +FILESEXTRAPATHS_prepend := "${THISDIR}/${BP}:" + +SRC_URI += "file://0001-gst1.0-fsl-plugin-fix-mutex-lock-unlock-problem.patch"