imx-gst1.0-plugin: Upgrade to v4.3.1
PATCH 1/6 imx-gst1.0-plugin: Upgrade to v4.3.1
From: Stefan Agner <[email protected]>
Upgrade to v4.3.1 from L4.9.51_MX8_BETA1 release. This version works well with GStreamer 1.12 used with rocko, also on older SoCs such as i.MX 6.
---
...-plugin_4.1.6.bb => imx-gst1.0-plugin_4.3.1.bb} | 34 ++++++++++++----------
1 file changed, 18 insertions(+), 16 deletions(-)
rename recipes-multimedia/gstreamer/{imx-gst1.0-plugin_4.1.6.bb => imx-gst1.0-plugin_4.3.1.bb} (80%)recipes-multimedia/gstreamer/imx-gst1.0-plugin_4.3.1.bb renamed from recipes-multimedia/gstreamer/imx-gst1.0-plugin_4.1.6.bb +18 -16
@@ -1,4 +1,5 @@ # Copyright (C) 2014,2016 Freescale Semiconductor +# Copyright 2017 NXP # Copyright (C) 2012-2015 O.S. Systems Software LTDA. # Released under the MIT license (see COPYING.MIT for the terms)
@@ -7,27 +8,23 @@ LICENSE = "GPLv2 & LGPLv2 & LGPLv2.1" SECTION = "multimedia" DEPENDS = "imx-codec imx-parser virtual/kernel gstreamer1.0 gstreamer1.0-plugins-base gstreamer1.0-plugins-bad" -DEPENDS_append_mx6q = " imx-lib imx-vpu imx-vpuwrap" -DEPENDS_append_mx6dl = " imx-lib imx-vpu imx-vpuwrap" -DEPENDS_append_mx6sl = " imx-lib" -DEPENDS_append_mx6sx = " imx-lib" -DEPENDS_append_mx6ul = " imx-lib" -DEPENDS_append_mx7d = " imx-lib" +DEPENDS_append_mx6 = " imx-lib" +DEPENDS_append_mx7 = " imx-lib" +DEPENDS_append_imxvpu = " imx-vpuwrap" # For backwards compatibility RREPLACES_${PN} = "gst1.0-fsl-plugin" RPROVIDES_${PN} = "gst1.0-fsl-plugin" RCONFLICTS_${PN} = "gst1.0-fsl-plugin" -LIC_FILES_CHKSUM = "file://COPYING;md5=59530bdf33659b29e73d4adb9f9f6552 \ - file://COPYING-LGPL-2;md5=5f30f0716dfdd0d91eb439ebec522ec2 \ +LIC_FILES_CHKSUM = "file://COPYING-LGPL-2;md5=5f30f0716dfdd0d91eb439ebec522ec2 \ file://COPYING-LGPL-2.1;md5=fbc093901857fcd118f065f900982c24" -SRCBRANCH = "nxp/MM_04.02.01_1705_L4.9.11_CONSOLIDATED_GA" +IMXGST_SRC ?= "git://source.codeaurora.org/external/imx/imx-gst1.0-plugin.git;protocol=https" +SRCBRANCH = "MM_04.03.01_1710_L4.9.51_MX8_BETA1" -SRC_URI = " \ - git://source.codeaurora.org/external/imx/gst1.0-plugins-fsl.git;protocol=https;branch=${SRCBRANCH} \ -" +SRC_URI = "${IMXGST_SRC};branch=${SRCBRANCH}" +SRCREV = "cfa6157b4c7d07890ba41131809333bfa1f757de" S = "${WORKDIR}/git"
@@ -35,12 +32,15 @@ inherit autotools pkgconfig # Make sure kernel sources are available do_configure[depends] += "virtual/kernel:do_shared_workdir" + PLATFORM_mx6 = "MX6" PLATFORM_mx6sl = "MX6SL" PLATFORM_mx6sx = "MX6SX" PLATFORM_mx6ul = "MX6UL" -PLATFORM_mx6ull = "MX6UL" -PLATFORM_mx7d = "MX7D" +PLATFORM_mx6sll = "MX6SLL" +PLATFORM_mx7= "MX7D" +PLATFORM_mx7ulp= "MX7ULP" +PLATFORM_mx8 = "MX8" # Todo add a mechanism to map possible build targets EXTRA_OECONF = "PLATFORM=${PLATFORM} \
@@ -54,8 +54,10 @@ PACKAGES =+ "${PN}-gplay ${PN}-libgplaycore ${PN}-libgstfsl ${PN}-grecorder ${PN BEEP_RDEPENDS = "imx-codec-aac imx-codec-mp3 imx-codec-oggvorbis" RDEPENDS_${PN} += "imx-parser ${BEEP_RDEPENDS} gstreamer1.0-plugins-good-id3demux " +# overlaysink rely on G2D, +# cannot be supported on i.MX6SLL & i.MX6UL & i.MX6ULL & i.MX7D PACKAGECONFIG ?= "" -PACKAGECONFIG_mx6 = "overlaysink" +PACKAGECONFIG_imxgpu2d = "overlaysink" # FIXME: Add all features
@@ -81,4 +83,4 @@ FILES_${PN}-grecorder = "${bindir}/grecorder-1.0" FILES_${PN}-librecorder-engine = "${libdir}/librecorder_engine-1.0${SOLIBS}" FILES_${PN}-libplayengine = "${libdir}/libplayengine-1.0${SOLIBS}" -COMPATIBLE_MACHINE = "(mx6|mx6ul|mx6ull|mx7d)" +COMPATIBLE_MACHINE = "(mx6|mx7|mx8)"
Signature · 1 line
2.13.6
PATCH 2/6 gstreamer1.0: Add NXP specific patches
From: Stefan Agner <[email protected]>
Add NXP specific patches from morty-4.9.51-mx8_beta branch. This allows to use imx-gst1.0-plugin 4.3.1 with gstreamer 1.12.2.
--- .../0001-handle-base-parse-error.patch | 35 ++++++++ ...ith-gst-inspect-Chris-Lord-chris-openedha.patch | 32 ++++++++ ...e-unset-FLAG_DISCONT-when-push-to-adapter.patch | 33 ++++++++ ...e-Need-push-adapter-remainning-data-in-pa.patch | 51 ++++++++++++ ...or-should-proceed-non-active-pad-buffer-e.patch | 51 ++++++++++++ ...0006-poll-Add-check-if-can-read-event-API.patch | 95 ++++++++++++++++++++++ ...or-Need-flush-when-set-active-pad-and-the.patch | 68 ++++++++++++++++ .../gstreamer/gstreamer1.0_1.12.%.bbappend | 15 ++++ 8 files changed, 380 insertions(+) create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0/0001-handle-base-parse-error.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0/0002-Fix-crash-with-gst-inspect-Chris-Lord-chris-openedha.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0/0003-baseparse-unset-FLAG_DISCONT-when-push-to-adapter.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0/0004-gstbaseparse-Need-push-adapter-remainning-data-in-pa.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0/0005-inputselector-should-proceed-non-active-pad-buffer-e.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0/0006-poll-Add-check-if-can-read-event-API.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0/0007-inputselector-Need-flush-when-set-active-pad-and-the.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0_1.12.%.bbappend
recipes-multimedia/gstreamer/gstreamer1.0/0001-handle-base-parse-error.patch new file +35 -0
@@ -0,0 +1,35 @@ +From 01b047cbb5e326fb3980bb6fc5206a82ea401170 Mon Sep 17 00:00:00 2001 +From: Lyon Wang <[email protected]> +Date: Wed, 14 Oct 2015 14:15:11 +0800 +Subject: [PATCH 1/7] handle base parse error + +There is no need to send GST_ELEMENT_ERROR +becuase ohter tracks may still good to play. +no need to end the element, just print error message is enough + +Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=741542] + +Signed-off-by: Lyon Wang <[email protected]> +--- + libs/gst/base/gstbaseparse.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/libs/gst/base/gstbaseparse.c b/libs/gst/base/gstbaseparse.c +index df67dd0..2f45d23 100644 +--- a/libs/gst/base/gstbaseparse.c ++++ b/libs/gst/base/gstbaseparse.c +@@ -1324,8 +1324,9 @@ gst_base_parse_sink_event_default (GstBaseParse * parse, GstEvent * event) + /* If we STILL have zero frames processed, fire an error */ + if (parse->priv->framecount == 0 && !parse->priv->saw_gaps && + !parse->priv->first_buffer) { +- GST_ELEMENT_ERROR (parse, STREAM, WRONG_TYPE, +- ("No valid frames found before end of stream"), (NULL)); ++ /* GST_ELEMENT_ERROR (parse, STREAM, WRONG_TYPE, ++ ("No valid frames found before end of stream"), (NULL));*/ ++ GST_ERROR_OBJECT(parse, "No valid frames decoded before end of stream"); + } + + if (!parse->priv->saw_gaps +-- +1.9.1 +
recipes-multimedia/gstreamer/gstreamer1.0/0002-Fix-crash-with-gst-inspect-Chris-Lord-chris-openedha.patch new file +32 -0
@@ -0,0 +1,32 @@ +From 1bd9b30040ad23d86faa577baeb1c6734f39150f Mon Sep 17 00:00:00 2001 +From: Carlos Rafael Giani <[email protected]> +Date: Sat, 6 Apr 2013 23:52:11 +0200 +Subject: [PATCH 2/7] Fix crash with gst-inspect Chris Lord + <[email protected]> + +Upstream-Status: Pending + +Signed-off-by: Carlos Rafael Giani <[email protected]> + +Conflicts: + tools/gst-inspect.c +--- + tools/gst-inspect.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tools/gst-inspect.c b/tools/gst-inspect.c +index e420e4c..95983bc 100644 +--- a/tools/gst-inspect.c ++++ b/tools/gst-inspect.c +@@ -1548,7 +1548,7 @@ main (int argc, char *argv[]) + g_option_context_add_main_entries (ctx, options, GETTEXT_PACKAGE); + g_option_context_add_group (ctx, gst_init_get_option_group ()); + if (!g_option_context_parse (ctx, &argc, &argv, &err)) { +- g_printerr ("Error initializing: %s\n", err->message); ++ g_printerr ("Error initializing: %s\n", err ? err->message : "(null)"); + g_clear_error (&err); + g_option_context_free (ctx); + return -1; +-- +1.9.1 +
recipes-multimedia/gstreamer/gstreamer1.0/0003-baseparse-unset-FLAG_DISCONT-when-push-to-adapter.patch new file +33 -0
@@ -0,0 +1,33 @@ +From 95d80584413c60cfe302cb2b55f59ffdca2a67b9 Mon Sep 17 00:00:00 2001 +From: Lyon Wang <[email protected]> +Date: Wed, 4 Nov 2015 18:16:52 +0800 +Subject: [PATCH 3/7] [baseparse] unset FLAG_DISCONT when push to adapter + +Since DISCONT flag will be handled by priv->discont flag. +There is no need to copy DISCONT flag to adapter. +Otherwise, the DISCONT flag will alwasys been set on each frame, +for the first chain in buffer. + + +Upstream-Status: Pending [https://bugzilla.gnome.org/show_bug.cgi?id=757575] + +Signed-off-by: Lyon Wang <[email protected]> +--- + libs/gst/base/gstbaseparse.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/libs/gst/base/gstbaseparse.c b/libs/gst/base/gstbaseparse.c +index 2f45d23..3c52887 100644 +--- a/libs/gst/base/gstbaseparse.c ++++ b/libs/gst/base/gstbaseparse.c +@@ -3157,6 +3157,7 @@ gst_base_parse_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer) + parse->priv->discont = TRUE; + } + } ++ GST_BUFFER_FLAG_UNSET(buffer, GST_BUFFER_FLAG_DISCONT); + gst_adapter_push (parse->priv->adapter, buffer); + } + +-- +1.9.1 +
recipes-multimedia/gstreamer/gstreamer1.0/0004-gstbaseparse-Need-push-adapter-remainning-data-in-pa.patch new file +51 -0
51 lines not on this page · raw message
recipes-multimedia/gstreamer/gstreamer1.0/0005-inputselector-should-proceed-non-active-pad-buffer-e.patch new file +51 -0
51 lines not on this page · raw message
recipes-multimedia/gstreamer/gstreamer1.0/0006-poll-Add-check-if-can-read-event-API.patch new file +95 -0
95 lines not on this page · raw message
recipes-multimedia/gstreamer/gstreamer1.0/0007-inputselector-Need-flush-when-set-active-pad-and-the.patch new file +68 -0
68 lines not on this page · raw message
recipes-multimedia/gstreamer/gstreamer1.0_1.12.%.bbappend new file +15 -0
@@ -0,0 +1,15 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +DEPENDS += " elfutils" + +# Unrecognised options, need to remove them +EXTRA_OECONF_remove = " --disable-docbook --disable-trace" + +SRC_URI_append = " file://0001-handle-base-parse-error.patch \ + file://0002-Fix-crash-with-gst-inspect-Chris-Lord-chris-openedha.patch \ + file://0003-baseparse-unset-FLAG_DISCONT-when-push-to-adapter.patch \ + file://0004-gstbaseparse-Need-push-adapter-remainning-data-in-pa.patch \ + file://0005-inputselector-should-proceed-non-active-pad-buffer-e.patch \ + file://0006-poll-Add-check-if-can-read-event-API.patch \ + file://0007-inputselector-Need-flush-when-set-active-pad-and-the.patch \ +"
Signature · 1 line
2.13.6
Re: [PATCH 2/6] gstreamer1.0: Add NXP specific patches
On Mon, Dec 18, 2017 at 3:20 PM, Stefan Agner <[email protected]> wrote:
...
Quoted 7 lines
+++ b/recipes-multimedia/gstreamer/gstreamer1.0_1.12.%.bbappend
recipes-multimedia/gstreamer/gstreamer1.0_1.12.%.bbappend new file +5
-0@@ -0,0 +1,15 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +DEPENDS += " elfutils" + +# Unrecognised options, need to remove them
recipes-multimedia/gstreamer/gstreamer1.0_1.12.%.bbappend line 15
Quoted 10 lines
recipes-multimedia/gstreamer/gstreamer1.0_1.12.%.bbappend new file +10
-0+EXTRA_OECONF_remove = " --disable-docbook --disable-trace" + +SRC_URI_append = " file://0001-handle-base-parse-error.patch \ + file://0002-Fix-crash-with-gst-inspect-Chris-Lord-chris-openedha.patch \ + file://0003-baseparse-unset-FLAG_DISCONT-when-push-to-adapter.patch \ + file://0004-gstbaseparse-Need-push-adapter-remainning-data-in-pa.patch \ + file://0005-inputselector-should-proceed-non-active-pad-buffer-e.patch \ + file://0006-poll-Add-check-if-can-read-event-API.patch \ + file://0007-inputselector-Need-flush-when-set-active-pad-and-the.patch \ +"
This must be made specific to imx SoCs; this should not be applied if we are using the mainline-bsp as well as other bsp machines.
Signature · 3 lines
Otavio Salvador O.S. Systems http://www.ossystems.com.br http://code.ossystems.com.br Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750
Re: [PATCH 2/6] gstreamer1.0: Add NXP specific patches
Quoted 14 lines · Otavio Salvador
On Mon, Dec 18, 2017 at 3:20 PM, Stefan Agner <[email protected]> wrote:
...Quoted 12 lines
+++ b/recipes-multimedia/gstreamer/gstreamer1.0_1.12.%.bbappend
recipes-multimedia/gstreamer/gstreamer1.0_1.12.%.bbappend new file +10
-0@@ -0,0 +1,15 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +DEPENDS += " elfutils" + +# Unrecognised options, need to remove them +EXTRA_OECONF_remove = " --disable-docbook --disable-trace" + +SRC_URI_append = " file://0001-handle-base-parse-error.patch \ + file://0002-Fix-crash-with-gst-inspect-Chris-Lord-chris-openedha.patch \ + file://0003-baseparse-unset-FLAG_DISCONT-when-push-to-adapter.patch \
Quoted 8 lines
recipes-multimedia/gstreamer/gstreamer1.0_1.12.%.bbappend line 15
Quoted 5 lines
recipes-multimedia/gstreamer/gstreamer1.0_1.12.%.bbappend new file +5
-0+ file://0004-gstbaseparse-Need-push-adapter-remainning-data-in-pa.patch \ + file://0005-inputselector-should-proceed-non-active-pad-buffer-e.patch \ + file://0006-poll-Add-check-if-can-read-event-API.patch \ + file://0007-inputselector-Need-flush-when-set-active-pad-and-the.patch \ +"This must be made specific to imx SoCs; this should not be applied if we are using the mainline-bsp as well as other bsp machines.
The imx machine override is also there when use-mainline-bsp is set dfdfas far as I can tell... mx6/mx7 seem like good override candidates, but isn't there a single one I can use?
Otherwise I guess something like
SRC_URI_IMX_PATCHES = " file... "
--
Stefan
Re: [PATCH 2/6] gstreamer1.0: Add NXP specific patches
Quoted 24 lines · Stefan Agner
Quoted 14 lines · Otavio Salvador
On Mon, Dec 18, 2017 at 3:20 PM, Stefan Agner <[email protected]> wrote:
...Quoted 12 lines
+++ b/recipes-multimedia/gstreamer/gstreamer1.0_1.12.%.bbappend
recipes-multimedia/gstreamer/gstreamer1.0_1.12.%.bbappend new file +10
-0@@ -0,0 +1,15 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +DEPENDS += " elfutils" + +# Unrecognised options, need to remove them +EXTRA_OECONF_remove = " --disable-docbook --disable-trace" + +SRC_URI_append = " file://0001-handle-base-parse-error.patch \ + file://0002-Fix-crash-with-gst-inspect-Chris-Lord-chris-openedha.patch \ + file://0003-baseparse-unset-FLAG_DISCONT-when-push-to-adapter.patch \Quoted 8 lines
recipes-multimedia/gstreamer/gstreamer1.0_1.12.%.bbappend line 15
Quoted 5 lines
recipes-multimedia/gstreamer/gstreamer1.0_1.12.%.bbappend new file +5
-0+ file://0004-gstbaseparse-Need-push-adapter-remainning-data-in-pa.patch \ + file://0005-inputselector-should-proceed-non-active-pad-buffer-e.patch \ + file://0006-poll-Add-check-if-can-read-event-API.patch \ + file://0007-inputselector-Need-flush-when-set-active-pad-and-the.patch \ +"This must be made specific to imx SoCs; this should not be applied if we are using the mainline-bsp as well as other bsp machines.
Quoted 7 lines
The imx machine override is also there when use-mainline-bsp is set dfdfas far as I can tell... mx6/mx7 seem like good override candidates, but isn't there a single one I can use?
Otherwise I guess something like
SRC_URI_IMX_PATCHES= " file... "
Having a variable to put the common patches make it easy to change and understand.
Signature · 3 lines
Otavio Salvador O.S. Systems http://www.ossystems.com.br http://code.ossystems.com.br Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750
PATCH 3/6 gstreamer1.0-plugins-base: Add NXP specific patches
In reply to Stefan AgnerFrom: Stefan Agner <[email protected]>
Add NXP specific patches from morty-4.9.51-mx8_beta branch. this allows to use imx-gst1.0-plugin 4.3.1 with gstreamer 1.12.2.
--- ...rlay-make-memory-copy-when-video-buffer-s.patch | 78 ++++ ...-don-t-set-async-of-custom-text-sink-to-f.patch | 35 ++ ...stplaybin-remove-default-deinterlace-flag.patch | 31 ++ ...-send-to-down-stream-if-all-the-frame-cor.patch | 58 +++ .../0007-handle-audio-video-decoder-error.patch | 66 ++++ ...esink-print-warning-istead-of-return-ERRO.patch | 47 +++ ...-Linux_MX6QP_ARD-IMXCameraApp-When-Enable.patch | 58 +++ ...-7259-Remove-dependence-on-imx-plugin-git.patch | 433 +++++++++++++++++++++ ...-optimization-for-lib-video-in-plugins-ba.patch | 34 ++ ...-Remove-phymem-allocator-from-base-to-bad.patch | 37 ++ .../0013-dmabuf-set-fd-memory-to-keep-mapped.patch | 30 ++ ...ed-unmap-if-mapping-flags-are-not-subset-.patch | 36 ++ ...-basetextoverlay-need-avoid-idx-exceed-me.patch | 34 ++ .../gstreamer1.0-plugins-base_1.12.%.bbappend | 24 ++ 14 files changed, 1001 insertions(+) create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-basetextoverlay-make-memory-copy-when-video-buffer-s.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0002-gstplaysink-don-t-set-async-of-custom-text-sink-to-f.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0005-gstplaybin-remove-default-deinterlace-flag.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0006-taglist-not-send-to-down-stream-if-all-the-frame-cor.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0007-handle-audio-video-decoder-error.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0008-gstaudiobasesink-print-warning-istead-of-return-ERRO.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0009-MMFMWK-7030-Linux_MX6QP_ARD-IMXCameraApp-When-Enable.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0010-MMFMWK-7259-Remove-dependence-on-imx-plugin-git.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0011-Disable-orc-optimization-for-lib-video-in-plugins-ba.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0012-Remove-phymem-allocator-from-base-to-bad.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0013-dmabuf-set-fd-memory-to-keep-mapped.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0014-fdmemory-need-unmap-if-mapping-flags-are-not-subset-.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0015-basetextoverlay-need-avoid-idx-exceed-me.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.12.%.bbappend
recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-basetextoverlay-make-memory-copy-when-video-buffer-s.patch new file +78 -0
@@ -0,0 +1,78 @@ +From f54f1c28272913a216e91868ce0270e6c0d99b2e Mon Sep 17 00:00:00 2001 +From: Mingke Wang <[email protected]> +Date: Fri, 16 Oct 2015 19:31:32 +0800 +Subject: [PATCH 01/16] basetextoverlay: make memory copy when video buffer's + memory is ready only + +1. since gst_buffer_make_writable just lookup the refcount to determine if + a buffer is writable, and it will use _gst_buffer_copy() which don't + perform a deep memory copy even if the flag of a memory is set to + GST_MEMORY_FLAG_READONLY. So, we detect the memory flag and use + gst_buffer_copy_region with GST_BUFFER_COPY_DEEP parameter to perform + deep memory copy. if the allocator of a memory don't support mem_copy + interface, the it will return NULL, if this case, we can use + gst_buffer_make_writable() to get a shared memory buffer or the orignal + buffer if the buffer's refcount is 1. + +Signed-off-by: Mingke Wang <[email protected]> +--- + ext/pango/gstbasetextoverlay.c | 32 ++++++++++++++++++++++++++++++-- + 1 file changed, 30 insertions(+), 2 deletions(-) + mode change 100644 => 100755 ext/pango/gstbasetextoverlay.c + +diff --git a/ext/pango/gstbasetextoverlay.c b/ext/pango/gstbasetextoverlay.c +old mode 100644 +new mode 100755 +index 44f5f52..c08e3b0 +--- a/ext/pango/gstbasetextoverlay.c ++++ b/ext/pango/gstbasetextoverlay.c +@@ -2227,16 +2227,44 @@ gst_base_text_overlay_push_frame (GstBaseTextOverlay * overlay, + } + } + +- video_frame = gst_buffer_make_writable (video_frame); +- + if (overlay->attach_compo_to_buffer) { + GST_DEBUG_OBJECT (overlay, "Attaching text overlay image to video buffer"); ++ video_frame = gst_buffer_make_writable (video_frame); + gst_buffer_add_video_overlay_composition_meta (video_frame, + overlay->composition); + /* FIXME: emulate shaded background box if want_shading=true */ + goto done; + } + ++ gint idx = 0; ++ gboolean mem_rdonly = FALSE; ++ GstMemory *mem; ++ ++ while (mem = gst_buffer_get_memory(video_frame, idx++)) { ++ if (GST_MEMORY_IS_READONLY(mem)) { ++ gst_memory_unref (mem); ++ mem_rdonly = TRUE; ++ break; ++ } ++ gst_memory_unref (mem); ++ } ++ ++ if (mem_rdonly) { ++ GstBuffer *new_buf = gst_buffer_copy_region (video_frame, ++ GST_BUFFER_COPY_ALL | GST_BUFFER_COPY_DEEP, 0, -1); ++ ++ if (!new_buf) { ++ GST_WARNING_OBJECT(overlay, ++ "buffer memory read only, but copy memory failed"); ++ goto done; ++ } else { ++ gst_buffer_unref (video_frame); ++ video_frame = new_buf; ++ } ++ } else { ++ video_frame = gst_buffer_make_writable (video_frame); ++ } ++ + if (!gst_video_frame_map (&frame, &overlay->info, video_frame, + GST_MAP_READWRITE)) + goto invalid_frame; +-- +1.9.1 +
recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0002-gstplaysink-don-t-set-async-of-custom-text-sink-to-f.patch new file +35 -0
@@ -0,0 +1,35 @@ +From 9444e647142d69b5381bb1225700e335312b1144 Mon Sep 17 00:00:00 2001 +From: Mingke Wang <[email protected]> +Date: Thu, 19 Mar 2015 14:15:25 +0800 +Subject: [PATCH 02/16] gstplaysink: don't set async of custom text-sink to + false + +set async to false lead to A/V sync problem when seeking. +the preroll need use GAP event instead of set async to false. + +Upstream-Status: Inappropriate [i.MX specific] + +Signed-off-by: Mingke Wang <[email protected]> +--- + gst/playback/gstplaysink.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + mode change 100644 => 100755 gst/playback/gstplaysink.c + +diff --git a/gst/playback/gstplaysink.c b/gst/playback/gstplaysink.c +old mode 100644 +new mode 100755 +index ead2e68..3f62769 +--- a/gst/playback/gstplaysink.c ++++ b/gst/playback/gstplaysink.c +@@ -2456,7 +2456,7 @@ gen_text_chain (GstPlaySink * playsink) + G_TYPE_BOOLEAN); + if (elem) { + /* make sure the sparse subtitles don't participate in the preroll */ +- g_object_set (elem, "async", FALSE, NULL); ++ //g_object_set (elem, "async", FALSE, NULL); + GST_DEBUG_OBJECT (playsink, "adding custom text sink"); + gst_bin_add (bin, chain->sink); + /* NOTE streamsynchronizer needs streams decoupled */ +-- +1.9.1 +
recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0005-gstplaybin-remove-default-deinterlace-flag.patch new file +31 -0
@@ -0,0 +1,31 @@ +From 14dc47b7e6e118d06ad4e7ed29284984b3fae248 Mon Sep 17 00:00:00 2001 +From: Jian Li <[email protected]> +Date: Mon, 23 Jun 2014 14:14:07 +0800 +Subject: [PATCH 06/16] gstplaybin remove default deinterlace flag + +- remove default deinterlace flag in playbin for i.MX SoCs + +Upstream-Status: Inappropriate [i.MX specific] + +Signed-off-by: Jian Li <[email protected]> +--- + gst/playback/gstplaybin2.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/gst/playback/gstplaybin2.c b/gst/playback/gstplaybin2.c +index 04eeb2b..09b7ad2 100644 +--- a/gst/playback/gstplaybin2.c ++++ b/gst/playback/gstplaybin2.c +@@ -500,8 +500,7 @@ struct _GstPlayBinClass + #define DEFAULT_SUBURI NULL + #define DEFAULT_SOURCE NULL + #define DEFAULT_FLAGS GST_PLAY_FLAG_AUDIO | GST_PLAY_FLAG_VIDEO | GST_PLAY_FLAG_TEXT | \ +- GST_PLAY_FLAG_SOFT_VOLUME | GST_PLAY_FLAG_DEINTERLACE | \ +- GST_PLAY_FLAG_SOFT_COLORBALANCE ++ GST_PLAY_FLAG_SOFT_VOLUME + #define DEFAULT_N_VIDEO 0 + #define DEFAULT_CURRENT_VIDEO -1 + #define DEFAULT_N_AUDIO 0 +-- +1.9.1 +
recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0006-taglist-not-send-to-down-stream-if-all-the-frame-cor.patch new file +58 -0
58 lines not on this page · raw message
recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0007-handle-audio-video-decoder-error.patch new file +66 -0
66 lines not on this page · raw message
recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0008-gstaudiobasesink-print-warning-istead-of-return-ERRO.patch new file +47 -0
47 lines not on this page · raw message
recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0009-MMFMWK-7030-Linux_MX6QP_ARD-IMXCameraApp-When-Enable.patch new file +58 -0
58 lines not on this page · raw message
recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0010-MMFMWK-7259-Remove-dependence-on-imx-plugin-git.patch new file +433 -0
433 lines not on this page · raw message
recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0011-Disable-orc-optimization-for-lib-video-in-plugins-ba.patch new file +34 -0
@@ -0,0 +1,34 @@ +From 0100444aa707053fb65bea26feffb5de90909b60 Mon Sep 17 00:00:00 2001 +From: Lyon Wang <[email protected]> +Date: Thu, 10 Dec 2015 14:32:43 +0800 +Subject: [PATCH 12/16] Disable orc optimization for lib video in plugins-base + +- the orc optimization for lib video in plugins base may +cause segmentation fault +- disalbe orc optimization for lib video and just use the c source + +package: gstreamer1.0-plugins-base + +Upstream-Status: Pending [https://bugzilla.gnome.org/show_bug.cgi?id=759286] + +Signed-off-by: Lyon Wang <[email protected]> +--- + gst-libs/gst/video/Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gst-libs/gst/video/Makefile.am b/gst-libs/gst/video/Makefile.am +index 64f4978..a197a2f 100644 +--- a/gst-libs/gst/video/Makefile.am ++++ b/gst-libs/gst/video/Makefile.am +@@ -90,7 +90,7 @@ nodist_libgstvideo_@GST_API_VERSION@include_HEADERS = $(built_headers) + noinst_HEADERS = gstvideoutilsprivate.h + + libgstvideo_@GST_API_VERSION@_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS) \ +- $(ORC_CFLAGS) ++ $(ORC_CFLAGS) -DDISABLE_ORC + libgstvideo_@GST_API_VERSION@_la_LIBADD = $(GST_BASE_LIBS) $(GST_LIBS) $(ORC_LIBS) $(LIBM) + libgstvideo_@GST_API_VERSION@_la_LDFLAGS = $(GST_LIB_LDFLAGS) $(GST_ALL_LDFLAGS) $(GST_LT_LDFLAGS) + +-- +1.9.1 +
recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0012-Remove-phymem-allocator-from-base-to-bad.patch new file +37 -0
@@ -0,0 +1,37 @@ +From 2ad9aa1c62ff7b7772862ace35dd03bfae3f0fce Mon Sep 17 00:00:00 2001 +From: Haihua Hu <[email protected]> +Date: Thu, 25 May 2017 11:31:46 +0800 +Subject: [PATCH 16/16] Remove phymem allocator from base to bad + +Upstream-Status: Inappropriate [i.MX specific] +--- + gst-libs/gst/allocators/Makefile.am | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/gst-libs/gst/allocators/Makefile.am b/gst-libs/gst/allocators/Makefile.am +index 1955436..1c5680b 100644 +--- a/gst-libs/gst/allocators/Makefile.am ++++ b/gst-libs/gst/allocators/Makefile.am +@@ -5,8 +5,7 @@ libgstallocators_@GST_API_VERSION@_includedir = $(includedir)/gstreamer-@GST_API + libgstallocators_@GST_API_VERSION@_include_HEADERS = \ + allocators.h \ + gstfdmemory.h \ +- gstdmabuf.h \ +- gstallocatorphymem.h ++ gstdmabuf.h + + if USE_ION + libgstallocators_@GST_API_VERSION@_include_HEADERS += \ +@@ -17,8 +16,7 @@ noinst_HEADERS = + + libgstallocators_@GST_API_VERSION@_la_SOURCES = \ + gstfdmemory.c \ +- gstdmabuf.c \ +- gstallocatorphymem.c ++ gstdmabuf.c + + if USE_ION + libgstallocators_@GST_API_VERSION@_la_SOURCES += \ +-- +1.9.1 +
recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0013-dmabuf-set-fd-memory-to-keep-mapped.patch new file +30 -0
@@ -0,0 +1,30 @@ +From 59a4c4584f732eea055267971013909816287311 Mon Sep 17 00:00:00 2001 +From: Song Bing <[email protected]> +Date: Wed, 13 Sep 2017 13:37:17 -0800 +Subject: [PATCH 4/4] dmabuf: set fd memory to keep mapped + +set fd memory to keep mapped. + +Upstream-Status: Pending + +https://bugzilla.gnome.org/show_bug.cgi?id=768794 +--- + gst-libs/gst/allocators/gstdmabuf.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gst-libs/gst/allocators/gstdmabuf.c b/gst-libs/gst/allocators/gstdmabuf.c +index 7d6bcab..89bb447 100644 +--- a/gst-libs/gst/allocators/gstdmabuf.c ++++ b/gst-libs/gst/allocators/gstdmabuf.c +@@ -95,7 +95,7 @@ gst_dmabuf_allocator_alloc (GstAllocator * allocator, gint fd, gsize size) + { + g_return_val_if_fail (GST_IS_DMABUF_ALLOCATOR (allocator), NULL); + +- return gst_fd_allocator_alloc (allocator, fd, size, GST_FD_MEMORY_FLAG_NONE); ++ return gst_fd_allocator_alloc (allocator, fd, size, GST_FD_MEMORY_FLAG_KEEP_MAPPED); + } + + /** +-- +2.7.4 +
recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0014-fdmemory-need-unmap-if-mapping-flags-are-not-subset-.patch new file +36 -0
@@ -0,0 +1,36 @@ +From bbce23ade0d17c7ef4dbd6042009e0f2419f9668 Mon Sep 17 00:00:00 2001 +From: Haihua Hu <[email protected]> +Date: Mon, 6 Nov 2017 15:05:47 +0800 +Subject: [PATCH] fdmemory: need unmap if mapping flags are not subset of + previous + +Upstream-Status: Pending +https://bugzilla.gnome.org/show_bug.cgi?id=789952 + +--- + gst-libs/gst/allocators/gstfdmemory.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/gst-libs/gst/allocators/gstfdmemory.c b/gst-libs/gst/allocators/gstfdmemory.c +index ad428a7..1e6125a 100644 +--- a/gst-libs/gst/allocators/gstfdmemory.c ++++ b/gst-libs/gst/allocators/gstfdmemory.c +@@ -97,9 +97,13 @@ gst_fd_mem_map (GstMemory * gmem, gsize maxsize, GstMapFlags flags) + if ((mem->mmapping_flags & prot) == prot) { + ret = mem->data; + mem->mmap_count++; ++ goto out; ++ } else { ++ /* if mapping flags is not a subset, need unmap first */ ++ munmap ((void *) mem->data, gmem->maxsize); ++ mem->data = NULL; ++ mem->mmap_count = 0;; + } +- +- goto out; + } + + if (mem->fd != -1) { +-- +1.9.1 +
recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0015-basetextoverlay-need-avoid-idx-exceed-me.patch new file +34 -0
@@ -0,0 +1,34 @@ +From f11ab0f14638d21b6e48bff3fd63aaaa0689f21d Mon Sep 17 00:00:00 2001 +From: Haihua Hu <[email protected]> +Date: Thu, 30 Nov 2017 17:43:20 +0800 +Subject: [PATCH] [MMFMWK-7786] basetextoverlay: need avoid idx exceed memory + block number + +when check whether video buffer is read only, the gst_buffer_get_memory call +should make sure idx don't exceed the total memory block number + +Upstream-Status: Inappropriate [i.MX specific] + +Signed-off-by: Haihua Hu <[email protected]> +--- + ext/pango/gstbasetextoverlay.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/ext/pango/gstbasetextoverlay.c b/ext/pango/gstbasetextoverlay.c +index 7e32904..d2bbbee 100755 +--- a/ext/pango/gstbasetextoverlay.c ++++ b/ext/pango/gstbasetextoverlay.c +@@ -2248,7 +2248,9 @@ gst_base_text_overlay_push_frame (GstBaseTextOverlay * overlay, + gboolean mem_rdonly = FALSE; + GstMemory *mem; + +- while (mem = gst_buffer_get_memory(video_frame, idx++)) { ++ gint n_mem = gst_buffer_n_memory (video_frame); ++ ++ while (idx < n_mem && (mem = gst_buffer_get_memory(video_frame, idx++))) { + if (GST_MEMORY_IS_READONLY(mem)) { + gst_memory_unref (mem); + mem_rdonly = TRUE; +-- +1.9.1 +
recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.12.%.bbappend new file +24 -0
@@ -0,0 +1,24 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +# Enable pango lib +PACKAGECONFIG_append = " pango " + +# ion allocator will be enabled only when detecting the ion.h exists, which is built out from kernel. +# For now, ion allocatior is supported on mx7ulp & mx8 +DEPENDS_append_mx7ulp = " virtual/kernel" +DEPENDS_append_mx8 = " virtual/kernel" + +SRC_URI_append = " file://0001-basetextoverlay-make-memory-copy-when-video-buffer-s.patch \ + file://0002-gstplaysink-don-t-set-async-of-custom-text-sink-to-f.patch \ + file://0005-gstplaybin-remove-default-deinterlace-flag.patch \ + file://0006-taglist-not-send-to-down-stream-if-all-the-frame-cor.patch \ + file://0007-handle-audio-video-decoder-error.patch \ + file://0008-gstaudiobasesink-print-warning-istead-of-return-ERRO.patch \ + file://0009-MMFMWK-7030-Linux_MX6QP_ARD-IMXCameraApp-When-Enable.patch \ + file://0010-MMFMWK-7259-Remove-dependence-on-imx-plugin-git.patch \ + file://0011-Disable-orc-optimization-for-lib-video-in-plugins-ba.patch \ + file://0012-Remove-phymem-allocator-from-base-to-bad.patch \ + file://0013-dmabuf-set-fd-memory-to-keep-mapped.patch \ + file://0014-fdmemory-need-unmap-if-mapping-flags-are-not-subset-.patch \ + file://0015-basetextoverlay-need-avoid-idx-exceed-me.patch \ +"
Signature · 1 line
2.13.6
Re: [PATCH 3/6] gstreamer1.0-plugins-base: Add NXP specific patches
same.
Quoted 1,130 lines · Stefan Agner
From: Stefan Agner <[email protected]>
Add NXP specific patches from morty-4.9.51-mx8_beta branch. this allows to use imx-gst1.0-plugin 4.3.1 with gstreamer 1.12.2.
Signed-off-by Stefan Agner <[email protected]>--- ...rlay-make-memory-copy-when-video-buffer-s.patch | 78 ++++ ...-don-t-set-async-of-custom-text-sink-to-f.patch | 35 ++ ...stplaybin-remove-default-deinterlace-flag.patch | 31 ++ ...-send-to-down-stream-if-all-the-frame-cor.patch | 58 +++ .../0007-handle-audio-video-decoder-error.patch | 66 ++++ ...esink-print-warning-istead-of-return-ERRO.patch | 47 +++ ...-Linux_MX6QP_ARD-IMXCameraApp-When-Enable.patch | 58 +++ ...-7259-Remove-dependence-on-imx-plugin-git.patch | 433 +++++++++++++++++++++ ...-optimization-for-lib-video-in-plugins-ba.patch | 34 ++ ...-Remove-phymem-allocator-from-base-to-bad.patch | 37 ++ .../0013-dmabuf-set-fd-memory-to-keep-mapped.patch | 30 ++ ...ed-unmap-if-mapping-flags-are-not-subset-.patch | 36 ++ ...-basetextoverlay-need-avoid-idx-exceed-me.patch | 34 ++ .../gstreamer1.0-plugins-base_1.12.%.bbappend | 24 ++ 14 files changed, 1001 insertions(+) create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-basetextoverlay-make-memory-copy-when-video-buffer-s.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0002-gstplaysink-don-t-set-async-of-custom-text-sink-to-f.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0005-gstplaybin-remove-default-deinterlace-flag.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0006-taglist-not-send-to-down-stream-if-all-the-frame-cor.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0007-handle-audio-video-decoder-error.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0008-gstaudiobasesink-print-warning-istead-of-return-ERRO.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0009-MMFMWK-7030-Linux_MX6QP_ARD-IMXCameraApp-When-Enable.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0010-MMFMWK-7259-Remove-dependence-on-imx-plugin-git.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0011-Disable-orc-optimization-for-lib-video-in-plugins-ba.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0012-Remove-phymem-allocator-from-base-to-bad.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0013-dmabuf-set-fd-memory-to-keep-mapped.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0014-fdmemory-need-unmap-if-mapping-flags-are-not-subset-.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0015-basetextoverlay-need-avoid-idx-exceed-me.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.12.%.bbappendrecipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-basetextoverlay-make-memory-copy-when-video-buffer-s.patch new file +78
-0@@ -0,0 +1,78 @@ +From f54f1c28272913a216e91868ce0270e6c0d99b2e Mon Sep 17 00:00:00 2001 +From: Mingke Wang <[email protected]> +Date: Fri, 16 Oct 2015 19:31:32 +0800 +Subject: [PATCH 01/16] basetextoverlay: make memory copy when video buffer's + memory is ready only + +1. since gst_buffer_make_writable just lookup the refcount to determine if + a buffer is writable, and it will use _gst_buffer_copy() which don't + perform a deep memory copy even if the flag of a memory is set to + GST_MEMORY_FLAG_READONLY. So, we detect the memory flag and use + gst_buffer_copy_region with GST_BUFFER_COPY_DEEP parameter to perform + deep memory copy. if the allocator of a memory don't support mem_copy + interface, the it will return NULL, if this case, we can use + gst_buffer_make_writable() to get a shared memory buffer or the orignal + buffer if the buffer's refcount is 1. + +Signed-off-by: Mingke Wang <[email protected]> +--- + ext/pango/gstbasetextoverlay.c | 32 ++++++++++++++++++++++++++++++-- + 1 file changed, 30 insertions(+), 2 deletions(-) + mode change 100644 => 100755 ext/pango/gstbasetextoverlay.c + +diff --git a/ext/pango/gstbasetextoverlay.c b/ext/pango/gstbasetextoverlay.c +old mode 100644 +new mode 100755 +index 44f5f52..c08e3b0 +--- a/ext/pango/gstbasetextoverlay.c ++++ b/ext/pango/gstbasetextoverlay.c +@@ -2227,16 +2227,44 @@ gst_base_text_overlay_push_frame (GstBaseTextOverlay * overlay, + } + } + +- video_frame = gst_buffer_make_writable (video_frame); +- + if (overlay->attach_compo_to_buffer) { + GST_DEBUG_OBJECT (overlay, "Attaching text overlay image to video buffer"); ++ video_frame = gst_buffer_make_writable (video_frame); + gst_buffer_add_video_overlay_composition_meta (video_frame, + overlay->composition); + /* FIXME: emulate shaded background box if want_shading=true */ + goto done; + } + ++ gint idx = 0; ++ gboolean mem_rdonly = FALSE; ++ GstMemory *mem; ++ ++ while (mem = gst_buffer_get_memory(video_frame, idx++)) { ++ if (GST_MEMORY_IS_READONLY(mem)) { ++ gst_memory_unref (mem); ++ mem_rdonly = TRUE; ++ break; ++ } ++ gst_memory_unref (mem); ++ } ++ ++ if (mem_rdonly) { ++ GstBuffer *new_buf = gst_buffer_copy_region (video_frame, ++ GST_BUFFER_COPY_ALL | GST_BUFFER_COPY_DEEP, 0, -1); ++ ++ if (!new_buf) { ++ GST_WARNING_OBJECT(overlay, ++ "buffer memory read only, but copy memory failed"); ++ goto done; ++ } else { ++ gst_buffer_unref (video_frame); ++ video_frame = new_buf; ++ } ++ } else { ++ video_frame = gst_buffer_make_writable (video_frame); ++ } ++ + if (!gst_video_frame_map (&frame, &overlay->info, video_frame, + GST_MAP_READWRITE)) + goto invalid_frame; +-- +1.9.1 +recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0002-gstplaysink-don-t-set-async-of-custom-text-sink-to-f.patch new file +35
-0@@ -0,0 +1,35 @@ +From 9444e647142d69b5381bb1225700e335312b1144 Mon Sep 17 00:00:00 2001 +From: Mingke Wang <[email protected]> +Date: Thu, 19 Mar 2015 14:15:25 +0800 +Subject: [PATCH 02/16] gstplaysink: don't set async of custom text-sink to + false + +set async to false lead to A/V sync problem when seeking. +the preroll need use GAP event instead of set async to false. + +Upstream-Status: Inappropriate [i.MX specific] + +Signed-off-by: Mingke Wang <[email protected]> +--- + gst/playback/gstplaysink.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + mode change 100644 => 100755 gst/playback/gstplaysink.c + +diff --git a/gst/playback/gstplaysink.c b/gst/playback/gstplaysink.c +old mode 100644 +new mode 100755 +index ead2e68..3f62769 +--- a/gst/playback/gstplaysink.c ++++ b/gst/playback/gstplaysink.c +@@ -2456,7 +2456,7 @@ gen_text_chain (GstPlaySink * playsink) + G_TYPE_BOOLEAN); + if (elem) { + /* make sure the sparse subtitles don't participate in the preroll */ +- g_object_set (elem, "async", FALSE, NULL); ++ //g_object_set (elem, "async", FALSE, NULL); + GST_DEBUG_OBJECT (playsink, "adding custom text sink"); + gst_bin_add (bin, chain->sink); + /* NOTE streamsynchronizer needs streams decoupled */ +-- +1.9.1 +recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0005-gstplaybin-remove-default-deinterlace-flag.patch new file +31
-0@@ -0,0 +1,31 @@ +From 14dc47b7e6e118d06ad4e7ed29284984b3fae248 Mon Sep 17 00:00:00 2001 +From: Jian Li <[email protected]> +Date: Mon, 23 Jun 2014 14:14:07 +0800 +Subject: [PATCH 06/16] gstplaybin remove default deinterlace flag + +- remove default deinterlace flag in playbin for i.MX SoCs + +Upstream-Status: Inappropriate [i.MX specific] + +Signed-off-by: Jian Li <[email protected]> +--- + gst/playback/gstplaybin2.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/gst/playback/gstplaybin2.c b/gst/playback/gstplaybin2.c +index 04eeb2b..09b7ad2 100644 +--- a/gst/playback/gstplaybin2.c ++++ b/gst/playback/gstplaybin2.c +@@ -500,8 +500,7 @@ struct _GstPlayBinClass + #define DEFAULT_SUBURI NULL + #define DEFAULT_SOURCE NULL + #define DEFAULT_FLAGS GST_PLAY_FLAG_AUDIO | GST_PLAY_FLAG_VIDEO | GST_PLAY_FLAG_TEXT | \ +- GST_PLAY_FLAG_SOFT_VOLUME | GST_PLAY_FLAG_DEINTERLACE | \ +- GST_PLAY_FLAG_SOFT_COLORBALANCE ++ GST_PLAY_FLAG_SOFT_VOLUME + #define DEFAULT_N_VIDEO 0 + #define DEFAULT_CURRENT_VIDEO -1 + #define DEFAULT_N_AUDIO 0 +-- +1.9.1 +recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0006-taglist-not-send-to-down-stream-if-all-the-frame-cor.patch new file +58
-0@@ -0,0 +1,58 @@ +From 1dfe4f567771217bb33c57e8480b99969f119ded Mon Sep 17 00:00:00 2001 +From: Lyon Wang <[email protected]> +Date: Wed, 21 Oct 2015 16:35:43 +0800 +Subject: [PATCH 07/16] taglist not send to down stream if all the frame + corrupted + +https://bugzilla.gnome.org/show_bug.cgi?id=737246 + +Upstream-Status: Pending + +Signed-off-by: Jian Li <[email protected]> +--- + gst-libs/gst/audio/gstaudiodecoder.c | 9 +++++++++ + gst-libs/gst/video/gstvideodecoder.c | 8 ++++++++ + 2 files changed, 17 insertions(+) + +diff --git a/gst-libs/gst/audio/gstaudiodecoder.c b/gst-libs/gst/audio/gstaudiodecoder.c +index 333dbf9..d082380 100644 +--- a/gst-libs/gst/audio/gstaudiodecoder.c ++++ b/gst-libs/gst/audio/gstaudiodecoder.c +@@ -2261,6 +2261,15 @@ gst_audio_decoder_sink_eventfunc (GstAudioDecoder * dec, GstEvent * event) + ("no valid frames found")); + } + ++ /* send taglist if no valid frame is decoded util EOS */ ++ if (dec->priv->taglist && dec->priv->taglist_changed) { ++ GST_DEBUG_OBJECT (dec, "codec tag %" GST_PTR_FORMAT, dec->priv->taglist); ++ if (!gst_tag_list_is_empty (dec->priv->taglist)) ++ gst_audio_decoder_push_event (dec, ++ gst_event_new_tag (gst_tag_list_ref (dec->priv->taglist))); ++ dec->priv->taglist_changed = FALSE; ++ } ++ + /* Forward EOS because no buffer or serialized event will come after + * EOS and nothing could trigger another _finish_frame() call. */ + if (dec->priv->pending_events) +diff --git a/gst-libs/gst/video/gstvideodecoder.c b/gst-libs/gst/video/gstvideodecoder.c +index b91a32e..1f89e10 100644 +--- a/gst-libs/gst/video/gstvideodecoder.c ++++ b/gst-libs/gst/video/gstvideodecoder.c +@@ -1165,6 +1165,14 @@ gst_video_decoder_sink_event_default (GstVideoDecoder * decoder, + * parent class' ::sink_event() until a later time. + */ + forward_immediate = TRUE; ++ ++ /* send taglist if no valid frame is decoded util EOS */ ++ if (decoder->priv->tags && decoder->priv->tags_changed) { ++ gst_video_decoder_push_event (decoder, ++ gst_event_new_tag (gst_tag_list_ref (decoder->priv->tags))); ++ decoder->priv->tags_changed = FALSE; ++ } ++ + break; + } + case GST_EVENT_GAP: +-- +1.9.1 +recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0007-handle-audio-video-decoder-error.patch new file +66
-0@@ -0,0 +1,66 @@ +From 40ef196e9291e71b852b32979daa0256cb805d14 Mon Sep 17 00:00:00 2001 +From: Lyon Wang <[email protected]> +Date: Mon, 15 Dec 2014 16:52:07 +0800 +Subject: [PATCH 08/16] handle audio/video decoder error + +When there is input data and no output data to the end of the stream, it will +send GST_ELEMENT_ERROR, So the clips playing will quit. +However, if only one of the tracks is corrupt, there is no need to quit other +tracks playing. + +The patch comments the GST_ELEMENT_ERROR() and just add GST_ERROR_OBJECT() +information instead. + +https://bugzilla.gnome.org/show_bug.cgi?id=741542 + +Upstream-Status: Pending + +Signed-off-by: Lyon Wang <[email protected]> +--- + gst-libs/gst/audio/gstaudiodecoder.c | 5 +++-- + gst-libs/gst/video/gstvideodecoder.c | 5 +++-- + 2 files changed, 6 insertions(+), 4 deletions(-) + mode change 100644 => 100755 gst-libs/gst/audio/gstaudiodecoder.c + mode change 100644 => 100755 gst-libs/gst/video/gstvideodecoder.c + +diff --git a/gst-libs/gst/audio/gstaudiodecoder.c b/gst-libs/gst/audio/gstaudiodecoder.c +old mode 100644 +new mode 100755 +index d082380..669b02a +--- a/gst-libs/gst/audio/gstaudiodecoder.c ++++ b/gst-libs/gst/audio/gstaudiodecoder.c +@@ -2256,9 +2256,10 @@ gst_audio_decoder_sink_eventfunc (GstAudioDecoder * dec, GstEvent * event) + GST_AUDIO_DECODER_STREAM_UNLOCK (dec); + + if (dec->priv->ctx.had_input_data && !dec->priv->ctx.had_output_data) { +- GST_ELEMENT_ERROR (dec, STREAM, DECODE, ++ /* GST_ELEMENT_ERROR (dec, STREAM, DECODE, + ("No valid frames decoded before end of stream"), +- ("no valid frames found")); ++ ("no valid frames found")); */ ++ GST_ERROR_OBJECT(dec, "No valid frames decoded before end of stream"); + } + + /* send taglist if no valid frame is decoded util EOS */ +diff --git a/gst-libs/gst/video/gstvideodecoder.c b/gst-libs/gst/video/gstvideodecoder.c +old mode 100644 +new mode 100755 +index 1f89e10..802d94a +--- a/gst-libs/gst/video/gstvideodecoder.c ++++ b/gst-libs/gst/video/gstvideodecoder.c +@@ -1151,9 +1151,10 @@ gst_video_decoder_sink_event_default (GstVideoDecoder * decoder, + + /* Error out even if EOS was ok when we had input, but no output */ + if (ret && priv->had_input_data && !priv->had_output_data) { +- GST_ELEMENT_ERROR (decoder, STREAM, DECODE, ++ /* GST_ELEMENT_ERROR (decoder, STREAM, DECODE, + ("No valid frames decoded before end of stream"), +- ("no valid frames found")); ++ ("no valid frames found")); */ ++ GST_ERROR_OBJECT(decoder, "No valid frames decoded before end of stream"); + } + + /* Forward EOS immediately. This is required because no +-- +1.9.1 +recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0008-gstaudiobasesink-print-warning-istead-of-return-ERRO.patch new file +47
-0@@ -0,0 +1,47 @@ +From 0b04eab955d557b84cfecea4bbe8cec6f04da0d8 Mon Sep 17 00:00:00 2001 +From: Lyon Wang <[email protected]> +Date: Tue, 17 Nov 2015 14:56:47 +0800 +Subject: [PATCH 09/16] gstaudiobasesink print warning istead of return ERROR. + +For those clips with corrupt audio track, +there might be no output from audio decoder +and thus the audio track have no chance to negotiate. +We can just print error warning instead of return ERROR, +so that other track can be played normally + +https://bugzilla.gnome.org/show_bug.cgi?id=758215 + +Upstream-Status: Pending + +Signed-off-by: Lyon Wang <[email protected]> +--- + gst-libs/gst/audio/gstaudiobasesink.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + mode change 100644 => 100755 gst-libs/gst/audio/gstaudiobasesink.c + +diff --git a/gst-libs/gst/audio/gstaudiobasesink.c b/gst-libs/gst/audio/gstaudiobasesink.c +old mode 100644 +new mode 100755 +index 6c0e7c9..91f0a48 +--- a/gst-libs/gst/audio/gstaudiobasesink.c ++++ b/gst-libs/gst/audio/gstaudiobasesink.c +@@ -1114,10 +1114,15 @@ gst_audio_base_sink_wait_event (GstBaseSink * bsink, GstEvent * event) + case GST_EVENT_GAP: + /* We must have a negotiated format before starting the ringbuffer */ + if (G_UNLIKELY (!gst_audio_ring_buffer_is_acquired (sink->ringbuffer))) { +- GST_ELEMENT_ERROR (sink, STREAM, FORMAT, (NULL), ++ /* GST_ELEMENT_ERROR (sink, STREAM, FORMAT, (NULL), + ("Sink not negotiated before %s event.", + GST_EVENT_TYPE_NAME (event))); ++ + return GST_FLOW_ERROR; ++ */ ++ /* consider there might be chance that corrupt audio track without output buffer and not negotiated. ++ We'd better not return error and quit play, video track can keep playing.*/ ++ GST_ERROR_OBJECT(sink, "Sink not negotiated before %s event.",GST_EVENT_TYPE_NAME (event)); + } + + gst_audio_base_sink_force_start (sink); +-- +1.9.1 +recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0009-MMFMWK-7030-Linux_MX6QP_ARD-IMXCameraApp-When-Enable.patch new file +58
-0@@ -0,0 +1,58 @@ +From c2790999940b0d96a663114c7f7a5af3b6069fef Mon Sep 17 00:00:00 2001 +From: Song Bing <[email protected]> +Date: Mon, 11 Jan 2016 14:51:17 +0800 +Subject: [PATCH 10/16] MMFMWK-7030 [Linux_MX6QP_ARD]IMXCameraApp:When Enabled + "save time to image" item, preview, find the time can not display completely. + 100% + +As IPU need 8 pixels alignment, add one workaround in base text overlay +to generate 8 pixels alignment text video buffer. The side effect should +cause all text a little smaller. + +Upstream-Status: Inappropriate [i.MX specific] + +Signed-off-by: Song Bing [email protected] +--- + ext/pango/gstbasetextoverlay.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +diff --git a/ext/pango/gstbasetextoverlay.c b/ext/pango/gstbasetextoverlay.c +index c08e3b0..421340a 100755 +--- a/ext/pango/gstbasetextoverlay.c ++++ b/ext/pango/gstbasetextoverlay.c +@@ -1677,7 +1677,7 @@ gst_base_text_overlay_render_pangocairo (GstBaseTextOverlay * overlay, + gint unscaled_width, unscaled_height; + gint width, height; + gboolean full_width = FALSE; +- double scalef = 1.0; ++ double scalef = 1.0, scalefx, scalefy; + double a, r, g, b; + gdouble shadow_offset = 0.0; + gdouble outline_offset = 0.0; +@@ -1805,6 +1805,14 @@ gst_base_text_overlay_render_pangocairo (GstBaseTextOverlay * overlay, + height = ceil (height * overlay->render_scale); + scalef *= overlay->render_scale; + ++ /* i.MX special, will cause text a little small */ ++ scalefx = scalef * ((gdouble)GST_ROUND_DOWN_8 (width)) / width; ++ scalefy = scalef * ((gdouble)GST_ROUND_DOWN_8 (height)) / height; ++ width = GST_ROUND_DOWN_8 (width); ++ height = GST_ROUND_DOWN_8 (height); ++ GST_DEBUG_OBJECT (overlay, "Rendering with width %d and height %d " ++ , width, height); ++ + if (width <= 0 || height <= 0) { + g_mutex_unlock (GST_BASE_TEXT_OVERLAY_GET_CLASS (overlay)->pango_lock); + GST_DEBUG_OBJECT (overlay, +@@ -1821,7 +1829,7 @@ gst_base_text_overlay_render_pangocairo (GstBaseTextOverlay * overlay, + /* Prepare the transformation matrix. Note that the transformation happens + * in reverse order. So for horizontal text, we will translate and then + * scale. This is important to understand which scale shall be used. */ +- cairo_matrix_init_scale (&cairo_matrix, scalef, scalef); ++ cairo_matrix_init_scale (&cairo_matrix, scalefx, scalefy); + + if (overlay->use_vertical_render) { + gint tmp; +-- +1.9.1 +recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0010-MMFMWK-7259-Remove-dependence-on-imx-plugin-git.patch new file +433
-0@@ -0,0 +1,433 @@ +From d58bab2ab3df3b40d6f65d88d0c827a303e0a651 Mon Sep 17 00:00:00 2001 +From: Haihua Hu <[email protected]> +Date: Fri, 5 Aug 2016 17:08:40 +0800 +Subject: [PATCH 11/16] [MMFMWK-7259] Remove dependence on imx plugin git. + +Add physical memory allocator + +Upstream-Status: Inappropriate [i.MX specific] + +Signed-off-by: Haihua Hu <[email protected]> +--- + gst-libs/gst/allocators/Makefile.am | 6 +- + gst-libs/gst/allocators/gstallocatorphymem.c | 314 +++++++++++++++++++++++++++ + gst-libs/gst/allocators/gstallocatorphymem.h | 64 ++++++ + 3 files changed, 382 insertions(+), 2 deletions(-) + create mode 100755 gst-libs/gst/allocators/gstallocatorphymem.c + create mode 100755 gst-libs/gst/allocators/gstallocatorphymem.h + +diff --git a/gst-libs/gst/allocators/Makefile.am b/gst-libs/gst/allocators/Makefile.am +index bccfdb3..a19c249 100644 +--- a/gst-libs/gst/allocators/Makefile.am ++++ b/gst-libs/gst/allocators/Makefile.am +@@ -5,13 +5,15 @@ libgstallocators_@GST_API_VERSION@_includedir = $(includedir)/gstreamer-@GST_API + libgstallocators_@GST_API_VERSION@_include_HEADERS = \ + allocators.h \ + gstfdmemory.h \ +- gstdmabuf.h ++ gstdmabuf.h \ ++ gstallocatorphymem.h + + noinst_HEADERS = + + libgstallocators_@GST_API_VERSION@_la_SOURCES = \ + gstfdmemory.c \ +- gstdmabuf.c ++ gstdmabuf.c \ ++ gstallocatorphymem.c + + libgstallocators_@GST_API_VERSION@_la_LIBADD = $(GST_LIBS) $(LIBM) + libgstallocators_@GST_API_VERSION@_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS) +diff --git a/gst-libs/gst/allocators/gstallocatorphymem.c b/gst-libs/gst/allocators/gstallocatorphymem.c +new file mode 100755 +index 0000000..cf5995e +--- /dev/null ++++ b/gst-libs/gst/allocators/gstallocatorphymem.c +@@ -0,0 +1,314 @@ ++/* ++ * Copyright (c) 2013-2015, Freescale Semiconductor, Inc. All rights reserved. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Library General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Library General Public License for more details. ++ * ++ * You should have received a copy of the GNU Library General Public ++ * License along with this library; if not, write to the ++ * Free Software Foundation, Inc., 59 Temple Place - Suite 330, ++ * Boston, MA 02111-1307, USA. ++ */ ++ ++#include <stdio.h> ++#include <string.h> ++#include "gstallocatorphymem.h" ++ ++typedef struct { ++ GstMemory mem; ++ guint8 *vaddr; ++ guint8 *paddr; ++ PhyMemBlock block; ++} GstMemoryPhy; ++ ++static int ++default_copy (GstAllocatorPhyMem *allocator, PhyMemBlock *dst_mem, ++ PhyMemBlock *src_mem, guint offset, guint size) ++{ ++ GST_WARNING ("No default copy implementation for physical memory allocator.\n"); ++ return -1; ++} ++ ++static gpointer ++gst_phymem_map (GstMemory * mem, gsize maxsize, GstMapFlags flags) ++{ ++ GstMemoryPhy *phymem = (GstMemoryPhy*) mem; ++ ++ if (GST_MEMORY_IS_READONLY(mem) && (flags & GST_MAP_WRITE)) { ++ GST_ERROR("memory is read only"); ++ return NULL; ++ } ++ ++ return phymem->vaddr; ++} ++ ++static void ++gst_phymem_unmap (GstMemory * mem) ++{ ++ return; ++} ++ ++static GstMemory * ++gst_phymem_copy (GstMemory * mem, gssize offset, gssize size) ++{ ++ GstAllocatorPhyMemClass *klass; ++ GstMemoryPhy *src_mem = (GstMemoryPhy *)mem; ++ ++ GstMemoryPhy *dst_mem = g_slice_alloc(sizeof(GstMemoryPhy)); ++ if(dst_mem == NULL) { ++ GST_ERROR("Can't allocate for GstMemoryPhy structure.\n"); ++ return NULL; ++ } ++ ++ klass = GST_ALLOCATOR_PHYMEM_CLASS(G_OBJECT_GET_CLASS(mem->allocator)); ++ if(klass == NULL) { ++ GST_ERROR("Can't get class from allocator object.\n"); ++ return NULL; ++ } ++ ++ if(klass->copy_phymem((GstAllocatorPhyMem*)mem->allocator, ++ &dst_mem->block, &src_mem->block, offset, size) < 0) { ++ GST_WARNING ("Copy phymem %d failed.\n", size); ++ return NULL; ++ } ++ ++ GST_DEBUG ("copied phymem, vaddr(%p), paddr(%p), size(%d).\n", ++ dst_mem->block.vaddr, dst_mem->block.paddr, dst_mem->block.size); ++ ++ dst_mem->vaddr = dst_mem->block.vaddr; ++ dst_mem->paddr = dst_mem->block.paddr; ++ ++ gst_memory_init (GST_MEMORY_CAST (dst_mem), ++ mem->mini_object.flags&(~GST_MEMORY_FLAG_READONLY), ++ mem->allocator, NULL, mem->maxsize, mem->align, ++ mem->offset, mem->size); ++ ++ return (GstMemory*)dst_mem; ++} ++ ++static GstMemory * ++gst_phymem_share (GstMemory * mem, gssize offset, gssize size) ++{ ++ GST_ERROR("Not implemented mem_share in gstallocatorphymem.\n"); ++ return NULL; ++} ++ ++static gboolean ++gst_phymem_is_span (GstMemory * mem1, GstMemory * mem2, gsize * offset) ++{ ++ return FALSE; ++} ++ ++static gpointer ++gst_phymem_get_phy (GstMemory * mem) ++{ ++ GstMemoryPhy *phymem = (GstMemoryPhy*) mem; ++ ++ return phymem->paddr; ++} ++ ++static GstMemory * ++base_alloc (GstAllocator * allocator, gsize size, ++ GstAllocationParams * params) ++{ ++ GstAllocatorPhyMemClass *klass; ++ GstMemoryPhy *mem; ++ gsize maxsize, aoffset, offset, align, padding; ++ guint8 *data; ++ ++ mem = g_slice_alloc(sizeof(GstMemoryPhy)); ++ if(mem == NULL) { ++ GST_ERROR("Can allocate for GstMemoryPhy structure.\n"); ++ return NULL; ++ } ++ ++ klass = GST_ALLOCATOR_PHYMEM_CLASS(G_OBJECT_GET_CLASS(allocator)); ++ if(klass == NULL) { ++ GST_ERROR("Can't get class from allocator object.\n"); ++ return NULL; ++ } ++ ++ GST_DEBUG ("allocate params, prefix (%d), padding (%d), align (%d), flags (%x).\n", ++ params->prefix, params->padding, params->align, params->flags); ++ ++ maxsize = size + params->prefix + params->padding; ++ mem->block.size = maxsize; ++ if(klass->alloc_phymem((GstAllocatorPhyMem*)allocator, &mem->block) < 0) { ++ GST_ERROR("Allocate phymem %d failed.\n", maxsize); ++ return NULL; ++ } ++ ++ GST_DEBUG ("allocated phymem, vaddr(%p), paddr(%p), size(%d).\n", ++ mem->block.vaddr, mem->block.paddr, mem->block.size); ++ ++ data = mem->block.vaddr; ++ offset = params->prefix; ++ align = params->align; ++ /* do alignment */ ++ if ((aoffset = ((guintptr)data & align))) { ++ aoffset = (align + 1) - aoffset; ++ data += aoffset; ++ maxsize -= aoffset; ++ } ++ mem->vaddr = mem->block.vaddr + aoffset; ++ mem->paddr = mem->block.paddr + aoffset; ++ ++ GST_DEBUG ("aligned vaddr(%p), paddr(%p), size(%d).\n", ++ mem->block.vaddr, mem->block.paddr, mem->block.size); ++ ++ if (offset && (params->flags & GST_MEMORY_FLAG_ZERO_PREFIXED)) ++ memset (data, 0, offset); ++ ++ padding = maxsize - (offset + size); ++ if (padding && (params->flags & GST_MEMORY_FLAG_ZERO_PADDED)) ++ memset (data + offset + size, 0, padding); ++ ++ gst_memory_init (GST_MEMORY_CAST (mem), params->flags, allocator, NULL, maxsize, align, offset, size); ++ ++ return (GstMemory*)mem; ++} ++ ++static void ++base_free (GstAllocator * allocator, GstMemory * mem) ++{ ++ GstAllocatorPhyMemClass *klass; ++ GstMemoryPhy *phymem; ++ ++ klass = GST_ALLOCATOR_PHYMEM_CLASS(G_OBJECT_GET_CLASS(allocator)); ++ if(klass == NULL) { ++ GST_ERROR("Can't get class from allocator object, can't free %p\n", mem); ++ return; ++ } ++ ++ phymem = (GstMemoryPhy*)mem; ++ ++ GST_DEBUG ("free phymem, vaddr(%p), paddr(%p), size(%d).\n", ++ phymem->block.vaddr, phymem->block.paddr, phymem->block.size); ++ ++ klass->free_phymem((GstAllocatorPhyMem*)allocator, &phymem->block); ++ g_slice_free1(sizeof(GstMemoryPhy), mem); ++ ++ return; ++} ++ ++static int ++default_alloc (GstAllocatorPhyMem *allocator, PhyMemBlock *phy_mem) ++{ ++ GST_ERROR ("No default allocating implementation for physical memory allocation.\n"); ++ return -1; ++} ++ ++static int ++default_free (GstAllocatorPhyMem *allocator, PhyMemBlock *phy_mem) ++{ ++ GST_ERROR ("No default free implementation for physical memory allocation.\n"); ++ return -1; ++} ++ ++G_DEFINE_TYPE (GstAllocatorPhyMem, gst_allocator_phymem, GST_TYPE_ALLOCATOR); ++ ++static void ++gst_allocator_phymem_class_init (GstAllocatorPhyMemClass * klass) ++{ ++ GstAllocatorClass *allocator_class; ++ ++ allocator_class = (GstAllocatorClass *) klass; ++ ++ allocator_class->alloc = base_alloc; ++ allocator_class->free = base_free; ++ klass->alloc_phymem = default_alloc; ++ klass->free_phymem = default_free; ++ klass->copy_phymem = default_copy; ++} ++ ++static void ++gst_allocator_phymem_init (GstAllocatorPhyMem * allocator) ++{ ++ GstAllocator *alloc = GST_ALLOCATOR_CAST (allocator); ++ ++ alloc->mem_map = gst_phymem_map; ++ alloc->mem_unmap = gst_phymem_unmap; ++ alloc->mem_copy = gst_phymem_copy; ++ alloc->mem_share = gst_phymem_share; ++ alloc->mem_is_span = gst_phymem_is_span; ++} ++ ++ ++//global functions ++ ++gboolean ++gst_buffer_is_phymem (GstBuffer *buffer) ++{ ++ gboolean ret = FALSE; ++ PhyMemBlock * memblk; ++ GstMemory *mem = gst_buffer_get_memory (buffer, 0); ++ if(mem == NULL) { ++ GST_ERROR ("Not get memory from buffer.\n"); ++ return FALSE; ++ } ++ ++ if(GST_IS_ALLOCATOR_PHYMEM(mem->allocator)) { ++ if (NULL == ((GstMemoryPhy*)mem)->block.paddr) { ++ GST_WARNING("physical address in memory block is invalid"); ++ ret = FALSE; ++ } else { ++ ret = TRUE; ++ } ++ } ++ ++ gst_memory_unref (mem); ++ ++ return ret; ++} ++ ++PhyMemBlock * ++gst_buffer_query_phymem_block (GstBuffer *buffer) ++{ ++ GstMemory *mem; ++ GstMemoryPhy *memphy; ++ PhyMemBlock *memblk; ++ ++ mem = gst_buffer_get_memory (buffer, 0); ++ if(mem == NULL) { ++ GST_ERROR ("Not get memory from buffer.\n"); ++ return NULL; ++ } ++ ++ if(!GST_IS_ALLOCATOR_PHYMEM(mem->allocator)) { ++ gst_memory_unref (mem); ++ return NULL; ++ } ++ ++ memphy = (GstMemoryPhy*) mem; ++ memblk = &memphy->block; ++ ++ gst_memory_unref (mem); ++ ++ return memblk; ++} ++ ++PhyMemBlock * ++gst_memory_query_phymem_block (GstMemory *mem) ++{ ++ GstMemoryPhy *memphy; ++ PhyMemBlock *memblk; ++ ++ if (!mem) ++ return NULL; ++ ++ if (!GST_IS_ALLOCATOR_PHYMEM(mem->allocator)) ++ return NULL; ++ ++ memphy = (GstMemoryPhy*) mem; ++ memblk = &memphy->block; ++ ++ return memblk; ++} ++ +diff --git a/gst-libs/gst/allocators/gstallocatorphymem.h b/gst-libs/gst/allocators/gstallocatorphymem.h +new file mode 100755 +index 0000000..f0833ae +--- /dev/null ++++ b/gst-libs/gst/allocators/gstallocatorphymem.h +@@ -0,0 +1,64 @@ ++/* ++ * Copyright (c) 2013-2015, Freescale Semiconductor, Inc. All rights reserved. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Library General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Library General Public License for more details. ++ * ++ * You should have received a copy of the GNU Library General Public ++ * License along with this library; if not, write to the ++ * Free Software Foundation, Inc., 59 Temple Place - Suite 330, ++ * Boston, MA 02111-1307, USA. ++ */ ++ ++#ifndef __ALLOCATOR_PHYMEM_H__ ++#define __ALLOCATOR_PHYMEM_H__ ++ ++#include <gst/gst.h> ++#include <gst/gstallocator.h> ++ ++#define PAGE_ALIGN(x) (((x) + 4095) & ~4095) ++ ++#define GST_TYPE_ALLOCATOR_PHYMEM (gst_allocator_phymem_get_type()) ++#define GST_ALLOCATOR_PHYMEM(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_ALLOCATOR_PHYMEM, GstAllocatorPhyMem)) ++#define GST_ALLOCATOR_PHYMEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_ALLOCATOR_PHYMEM, GstAllocatorPhyMemClass)) ++#define GST_IS_ALLOCATOR_PHYMEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_ALLOCATOR_PHYMEM)) ++#define GST_IS_ALLOCATOR_PHYMEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_ALLOCATOR_PHYMEM)) ++ ++typedef struct _GstAllocatorPhyMem GstAllocatorPhyMem; ++typedef struct _GstAllocatorPhyMemClass GstAllocatorPhyMemClass; ++ ++/* also change gst-libs/gst/gl/gstglvivdirecttexture.c in gst-plugins-bad git ++ * if changed below structure */ ++typedef struct { ++ guint8 *vaddr; ++ guint8 *paddr; ++ guint8 *caddr; ++ gsize size; ++ gpointer *user_data; ++} PhyMemBlock; ++ ++struct _GstAllocatorPhyMem { ++ GstAllocator parent; ++}; ++ ++struct _GstAllocatorPhyMemClass { ++ GstAllocatorClass parent_class; ++ int (*alloc_phymem) (GstAllocatorPhyMem *allocator, PhyMemBlock *phy_mem); ++ int (*free_phymem) (GstAllocatorPhyMem *allocator, PhyMemBlock *phy_mem); ++ int (*copy_phymem) (GstAllocatorPhyMem *allocator, PhyMemBlock *det_mem, ++ PhyMemBlock *src_mem, guint offset, guint size); ++}; ++ ++GType gst_allocator_phymem_get_type (void); ++gboolean gst_buffer_is_phymem (GstBuffer *buffer); ++PhyMemBlock *gst_buffer_query_phymem_block (GstBuffer *buffer); ++PhyMemBlock *gst_memory_query_phymem_block (GstMemory *mem); ++ ++#endif +-- +1.9.1 +recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0011-Disable-orc-optimization-for-lib-video-in-plugins-ba.patch new file +34
-0@@ -0,0 +1,34 @@ +From 0100444aa707053fb65bea26feffb5de90909b60 Mon Sep 17 00:00:00 2001 +From: Lyon Wang <[email protected]> +Date: Thu, 10 Dec 2015 14:32:43 +0800 +Subject: [PATCH 12/16] Disable orc optimization for lib video in plugins-base + +- the orc optimization for lib video in plugins base may +cause segmentation fault +- disalbe orc optimization for lib video and just use the c source + +package: gstreamer1.0-plugins-base + +Upstream-Status: Pending [https://bugzilla.gnome.org/show_bug.cgi?id=759286] + +Signed-off-by: Lyon Wang <[email protected]> +--- + gst-libs/gst/video/Makefile.am | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gst-libs/gst/video/Makefile.am b/gst-libs/gst/video/Makefile.am +index 64f4978..a197a2f 100644 +--- a/gst-libs/gst/video/Makefile.am ++++ b/gst-libs/gst/video/Makefile.am +@@ -90,7 +90,7 @@ nodist_libgstvideo_@GST_API_VERSION@include_HEADERS = $(built_headers) + noinst_HEADERS = gstvideoutilsprivate.h + + libgstvideo_@GST_API_VERSION@_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS) \ +- $(ORC_CFLAGS) ++ $(ORC_CFLAGS) -DDISABLE_ORC + libgstvideo_@GST_API_VERSION@_la_LIBADD = $(GST_BASE_LIBS) $(GST_LIBS) $(ORC_LIBS) $(LIBM) + libgstvideo_@GST_API_VERSION@_la_LDFLAGS = $(GST_LIB_LDFLAGS) $(GST_ALL_LDFLAGS) $(GST_LT_LDFLAGS) + +-- +1.9.1 +recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0012-Remove-phymem-allocator-from-base-to-bad.patch new file +37
-0@@ -0,0 +1,37 @@ +From 2ad9aa1c62ff7b7772862ace35dd03bfae3f0fce Mon Sep 17 00:00:00 2001 +From: Haihua Hu <[email protected]> +Date: Thu, 25 May 2017 11:31:46 +0800 +Subject: [PATCH 16/16] Remove phymem allocator from base to bad + +Upstream-Status: Inappropriate [i.MX specific] +--- + gst-libs/gst/allocators/Makefile.am | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/gst-libs/gst/allocators/Makefile.am b/gst-libs/gst/allocators/Makefile.am +index 1955436..1c5680b 100644 +--- a/gst-libs/gst/allocators/Makefile.am ++++ b/gst-libs/gst/allocators/Makefile.am +@@ -5,8 +5,7 @@ libgstallocators_@GST_API_VERSION@_includedir = $(includedir)/gstreamer-@GST_API + libgstallocators_@GST_API_VERSION@_include_HEADERS = \ + allocators.h \ + gstfdmemory.h \ +- gstdmabuf.h \ +- gstallocatorphymem.h ++ gstdmabuf.h + + if USE_ION + libgstallocators_@GST_API_VERSION@_include_HEADERS += \ +@@ -17,8 +16,7 @@ noinst_HEADERS = + + libgstallocators_@GST_API_VERSION@_la_SOURCES = \ + gstfdmemory.c \ +- gstdmabuf.c \ +- gstallocatorphymem.c ++ gstdmabuf.c + + if USE_ION + libgstallocators_@GST_API_VERSION@_la_SOURCES += \ +-- +1.9.1 +recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0013-dmabuf-set-fd-memory-to-keep-mapped.patch new file +30
-0@@ -0,0 +1,30 @@ +From 59a4c4584f732eea055267971013909816287311 Mon Sep 17 00:00:00 2001 +From: Song Bing <[email protected]> +Date: Wed, 13 Sep 2017 13:37:17 -0800 +Subject: [PATCH 4/4] dmabuf: set fd memory to keep mapped + +set fd memory to keep mapped. + +Upstream-Status: Pending + +https://bugzilla.gnome.org/show_bug.cgi?id=768794 +--- + gst-libs/gst/allocators/gstdmabuf.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gst-libs/gst/allocators/gstdmabuf.c b/gst-libs/gst/allocators/gstdmabuf.c +index 7d6bcab..89bb447 100644 +--- a/gst-libs/gst/allocators/gstdmabuf.c ++++ b/gst-libs/gst/allocators/gstdmabuf.c +@@ -95,7 +95,7 @@ gst_dmabuf_allocator_alloc (GstAllocator * allocator, gint fd, gsize size) + { + g_return_val_if_fail (GST_IS_DMABUF_ALLOCATOR (allocator), NULL); + +- return gst_fd_allocator_alloc (allocator, fd, size, GST_FD_MEMORY_FLAG_NONE); ++ return gst_fd_allocator_alloc (allocator, fd, size, GST_FD_MEMORY_FLAG_KEEP_MAPPED); + } + + /** +-- +2.7.4 +recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0014-fdmemory-need-unmap-if-mapping-flags-are-not-subset-.patch new file +36
-0@@ -0,0 +1,36 @@ +From bbce23ade0d17c7ef4dbd6042009e0f2419f9668 Mon Sep 17 00:00:00 2001 +From: Haihua Hu <[email protected]> +Date: Mon, 6 Nov 2017 15:05:47 +0800 +Subject: [PATCH] fdmemory: need unmap if mapping flags are not subset of + previous + +Upstream-Status: Pending +https://bugzilla.gnome.org/show_bug.cgi?id=789952 + +--- + gst-libs/gst/allocators/gstfdmemory.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/gst-libs/gst/allocators/gstfdmemory.c b/gst-libs/gst/allocators/gstfdmemory.c +index ad428a7..1e6125a 100644 +--- a/gst-libs/gst/allocators/gstfdmemory.c ++++ b/gst-libs/gst/allocators/gstfdmemory.c +@@ -97,9 +97,13 @@ gst_fd_mem_map (GstMemory * gmem, gsize maxsize, GstMapFlags flags) + if ((mem->mmapping_flags & prot) == prot) { + ret = mem->data; + mem->mmap_count++; ++ goto out; ++ } else { ++ /* if mapping flags is not a subset, need unmap first */ ++ munmap ((void *) mem->data, gmem->maxsize); ++ mem->data = NULL; ++ mem->mmap_count = 0;; + } +- +- goto out; + } + + if (mem->fd != -1) { +-- +1.9.1 +recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0015-basetextoverlay-need-avoid-idx-exceed-me.patch new file +34
-0@@ -0,0 +1,34 @@ +From f11ab0f14638d21b6e48bff3fd63aaaa0689f21d Mon Sep 17 00:00:00 2001 +From: Haihua Hu <[email protected]> +Date: Thu, 30 Nov 2017 17:43:20 +0800 +Subject: [PATCH] [MMFMWK-7786] basetextoverlay: need avoid idx exceed memory + block number + +when check whether video buffer is read only, the gst_buffer_get_memory call +should make sure idx don't exceed the total memory block number + +Upstream-Status: Inappropriate [i.MX specific] + +Signed-off-by: Haihua Hu <[email protected]> +--- + ext/pango/gstbasetextoverlay.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/ext/pango/gstbasetextoverlay.c b/ext/pango/gstbasetextoverlay.c +index 7e32904..d2bbbee 100755 +--- a/ext/pango/gstbasetextoverlay.c ++++ b/ext/pango/gstbasetextoverlay.c +@@ -2248,7 +2248,9 @@ gst_base_text_overlay_push_frame (GstBaseTextOverlay * overlay, + gboolean mem_rdonly = FALSE; + GstMemory *mem; + +- while (mem = gst_buffer_get_memory(video_frame, idx++)) { ++ gint n_mem = gst_buffer_n_memory (video_frame); ++ ++ while (idx < n_mem && (mem = gst_buffer_get_memory(video_frame, idx++))) { + if (GST_MEMORY_IS_READONLY(mem)) { + gst_memory_unref (mem); + mem_rdonly = TRUE; +-- +1.9.1 +recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.12.%.bbappend new file +24
-1@@ -0,0 +1,24 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +# Enable pango lib +PACKAGECONFIG_append = " pango " + +# ion allocator will be enabled only when detecting the ion.h exists, which is built out from kernel. +# For now, ion allocatior is supported on mx7ulp & mx8 +DEPENDS_append_mx7ulp = " virtual/kernel" +DEPENDS_append_mx8 = " virtual/kernel" + +SRC_URI_append = " file://0001-basetextoverlay-make-memory-copy-when-video-buffer-s.patch \ + file://0002-gstplaysink-don-t-set-async-of-custom-text-sink-to-f.patch \ + file://0005-gstplaybin-remove-default-deinterlace-flag.patch \ + file://0006-taglist-not-send-to-down-stream-if-all-the-frame-cor.patch \ + file://0007-handle-audio-video-decoder-error.patch \ + file://0008-gstaudiobasesink-print-warning-istead-of-return-ERRO.patch \ + file://0009-MMFMWK-7030-Linux_MX6QP_ARD-IMXCameraApp-When-Enable.patch \ + file://0010-MMFMWK-7259-Remove-dependence-on-imx-plugin-git.patch \ + file://0011-Disable-orc-optimization-for-lib-video-in-plugins-ba.patch \ + file://0012-Remove-phymem-allocator-from-base-to-bad.patch \ + file://0013-dmabuf-set-fd-memory-to-keep-mapped.patch \ + file://0014-fdmemory-need-unmap-if-mapping-flags-are-not-subset-.patch \ + file://0015-basetextoverlay-need-avoid-idx-exceed-me.patch \ +" --2.13.6
--
_______________________________________________
meta-freescale mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-freescale
Signature · 3 lines
Otavio Salvador O.S. Systems http://www.ossystems.com.br http://code.ossystems.com.br Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750
PATCH 4/6 gstreamer1.0-plugins-good: Add NXP specific patches
In reply to Stefan AgnerFrom: Stefan Agner <[email protected]>
Add NXP specific patches from morty-4.9.51-mx8_beta branch. This allows to use imx-gst1.0-plugin 4.3.1 with gstreamer 1.12.2.
--- ...Need-to-check-if-pa-stream-is-still-valid.patch | 39 +++ .../0002-Fix-aacpase-error-tolerance-issue.patch | 34 +++ ...-MMFMWK-7274-mx8dv-Enable-camera-on-mx8dv.patch | 37 +++ ...-Fix-adif-aac-file-read-channel-progile-i.patch | 267 +++++++++++++++++++++ .../gstreamer1.0-plugins-good_1.12.%.bbappend | 7 + 5 files changed, 384 insertions(+) create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0001-Need-to-check-if-pa-stream-is-still-valid.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0002-Fix-aacpase-error-tolerance-issue.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0003-MMFMWK-7274-mx8dv-Enable-camera-on-mx8dv.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0004-gstaacparse-Fix-adif-aac-file-read-channel-progile-i.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.12.%.bbappend
recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0001-Need-to-check-if-pa-stream-is-still-valid.patch new file +39 -0
@@ -0,0 +1,39 @@ +From a4af947cb793cd3b9550c76d1ea8db7d3a94612a Mon Sep 17 00:00:00 2001 +From: Jian <[email protected]> +Date: Tue, 3 Feb 2015 17:08:40 +0800 +Subject: [PATCH 2/4] Need to check if pa stream is still valid + +Fixed the issue that will report pulse server is dead +when doing audio track switching. +Need to check if pa stream is valid as it may be released +by caps change. + +Upstream-Status: Submitted +https://bugzilla.gnome.org/show_bug.cgi?id=743912 + +Signed-off-by: Jian <[email protected]> +--- + ext/pulse/pulsesink.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/ext/pulse/pulsesink.c b/ext/pulse/pulsesink.c +index 521c4a6..931f1c8 100644 +--- a/ext/pulse/pulsesink.c ++++ b/ext/pulse/pulsesink.c +@@ -2022,6 +2022,13 @@ gst_pulsesink_get_time (GstClock * clock, GstAudioBaseSink * sink) + } + + pa_threaded_mainloop_lock (mainloop); ++ ++ /* Need to check if pa stream is valid as it may be released by caps change*/ ++ if (!pbuf->stream) { ++ pa_threaded_mainloop_unlock (mainloop); ++ return GST_CLOCK_TIME_NONE; ++ } ++ + if (gst_pulsering_is_dead (psink, pbuf, TRUE)) + goto server_dead; + +-- +1.9.1 +
recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0002-Fix-aacpase-error-tolerance-issue.patch new file +34 -0
@@ -0,0 +1,34 @@ +From db527a6db0c55322174ff6baa389ac8b110ec662 Mon Sep 17 00:00:00 2001 +From: Lyon Wang <[email protected]> +Date: Fri, 6 Feb 2015 11:27:47 +0800 +Subject: [PATCH 3/4] Fix aacpase error tolerance issue + +There is no need to check channel configure in adts header. +The channel could be output of decoder. +No need to return fatal error here. + +https://bugzilla.gnome.org/show_bug.cgi?id=743332 + +Upstream-Status: Pending + +Signed-off-by: Lyon Wang <[email protected]> +--- + gst/audioparsers/gstaacparse.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gst/audioparsers/gstaacparse.c b/gst/audioparsers/gstaacparse.c +index cabd961..09a53cc 100644 +--- a/gst/audioparsers/gstaacparse.c ++++ b/gst/audioparsers/gstaacparse.c +@@ -915,7 +915,7 @@ gst_aac_parse_detect_stream (GstAacParse * aacparse, + gst_aac_parse_parse_adts_header (aacparse, data, &rate, &channels, + &aacparse->object_type, &aacparse->mpegversion); + +- if (!channels || !framesize) { ++ if (!framesize) { + GST_DEBUG_OBJECT (aacparse, "impossible ADTS configuration"); + return FALSE; + } +-- +1.9.1 +
recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0003-MMFMWK-7274-mx8dv-Enable-camera-on-mx8dv.patch new file +37 -0
@@ -0,0 +1,37 @@ +From 4a37ac1ffc2952fb6dedec914dcd336dbaf5dff5 Mon Sep 17 00:00:00 2001 +From: Song Bing <[email protected]> +Date: Fri, 21 Oct 2016 11:24:05 +0800 +Subject: [PATCH 4/4] MMFMWK-7274 [mx8dv] Enable camera on mx8dv + +Set memory allocate by camera as physical continuoues. + +Signed-off-by: Song Bing [email protected] +--- + sys/v4l2/gstv4l2allocator.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/sys/v4l2/gstv4l2allocator.c b/sys/v4l2/gstv4l2allocator.c +index 2047383..ecab01e 100644 +--- a/sys/v4l2/gstv4l2allocator.c ++++ b/sys/v4l2/gstv4l2allocator.c +@@ -818,7 +818,7 @@ gst_v4l2_allocator_alloc_mmap (GstV4l2Allocator * allocator) + "mmap buffer length %d, data offset %d, plane %d", + group->planes[i].length, group->planes[i].data_offset, i); + +- group->mem[i] = (GstMemory *) _v4l2mem_new (0, GST_ALLOCATOR (allocator), ++ group->mem[i] = (GstMemory *) _v4l2mem_new (GST_MEMORY_FLAG_PHYSICALLY_CONTIGUOUS, GST_ALLOCATOR (allocator), + NULL, group->planes[i].length, 0, 0, group->planes[i].length, i, + data, -1, group); + } else { +@@ -879,7 +879,7 @@ gst_v4l2_allocator_alloc_dmabuf (GstV4l2Allocator * allocator, + GST_LOG_OBJECT (allocator, "exported DMABUF as fd %i plane %d", + expbuf.fd, i); + +- group->mem[i] = (GstMemory *) _v4l2mem_new (0, GST_ALLOCATOR (allocator), ++ group->mem[i] = (GstMemory *) _v4l2mem_new (GST_MEMORY_FLAG_PHYSICALLY_CONTIGUOUS, GST_ALLOCATOR (allocator), + NULL, group->planes[i].length, 0, 0, group->planes[i].length, i, + NULL, expbuf.fd, group); + } else { +-- +1.9.1 +
recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0004-gstaacparse-Fix-adif-aac-file-read-channel-progile-i.patch new file +267 -0
267 lines not on this page · raw message
recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.12.%.bbappend new file +7 -0
@@ -0,0 +1,7 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +SRC_URI_append = " file://0001-Need-to-check-if-pa-stream-is-still-valid.patch \ + file://0002-Fix-aacpase-error-tolerance-issue.patch \ + file://0003-MMFMWK-7274-mx8dv-Enable-camera-on-mx8dv.patch \ + file://0004-gstaacparse-Fix-adif-aac-file-read-channel-progile-i.patch \ +"
Signature · 1 line
2.13.6
Re: [PATCH 4/6] gstreamer1.0-plugins-good: Add NXP specific patches
On Mon, Dec 18, 2017 at 3:20 PM, Stefan Agner <[email protected]> wrote:
...
recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.12.%.bbappend line 7
Quoted 9 lines
+++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.12.%.bbappend
recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.12.%.bbappend new file +7
-0@@ -0,0 +1,7 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +SRC_URI_append = " file://0001-Need-to-check-if-pa-stream-is-still-valid.patch \ + file://0002-Fix-aacpase-error-tolerance-issue.patch \ + file://0003-MMFMWK-7274-mx8dv-Enable-camera-on-mx8dv.patch \ + file://0004-gstaacparse-Fix-adif-aac-file-read-channel-progile-i.patch \ +"
Same as previous comment.
Signature · 3 lines
Otavio Salvador O.S. Systems http://www.ossystems.com.br http://code.ossystems.com.br Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750
PATCH 5/6 gstreamer1.0-plugins-bad: Add NXP specific patches
In reply to Stefan AgnerFrom: Stefan Agner <[email protected]>
Add NXP specific patches from morty-4.9.51-mx8_beta branch. This allows to use imx-gst1.0-plugin 4.3.1 with gstreamer 1.12.2.
--- ...pegtsmux-Need-get-pid-when-create-streams.patch | 44 ++ ...rse-Need-detect-picture-coding-type-when-.patch | 47 ++ .../0003-modifiy-the-videoparse-rank.patch | 77 +++ ...ter-Lost-frame-rate-info-when-fixate-caps.patch | 51 ++ ...dd-one-property-to-set-sink-element-for-v.patch | 181 ++++++ ...or-gl-plugin-not-built-in-wayland-backend.patch | 34 + ...07-Change-wayland-default-res-to-1024x768.patch | 41 ++ ...wayland-fix-loop-test-hang-in-glimagesink.patch | 142 +++++ ...sink-wayland-resize-showed-blurred-screen.patch | 32 + .../0010-support-video-crop-for-glimagesink.patch | 151 +++++ .../0011-Add-fps-print-in-glimagesink.patch | 86 +++ ...rconvert-convert-YUV-to-RGB-use-directviv.patch | 168 +++++ ...mpositor-Remove-output-format-alpha-check.patch | 35 ++ .../0014-Specific-patches-for-gstplayer-API.patch | 367 +++++++++++ ...15-gstplayer-Add-gst_player_get_state-API.patch | 63 ++ .../0016-gstplayer-Add-play-stop-sync-API.patch | 182 ++++++ .../0018-Add-imx-physical-memory-allocator.patch | 443 +++++++++++++ ...nt-of-interface-get_phys_addr-to-support-.patch | 48 ++ ...0020-Accelerate-gldownload-with-directviv.patch | 698 +++++++++++++++++++++ ...mabuf-memory-allocator-based-on-ion-drive.patch | 390 ++++++++++++ .../0022-ionmemory-support-get-phys-memory.patch | 94 +++ ...d-add-crop-meta-support-in-dmafd-uploader.patch | 52 ++ ...upload-add-ion-dmabuf-support-in-glupload.patch | 477 ++++++++++++++ ...0025-Add-ion-dmabuf-support-in-gldownload.patch | 473 ++++++++++++++ ...er-check-frame-buffer-status-need-use-spe.patch | 132 ++++ ...-add-EGL-platform-support-for-x11-backend.patch | 63 ++ ...-kmssink-use-control-node-to-setplane-to-.patch | 108 ++++ ...29-kmssink-support-videooverlay-interface.patch | 343 ++++++++++ ...030-kmssink-check-scaleable-when-set_caps.patch | 74 +++ ...-glimagesink-fix-segmentation-fault-when-.patch | 35 ++ ...-gl-viv-fb-fix-wrong-pos-x-y-calculate-in.patch | 52 ++ ...-gl-viv-fb-transform-screen-coordinate-to.patch | 52 ++ ...-glimagesink-expose-should-do-redisplay-a.patch | 37 ++ ...-videoaggregator-passthrough-interlace-mo.patch | 99 +++ ...-glvideomixer-need-update-output-geometry.patch | 83 +++ ...-gleglimage-fix-YUY2-import-error-when-up.patch | 30 + ...-glupload-need-upload-each-plane-to-singl.patch | 101 +++ .../gstreamer1.0-plugins-bad_1.12.%.bbappend | 61 ++ 38 files changed, 5646 insertions(+) create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-mpegtsmux-Need-get-pid-when-create-streams.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0002-mpegvideoparse-Need-detect-picture-coding-type-when-.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0003-modifiy-the-videoparse-rank.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0004-glfilter-Lost-frame-rate-info-when-fixate-caps.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0005-camerabin-Add-one-property-to-set-sink-element-for-v.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0006-Fix-for-gl-plugin-not-built-in-wayland-backend.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0007-Change-wayland-default-res-to-1024x768.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0008-gl-wayland-fix-loop-test-hang-in-glimagesink.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0009-Fix-glimagesink-wayland-resize-showed-blurred-screen.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0010-support-video-crop-for-glimagesink.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0011-Add-fps-print-in-glimagesink.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0012-glcolorconvert-convert-YUV-to-RGB-use-directviv.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0013-videocompositor-Remove-output-format-alpha-check.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0014-Specific-patches-for-gstplayer-API.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0015-gstplayer-Add-gst_player_get_state-API.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0016-gstplayer-Add-play-stop-sync-API.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0018-Add-imx-physical-memory-allocator.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0019-Add-implement-of-interface-get_phys_addr-to-support-.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0020-Accelerate-gldownload-with-directviv.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0021-ionmemory-dmabuf-memory-allocator-based-on-ion-drive.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0022-ionmemory-support-get-phys-memory.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0023-glupload-add-crop-meta-support-in-dmafd-uploader.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0024-glupload-add-ion-dmabuf-support-in-glupload.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0025-Add-ion-dmabuf-support-in-gldownload.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0026-glframebuffer-check-frame-buffer-status-need-use-spe.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0027-qml-add-EGL-platform-support-for-x11-backend.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0028-kmssink-use-control-node-to-setplane-to-.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0029-kmssink-support-videooverlay-interface.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0030-kmssink-check-scaleable-when-set_caps.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0031-glimagesink-fix-segmentation-fault-when-.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0032-gl-viv-fb-fix-wrong-pos-x-y-calculate-in.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0033-gl-viv-fb-transform-screen-coordinate-to.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0034-glimagesink-expose-should-do-redisplay-a.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0035-videoaggregator-passthrough-interlace-mo.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0036-glvideomixer-need-update-output-geometry.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0037-gleglimage-fix-YUY2-import-error-when-up.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0038-glupload-need-upload-each-plane-to-singl.patch
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-mpegtsmux-Need-get-pid-when-create-streams.patch new file +44 -0
@@ -0,0 +1,44 @@ +From 0d97f9e8693a498d10ea9ad68caa4f6305c1114e Mon Sep 17 00:00:00 2001 +From: Song Bing <[email protected]> +Date: Wed, 22 Apr 2015 18:06:35 +0800 +Subject: [PATCH 01/26] mpegtsmux: Need get pid when create streams. + +when camerabin use mpegtsmux as muxer, start video recording and then +stop video recording and then start video recording, mpegtsmux get wrong +pid. + +Upstream-Status: Pending [https://bugzilla.gnome.org/show_bug.cgi?id=748288] + +--- + gst/mpegtsmux/mpegtsmux.c | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +diff --git a/gst/mpegtsmux/mpegtsmux.c b/gst/mpegtsmux/mpegtsmux.c +index 67c2b72..cfd7c2a 100644 +--- a/gst/mpegtsmux/mpegtsmux.c ++++ b/gst/mpegtsmux/mpegtsmux.c +@@ -833,6 +833,21 @@ mpegtsmux_create_streams (MpegTsMux * mux) + } else { + ts_data->prog_id = DEFAULT_PROG_ID; + } ++ ++ if (!ts_data->pid) { ++ gint pid = -1; ++ ++ name = GST_PAD_NAME (c_data->pad); ++ if (name != NULL && sscanf (name, "sink_%d", &pid) == 1) { ++ if (tsmux_find_stream (mux->tsmux, pid)) { ++ GST_WARNING_OBJECT (mux, "Duplicate PID"); ++ } ++ } else { ++ pid = tsmux_get_new_pid (mux->tsmux); ++ } ++ ++ ts_data->pid = pid; ++ } + } + + ts_data->prog = +-- +1.9.1 +
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0002-mpegvideoparse-Need-detect-picture-coding-type-when-.patch new file +47 -0
47 lines not on this page · raw message
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0003-modifiy-the-videoparse-rank.patch new file +77 -0
77 lines not on this page · raw message
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0004-glfilter-Lost-frame-rate-info-when-fixate-caps.patch new file +51 -0
51 lines not on this page · raw message
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0005-camerabin-Add-one-property-to-set-sink-element-for-v.patch new file +181 -0
181 lines not on this page · raw message
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0006-Fix-for-gl-plugin-not-built-in-wayland-backend.patch new file +34 -0
@@ -0,0 +1,34 @@ +From 3015f801add8e0d004954d5e76ee9d8dcb6b88f6 Mon Sep 17 00:00:00 2001 +From: Jian <[email protected]> +Date: Fri, 24 Apr 2015 17:12:02 +0800 +Subject: [PATCH 06/26] Fix for gl plugin not built in wayland backend +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Upstream-Status: Inappropriate [i.MX specific] + +Signed-off-by: Jian <[email protected]> + +Conflicts: + configure.ac +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index b0a5b2a..8a05495 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -776,7 +776,7 @@ case $host in + LIBS=$old_LIBS + CFLAGS=$old_CFLAGS + +- PKG_CHECK_MODULES(WAYLAND_EGL, wayland-client >= 1.0 wayland-cursor >= 1.0 wayland-egl >= 9.0, HAVE_WAYLAND_EGL=yes, HAVE_WAYLAND_EGL=no) ++ PKG_CHECK_MODULES(WAYLAND_EGL, wayland-client >= 1.0 wayland-cursor >= 1.0 wayland-egl >= 1.0, HAVE_WAYLAND_EGL=yes, HAVE_WAYLAND_EGL=no) + + # OS X and iOS always have GL available + case $host in +-- +1.9.1 +
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0007-Change-wayland-default-res-to-1024x768.patch new file +41 -0
41 lines not on this page · raw message
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0008-gl-wayland-fix-loop-test-hang-in-glimagesink.patch new file +142 -0
142 lines not on this page · raw message
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0009-Fix-glimagesink-wayland-resize-showed-blurred-screen.patch new file +32 -0
@@ -0,0 +1,32 @@ +From 60647b7ab90b2efdbfb9c342be8acfde94d12fad Mon Sep 17 00:00:00 2001 +From: Haihua Hu <[email protected]> +Date: Tue, 8 Dec 2015 16:06:34 +0800 +Subject: [PATCH 09/26] Fix glimagesink wayland resize showed blurred screen + +For imx, wl_egl_window type is not a wl_proxy object. Can not set +queue to wl_egl_window object. + +Upstream-Status: Inappropriate [i.MX specific] + +Signed-off-by: Haihua Hu <[email protected]> +--- + gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c b/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c +index 326e051..c6a4d19 100644 +--- a/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c ++++ b/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c +@@ -325,9 +325,6 @@ create_surfaces (GstGLWindowWaylandEGL * window_egl) + + window_egl->window.native = + wl_egl_window_create (window_egl->window.surface, width, height); +- if (window_egl->window.surface_queue) +- wl_proxy_set_queue ((struct wl_proxy *) window_egl->window.native, +- window_egl->window.surface_queue); + } + } + +-- +1.9.1 +
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0010-support-video-crop-for-glimagesink.patch new file +151 -0
151 lines not on this page · raw message
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0011-Add-fps-print-in-glimagesink.patch new file +86 -0
86 lines not on this page · raw message
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0012-glcolorconvert-convert-YUV-to-RGB-use-directviv.patch new file +168 -0
168 lines not on this page · raw message
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0013-videocompositor-Remove-output-format-alpha-check.patch new file +35 -0
@@ -0,0 +1,35 @@ +From cd2d0769aaf242ecb24e18b7acc027bfb846b7c8 Mon Sep 17 00:00:00 2001 +From: Song Bing <[email protected]> +Date: Tue, 16 Aug 2016 13:11:57 +0800 +Subject: [PATCH 13/26] videocompositor: Remove output format alpha check + +Remove output format alpha check, or output without alpha will +fail if input has alpha. + +Upstream-Status: Pending + +https://bugzilla.gnome.org/show_bug.cgi?id=769962 +--- + gst-libs/gst/video/gstvideoaggregator.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/gst-libs/gst/video/gstvideoaggregator.c b/gst-libs/gst/video/gstvideoaggregator.c +index 1616b27..a987c15 100644 +--- a/gst-libs/gst/video/gstvideoaggregator.c ++++ b/gst-libs/gst/video/gstvideoaggregator.c +@@ -781,11 +781,9 @@ gst_video_aggregator_update_src_caps (GstVideoAggregator * vagg) + g_return_val_if_fail (finfo != NULL, FALSE); + + if (at_least_one_alpha && !(finfo->flags & GST_VIDEO_FORMAT_FLAG_ALPHA)) { +- GST_ELEMENT_ERROR (vagg, CORE, NEGOTIATION, ++ GST_WARNING_OBJECT (vagg, + ("At least one of the input pads contains alpha, but configured caps don't support alpha."), + ("Either convert your inputs to not contain alpha or add a videoconvert after the aggregator")); +- ret = FALSE; +- goto done; + } + } + +-- +1.9.1 +
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0014-Specific-patches-for-gstplayer-API.patch new file +367 -0
367 lines not on this page · raw message
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0015-gstplayer-Add-gst_player_get_state-API.patch new file +63 -0
63 lines not on this page · raw message
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0016-gstplayer-Add-play-stop-sync-API.patch new file +182 -0
182 lines not on this page · raw message
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0018-Add-imx-physical-memory-allocator.patch new file +443 -0
443 lines not on this page · raw message
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0019-Add-implement-of-interface-get_phys_addr-to-support-.patch new file +48 -0
48 lines not on this page · raw message
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0020-Accelerate-gldownload-with-directviv.patch new file +698 -0
698 lines not on this page · raw message
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0021-ionmemory-dmabuf-memory-allocator-based-on-ion-drive.patch new file +390 -0
110 lines not on this page · raw message
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0022-ionmemory-support-get-phys-memory.patch new file +94 -0
94 lines not on this page · raw message
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0023-glupload-add-crop-meta-support-in-dmafd-uploader.patch new file +52 -0
52 lines not on this page · raw message
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0024-glupload-add-ion-dmabuf-support-in-glupload.patch new file +477 -0
477 lines not on this page · raw message
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0025-Add-ion-dmabuf-support-in-gldownload.patch new file +473 -0
473 lines not on this page · raw message
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0026-glframebuffer-check-frame-buffer-status-need-use-spe.patch new file +132 -0
132 lines not on this page · raw message
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0027-qml-add-EGL-platform-support-for-x11-backend.patch new file +63 -0
63 lines not on this page · raw message
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0028-kmssink-use-control-node-to-setplane-to-.patch new file +108 -0
108 lines not on this page · raw message
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0029-kmssink-support-videooverlay-interface.patch new file +343 -0
343 lines not on this page · raw message
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0030-kmssink-check-scaleable-when-set_caps.patch new file +74 -0
74 lines not on this page · raw message
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0031-glimagesink-fix-segmentation-fault-when-.patch new file +35 -0
Lines of this file are not shown. View the raw message.
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0032-gl-viv-fb-fix-wrong-pos-x-y-calculate-in.patch new file +52 -0
52 lines not on this page · raw message
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0033-gl-viv-fb-transform-screen-coordinate-to.patch new file +52 -0
52 lines not on this page · raw message
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0034-glimagesink-expose-should-do-redisplay-a.patch new file +37 -0
Lines of this file are not shown. View the raw message.
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0035-videoaggregator-passthrough-interlace-mo.patch new file +99 -0
99 lines not on this page · raw message
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0036-glvideomixer-need-update-output-geometry.patch new file +83 -0
83 lines not on this page · raw message
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0037-gleglimage-fix-YUY2-import-error-when-up.patch new file +30 -0
Lines of this file are not shown. View the raw message.
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0038-glupload-need-upload-each-plane-to-singl.patch new file +101 -0
101 lines not on this page · raw message
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.12.%.bbappend +61 -0
61 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.13.6
Part of the diff is not shown here. View the raw message.
Re: [PATCH 5/6] gstreamer1.0-plugins-bad: Add NXP specific patches
same.
Quoted 5,967 lines · Stefan Agner
From: Stefan Agner <[email protected]>
Add NXP specific patches from morty-4.9.51-mx8_beta branch. This allows to use imx-gst1.0-plugin 4.3.1 with gstreamer 1.12.2.
Signed-off-by Stefan Agner <[email protected]>--- ...pegtsmux-Need-get-pid-when-create-streams.patch | 44 ++ ...rse-Need-detect-picture-coding-type-when-.patch | 47 ++ .../0003-modifiy-the-videoparse-rank.patch | 77 +++ ...ter-Lost-frame-rate-info-when-fixate-caps.patch | 51 ++ ...dd-one-property-to-set-sink-element-for-v.patch | 181 ++++++ ...or-gl-plugin-not-built-in-wayland-backend.patch | 34 + ...07-Change-wayland-default-res-to-1024x768.patch | 41 ++ ...wayland-fix-loop-test-hang-in-glimagesink.patch | 142 +++++ ...sink-wayland-resize-showed-blurred-screen.patch | 32 + .../0010-support-video-crop-for-glimagesink.patch | 151 +++++ .../0011-Add-fps-print-in-glimagesink.patch | 86 +++ ...rconvert-convert-YUV-to-RGB-use-directviv.patch | 168 +++++ ...mpositor-Remove-output-format-alpha-check.patch | 35 ++ .../0014-Specific-patches-for-gstplayer-API.patch | 367 +++++++++++ ...15-gstplayer-Add-gst_player_get_state-API.patch | 63 ++ .../0016-gstplayer-Add-play-stop-sync-API.patch | 182 ++++++ .../0018-Add-imx-physical-memory-allocator.patch | 443 +++++++++++++ ...nt-of-interface-get_phys_addr-to-support-.patch | 48 ++ ...0020-Accelerate-gldownload-with-directviv.patch | 698 +++++++++++++++++++++ ...mabuf-memory-allocator-based-on-ion-drive.patch | 390 ++++++++++++ .../0022-ionmemory-support-get-phys-memory.patch | 94 +++ ...d-add-crop-meta-support-in-dmafd-uploader.patch | 52 ++ ...upload-add-ion-dmabuf-support-in-glupload.patch | 477 ++++++++++++++ ...0025-Add-ion-dmabuf-support-in-gldownload.patch | 473 ++++++++++++++ ...er-check-frame-buffer-status-need-use-spe.patch | 132 ++++ ...-add-EGL-platform-support-for-x11-backend.patch | 63 ++ ...-kmssink-use-control-node-to-setplane-to-.patch | 108 ++++ ...29-kmssink-support-videooverlay-interface.patch | 343 ++++++++++ ...030-kmssink-check-scaleable-when-set_caps.patch | 74 +++ ...-glimagesink-fix-segmentation-fault-when-.patch | 35 ++ ...-gl-viv-fb-fix-wrong-pos-x-y-calculate-in.patch | 52 ++ ...-gl-viv-fb-transform-screen-coordinate-to.patch | 52 ++ ...-glimagesink-expose-should-do-redisplay-a.patch | 37 ++ ...-videoaggregator-passthrough-interlace-mo.patch | 99 +++ ...-glvideomixer-need-update-output-geometry.patch | 83 +++ ...-gleglimage-fix-YUY2-import-error-when-up.patch | 30 + ...-glupload-need-upload-each-plane-to-singl.patch | 101 +++ .../gstreamer1.0-plugins-bad_1.12.%.bbappend | 61 ++ 38 files changed, 5646 insertions(+) create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-mpegtsmux-Need-get-pid-when-create-streams.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0002-mpegvideoparse-Need-detect-picture-coding-type-when-.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0003-modifiy-the-videoparse-rank.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0004-glfilter-Lost-frame-rate-info-when-fixate-caps.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0005-camerabin-Add-one-property-to-set-sink-element-for-v.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0006-Fix-for-gl-plugin-not-built-in-wayland-backend.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0007-Change-wayland-default-res-to-1024x768.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0008-gl-wayland-fix-loop-test-hang-in-glimagesink.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0009-Fix-glimagesink-wayland-resize-showed-blurred-screen.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0010-support-video-crop-for-glimagesink.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0011-Add-fps-print-in-glimagesink.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0012-glcolorconvert-convert-YUV-to-RGB-use-directviv.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0013-videocompositor-Remove-output-format-alpha-check.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0014-Specific-patches-for-gstplayer-API.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0015-gstplayer-Add-gst_player_get_state-API.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0016-gstplayer-Add-play-stop-sync-API.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0018-Add-imx-physical-memory-allocator.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0019-Add-implement-of-interface-get_phys_addr-to-support-.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0020-Accelerate-gldownload-with-directviv.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0021-ionmemory-dmabuf-memory-allocator-based-on-ion-drive.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0022-ionmemory-support-get-phys-memory.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0023-glupload-add-crop-meta-support-in-dmafd-uploader.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0024-glupload-add-ion-dmabuf-support-in-glupload.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0025-Add-ion-dmabuf-support-in-gldownload.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0026-glframebuffer-check-frame-buffer-status-need-use-spe.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0027-qml-add-EGL-platform-support-for-x11-backend.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0028-kmssink-use-control-node-to-setplane-to-.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0029-kmssink-support-videooverlay-interface.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0030-kmssink-check-scaleable-when-set_caps.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0031-glimagesink-fix-segmentation-fault-when-.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0032-gl-viv-fb-fix-wrong-pos-x-y-calculate-in.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0033-gl-viv-fb-transform-screen-coordinate-to.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0034-glimagesink-expose-should-do-redisplay-a.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0035-videoaggregator-passthrough-interlace-mo.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0036-glvideomixer-need-update-output-geometry.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0037-gleglimage-fix-YUY2-import-error-when-up.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0038-glupload-need-upload-each-plane-to-singl.patchrecipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-mpegtsmux-Need-get-pid-when-create-streams.patch new file +44
-0@@ -0,0 +1,44 @@ +From 0d97f9e8693a498d10ea9ad68caa4f6305c1114e Mon Sep 17 00:00:00 2001 +From: Song Bing <[email protected]> +Date: Wed, 22 Apr 2015 18:06:35 +0800 +Subject: [PATCH 01/26] mpegtsmux: Need get pid when create streams. + +when camerabin use mpegtsmux as muxer, start video recording and then +stop video recording and then start video recording, mpegtsmux get wrong +pid. + +Upstream-Status: Pending [https://bugzilla.gnome.org/show_bug.cgi?id=748288] + +--- + gst/mpegtsmux/mpegtsmux.c | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) + +diff --git a/gst/mpegtsmux/mpegtsmux.c b/gst/mpegtsmux/mpegtsmux.c +index 67c2b72..cfd7c2a 100644 +--- a/gst/mpegtsmux/mpegtsmux.c ++++ b/gst/mpegtsmux/mpegtsmux.c +@@ -833,6 +833,21 @@ mpegtsmux_create_streams (MpegTsMux * mux) + } else { + ts_data->prog_id = DEFAULT_PROG_ID; + } ++ ++ if (!ts_data->pid) { ++ gint pid = -1; ++ ++ name = GST_PAD_NAME (c_data->pad); ++ if (name != NULL && sscanf (name, "sink_%d", &pid) == 1) { ++ if (tsmux_find_stream (mux->tsmux, pid)) { ++ GST_WARNING_OBJECT (mux, "Duplicate PID"); ++ } ++ } else { ++ pid = tsmux_get_new_pid (mux->tsmux); ++ } ++ ++ ts_data->pid = pid; ++ } + } + + ts_data->prog = +-- +1.9.1 +recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0002-mpegvideoparse-Need-detect-picture-coding-type-when-.patch new file +47
-0@@ -0,0 +1,47 @@ +From b50e0af12b3c045e7587c86829e1a42ba421c3bc Mon Sep 17 00:00:00 2001 +From: Song Bing <[email protected]> +Date: Wed, 20 May 2015 15:15:08 +0800 +Subject: [PATCH 02/26] mpegvideoparse: Need detect picture coding type when + drain +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Need detect picture coding type when drain + +Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=749617] + +--- + gst/videoparsers/gstmpegvideoparse.c | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +diff --git a/gst/videoparsers/gstmpegvideoparse.c b/gst/videoparsers/gstmpegvideoparse.c +index 6896339..769e0fd 100644 +--- a/gst/videoparsers/gstmpegvideoparse.c ++++ b/gst/videoparsers/gstmpegvideoparse.c +@@ -715,6 +715,22 @@ need_more: + if (GST_BASE_PARSE_DRAINING (parse)) { + GST_LOG_OBJECT (mpvparse, "draining, accepting all data"); + off = size; ++ /* decide picture codding type */ ++ if (mpvparse->pic_offset >= 0 && mpvparse->pic_offset < off) { ++ GstMpegVideoPacket header; ++ ++ header.data = map.data; ++ header.type = GST_MPEG_VIDEO_PACKET_PICTURE; ++ header.offset = mpvparse->pic_offset; ++ header.size = map.size - mpvparse->pic_offset; ++ if (gst_mpeg_video_packet_parse_picture_header (&header, &mpvparse->pichdr)) ++ GST_LOG_OBJECT (mpvparse, "picture_coding_type %d (%s), ending" ++ "frame of size %d", mpvparse->pichdr.pic_type, ++ picture_type_name (mpvparse->pichdr.pic_type), off - 4); ++ else ++ GST_LOG_OBJECT (mpvparse, "Couldn't parse picture at offset %d", ++ mpvparse->pic_offset); ++ } + ret = TRUE; + } else { + GST_LOG_OBJECT (mpvparse, "need more data"); +-- +1.9.1 +recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0003-modifiy-the-videoparse-rank.patch new file +77
-0@@ -0,0 +1,77 @@ +From 2c3b12f0bddf4d92cf9fc982197f8e92479f3271 Mon Sep 17 00:00:00 2001 +From: Lyon Wang <[email protected]> +Date: Fri, 29 May 2015 09:54:56 +0800 +Subject: [PATCH 03/26] modifiy the videoparse rank + +- Modify the videparsers rank down to avoid link them in +. h263parse rank down to 63 +. mpegvideoparse rank down to 63 +. mpeg4videpparse rank down to 63 +. pngparse, rank down to 63 +. h265parse rank down to 63 + +Upstream-Status: Inappropriate [i.MX specific] + +Signed-off-by: Lyon Wang <[email protected]> + +[vidoeparse] Roll-back h264parse rank + +Roll back the h264parse rank. +MMFMWK-7012 +For SW video decoder, it only support aligment au, +But in GST1.6, rtph264depay output aligment nal format video. +Need link h264parse to convert it to au alginment, +make the sw decodear work + +Set h265parse to GST_RANK_PRIMARY + 1,(similar reason as 264parse) + +http://sw-jira.freescale.net/browse/MMFMWK-7012 +Upstream Status: [i.MX specific] + +Signed-off-by: Lyon Wang <[email protected]> +--- + gst/videoparsers/plugin.c | 21 +++++++++++++++++++-- + 1 file changed, 19 insertions(+), 2 deletions(-) + +diff --git a/gst/videoparsers/plugin.c b/gst/videoparsers/plugin.c +index 2deddf4..97be33b 100644 +--- a/gst/videoparsers/plugin.c ++++ b/gst/videoparsers/plugin.c +@@ -36,7 +36,7 @@ static gboolean + plugin_init (GstPlugin * plugin) + { + gboolean ret = FALSE; +- ++#if 0 + ret |= gst_element_register (plugin, "h263parse", + GST_RANK_PRIMARY + 1, GST_TYPE_H263_PARSE); + ret |= gst_element_register (plugin, "h264parse", +@@ -55,7 +55,24 @@ plugin_init (GstPlugin * plugin) + GST_RANK_SECONDARY, GST_TYPE_H265_PARSE); + ret |= gst_element_register (plugin, "vc1parse", + GST_RANK_NONE, GST_TYPE_VC1_PARSE); +- ++#else ++ ret |= gst_element_register (plugin, "h263parse", ++ GST_RANK_MARGINAL - 1, GST_TYPE_H263_PARSE); ++ ret |= gst_element_register (plugin, "h264parse", ++ GST_RANK_PRIMARY + 1, GST_TYPE_H264_PARSE); ++ ret |= gst_element_register (plugin, "diracparse", ++ GST_RANK_NONE, GST_TYPE_DIRAC_PARSE); ++ ret |= gst_element_register (plugin, "mpegvideoparse", ++ GST_RANK_MARGINAL - 1, GST_TYPE_MPEGVIDEO_PARSE); ++ ret |= gst_element_register (plugin, "mpeg4videoparse", ++ GST_RANK_MARGINAL -1, GST_TYPE_MPEG4VIDEO_PARSE); ++ ret |= gst_element_register (plugin, "pngparse", ++ GST_RANK_MARGINAL-1, GST_TYPE_PNG_PARSE); ++ ret |= gst_element_register (plugin, "h265parse", ++ GST_RANK_PRIMARY + 1, GST_TYPE_H265_PARSE); ++ ret |= gst_element_register (plugin, "vc1parse", ++ GST_RANK_NONE, GST_TYPE_VC1_PARSE); ++#endif + return ret; + } + +-- +1.9.1 +recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0004-glfilter-Lost-frame-rate-info-when-fixate-caps.patch new file +51
-0@@ -0,0 +1,51 @@ +From 18e6e4edece67383b8424fb4f4dff9d381dbe41f Mon Sep 17 00:00:00 2001 +From: Song Bing <[email protected]> +Date: Mon, 8 Jun 2015 17:06:22 +0800 +Subject: [PATCH 04/26] glfilter: Lost frame rate info when fixate caps +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Lost frame rate info when fixate caps. It will cause +down stream element fail, such avimux. + +Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=750545] + +--- + gst-libs/gst/gl/gstglfilter.c | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +diff --git a/gst-libs/gst/gl/gstglfilter.c b/gst-libs/gst/gl/gstglfilter.c +index e702a1e..2be7eb3 100644 +--- a/gst-libs/gst/gl/gstglfilter.c ++++ b/gst-libs/gst/gl/gstglfilter.c +@@ -237,7 +237,8 @@ gst_gl_filter_fixate_caps (GstBaseTransform * bt, + GstPadDirection direction, GstCaps * caps, GstCaps * othercaps) + { + GstStructure *ins, *outs; +- const GValue *from_par, *to_par; ++ const GValue *from_par, *to_par, *from_fps; ++ gint framerate_num, framerate_den; + GValue fpar = { 0, }, tpar = { + 0,}; + +@@ -250,6 +251,16 @@ gst_gl_filter_fixate_caps (GstBaseTransform * bt, + ins = gst_caps_get_structure (caps, 0); + outs = gst_caps_get_structure (othercaps, 0); + ++ /* replace frame rate */ ++ from_fps = gst_structure_get_value (ins, "framerate"); ++ if (from_fps) { ++ gst_structure_set_value (outs, "framerate", from_fps); ++ } else { ++ if (gst_structure_get_fraction (ins, "framerate", &framerate_num, &framerate_den)) ++ gst_structure_set (outs, "framerate", GST_TYPE_FRACTION, framerate_num, framerate_den, ++ NULL); ++ } ++ + from_par = gst_structure_get_value (ins, "pixel-aspect-ratio"); + to_par = gst_structure_get_value (outs, "pixel-aspect-ratio"); + +-- +1.9.1 +recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0005-camerabin-Add-one-property-to-set-sink-element-for-v.patch new file +181
-0@@ -0,0 +1,181 @@ +From 74ba87e4a54c7f39e8ee58bff16c47f1f0baad14 Mon Sep 17 00:00:00 2001 +From: Song Bing <[email protected]> +Date: Fri, 13 Mar 2015 17:31:29 +0800 +Subject: [PATCH 05/26] camerabin: Add one property to set sink element for + video recording pipeline + +Add one property to set sink element for video recording. Default is +filesink. + +https://bugzilla.gnome.org/show_bug.cgi?id=744508 + +Upstream-Status: Inappropriate [i.MX specific] +--- + gst/camerabin2/gstcamerabin2.c | 73 +++++++++++++++++++++++++++++++++++------- + gst/camerabin2/gstcamerabin2.h | 1 + + 2 files changed, 63 insertions(+), 11 deletions(-) + +diff --git a/gst/camerabin2/gstcamerabin2.c b/gst/camerabin2/gstcamerabin2.c +index 0e4a3c7..6549bcb 100644 +--- a/gst/camerabin2/gstcamerabin2.c ++++ b/gst/camerabin2/gstcamerabin2.c +@@ -203,6 +203,7 @@ enum + PROP_MUTE_AUDIO, + PROP_AUDIO_CAPTURE_SUPPORTED_CAPS, + PROP_AUDIO_CAPTURE_CAPS, ++ PROP_VIDEO_SINK, + PROP_ZOOM, + PROP_MAX_ZOOM, + PROP_IMAGE_ENCODING_PROFILE, +@@ -342,7 +343,7 @@ gst_camera_bin_start_capture (GstCameraBin2 * camerabin) + + /* check that we have a valid location */ + if (camerabin->mode == MODE_VIDEO) { +- if (camerabin->location == NULL) { ++ if (camerabin->location == NULL && !camerabin->user_video_sink) { + GST_ELEMENT_ERROR (camerabin, RESOURCE, OPEN_WRITE, + (_("File location is set to NULL, please set it to a valid filename")), (NULL)); + return; +@@ -477,10 +478,13 @@ gst_camera_bin_src_notify_readyforcapture (GObject * obj, GParamSpec * pspec, + if (camera->mode == MODE_VIDEO) { + /* a video recording is about to start, change the filesink location */ + gst_element_set_state (camera->videosink, GST_STATE_NULL); +- location = g_strdup_printf (camera->location, camera->capture_index); +- GST_DEBUG_OBJECT (camera, "Switching videobin location to %s", location); +- g_object_set (camera->videosink, "location", location, NULL); +- g_free (location); ++ /* shouldn't set location for user_video_sink */ ++ if (!camera->user_video_sink) { ++ location = g_strdup_printf (camera->location, camera->capture_index); ++ GST_DEBUG_OBJECT (camera, "Switching videobin location to %s", location); ++ g_object_set (camera->videosink, "location", location, NULL); ++ g_free (location); ++ } + if (gst_element_set_state (camera->videosink, GST_STATE_PLAYING) == + GST_STATE_CHANGE_FAILURE) { + /* Resets the latest state change return, that would be a failure +@@ -535,6 +539,8 @@ gst_camera_bin_dispose (GObject * object) + + if (camerabin->videosink) + gst_object_unref (camerabin->videosink); ++ if (camerabin->user_video_sink) ++ gst_object_unref (camerabin->user_video_sink); + if (camerabin->video_encodebin) + gst_object_unref (camerabin->video_encodebin); + if (camerabin->videobin_capsfilter) +@@ -655,6 +661,12 @@ gst_camera_bin_class_init (GstCameraBin2Class * klass) + " taken into use on the next null to ready transition", + GST_TYPE_ELEMENT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + ++ g_object_class_install_property (object_class, PROP_VIDEO_SINK, ++ g_param_spec_object ("video-sink", "Video sink", ++ "The video sink element to be used on video recordings. It is only" ++ " taken into use on the next null to ready transition", ++ GST_TYPE_ELEMENT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); ++ + g_object_class_install_property (object_class, PROP_MUTE_AUDIO, + g_param_spec_boolean ("mute", "Mute", + "If the audio recording should be muted. Note that this still " +@@ -1519,13 +1531,30 @@ gst_camera_bin_create_elements (GstCameraBin2 * camera) + g_signal_connect (camera->video_encodebin, "element-added", + (GCallback) encodebin_element_added, camera); + +- camera->videosink = +- gst_element_factory_make ("filesink", "videobin-filesink"); ++ /* check if we need to replace the videosink */ ++ if (camera->videosink) { ++ if (camera->user_video_sink && camera->user_video_sink != camera->videosink) { ++ gst_bin_remove (GST_BIN_CAST (camera), camera->videosink); ++ gst_object_unref (camera->videosink); ++ camera->videosink = NULL; ++ } ++ } ++ + if (!camera->videosink) { +- missing_element_name = "filesink"; +- goto missing_element; ++ if (camera->user_video_sink) { ++ camera->videosink = gst_object_ref (camera->user_video_sink); ++ } else { ++ camera->videosink = ++ gst_element_factory_make ("filesink", "videobin-filesink"); ++ if (!camera->videosink) { ++ missing_element_name = "filesink"; ++ goto missing_element; ++ } ++ g_object_set (camera->videosink, "async", FALSE, NULL); ++ } + } +- g_object_set (camera->videosink, "async", FALSE, NULL); ++ ++ g_assert (camera->videosink != NULL); + + /* audio elements */ + if (!camera->audio_volume) { +@@ -1648,7 +1677,9 @@ gst_camera_bin_create_elements (GstCameraBin2 * camera) + gst_element_set_locked_state (camera->videosink, TRUE); + gst_element_set_locked_state (camera->imagesink, TRUE); + +- g_object_set (camera->videosink, "location", camera->location, NULL); ++ if (!camera->user_video_sink) { ++ g_object_set (camera->videosink, "location", camera->location, NULL); ++ } + g_object_set (camera->imagesink, "location", camera->location, NULL); + } + +@@ -2014,6 +2045,20 @@ gst_camera_bin_set_audio_src (GstCameraBin2 * camera, GstElement * src) + } + + static void ++gst_camera_bin_set_video_sink (GstCameraBin2 * camera, GstElement * sink) ++{ ++ GST_DEBUG_OBJECT (GST_OBJECT (camera), ++ "Setting video sink %" GST_PTR_FORMAT, sink); ++ ++ if (camera->user_video_sink) ++ g_object_unref (camera->user_video_sink); ++ ++ if (sink) ++ g_object_ref (sink); ++ camera->user_video_sink = sink; ++} ++ ++static void + gst_camera_bin_set_camera_src (GstCameraBin2 * camera, GstElement * src) + { + GST_DEBUG_OBJECT (GST_OBJECT (camera), +@@ -2046,6 +2091,9 @@ gst_camera_bin_set_property (GObject * object, guint prop_id, + case PROP_AUDIO_SRC: + gst_camera_bin_set_audio_src (camera, g_value_get_object (value)); + break; ++ case PROP_VIDEO_SINK: ++ gst_camera_bin_set_video_sink (camera, g_value_get_object (value)); ++ break; + case PROP_MUTE_AUDIO: + g_object_set (camera->audio_volume, "mute", g_value_get_boolean (value), + NULL); +@@ -2229,6 +2277,9 @@ gst_camera_bin_get_property (GObject * object, guint prop_id, + case PROP_AUDIO_SRC: + g_value_set_object (value, camera->user_audio_src); + break; ++ case PROP_VIDEO_SINK: ++ g_value_set_object (value, camera->user_video_sink); ++ break; + case PROP_MUTE_AUDIO:{ + gboolean mute; + +diff --git a/gst/camerabin2/gstcamerabin2.h b/gst/camerabin2/gstcamerabin2.h +index ba55a7e..9e090b6 100644 +--- a/gst/camerabin2/gstcamerabin2.h ++++ b/gst/camerabin2/gstcamerabin2.h +@@ -71,6 +71,7 @@ struct _GstCameraBin2 + GstElement *video_encodebin; + gulong video_encodebin_signal_id; + GstElement *videosink; ++ GstElement *user_video_sink; + GstElement *videobin_capsfilter; + + GstElement *viewfinderbin; +-- +1.9.1 +recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0006-Fix-for-gl-plugin-not-built-in-wayland-backend.patch new file +34
-0@@ -0,0 +1,34 @@ +From 3015f801add8e0d004954d5e76ee9d8dcb6b88f6 Mon Sep 17 00:00:00 2001 +From: Jian <[email protected]> +Date: Fri, 24 Apr 2015 17:12:02 +0800 +Subject: [PATCH 06/26] Fix for gl plugin not built in wayland backend +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Upstream-Status: Inappropriate [i.MX specific] + +Signed-off-by: Jian <[email protected]> + +Conflicts: + configure.ac +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index b0a5b2a..8a05495 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -776,7 +776,7 @@ case $host in + LIBS=$old_LIBS + CFLAGS=$old_CFLAGS + +- PKG_CHECK_MODULES(WAYLAND_EGL, wayland-client >= 1.0 wayland-cursor >= 1.0 wayland-egl >= 9.0, HAVE_WAYLAND_EGL=yes, HAVE_WAYLAND_EGL=no) ++ PKG_CHECK_MODULES(WAYLAND_EGL, wayland-client >= 1.0 wayland-cursor >= 1.0 wayland-egl >= 1.0, HAVE_WAYLAND_EGL=yes, HAVE_WAYLAND_EGL=no) + + # OS X and iOS always have GL available + case $host in +-- +1.9.1 +recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0007-Change-wayland-default-res-to-1024x768.patch new file +41
-0@@ -0,0 +1,41 @@ +From 019b7942e2ba756ef65fa7ec3b5bd9ffa310af1e Mon Sep 17 00:00:00 2001 +From: Jian <[email protected]> +Date: Tue, 17 Nov 2015 14:39:07 +0800 +Subject: [PATCH 07/26] Change wayland default res to 1024x768 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Change wayland backend default window resolution +from 320x240 to 1024x768 + +Upstream-Status: Inappropriate [i.MX specific] + +Signed-off-by: Jian <[email protected]> +--- + gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c b/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c +index 933ddfe..1930585 100644 +--- a/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c ++++ b/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c +@@ -305,13 +305,13 @@ create_surfaces (GstGLWindowWaylandEGL * window_egl) + if (window_egl->window.window_width > 0) + width = window_egl->window.window_width; + else +- width = 320; ++ width = 1024; + window_egl->window.window_width = width; + + if (window_egl->window.window_height > 0) + height = window_egl->window.window_height; + else +- height = 240; ++ height = 768; + window_egl->window.window_height = height; + + if (!window_egl->window.native) { +-- +1.9.1 +recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0008-gl-wayland-fix-loop-test-hang-in-glimagesink.patch new file +142
-0@@ -0,0 +1,142 @@ +From 810fb3179c01747534af7f5b566f5e792be50b2b Mon Sep 17 00:00:00 2001 +From: Haihua Hu <[email protected]> +Date: Sun, 6 Dec 2015 14:25:44 +0800 +Subject: [PATCH 08/26] gl/wayland: fix loop test hang in glimagesink + +Root cause: In glimagesink, gl thread will dispatch event queue and window_show() +is called from streaming thread. Gl thread will empty event queue and +potentially cause gst_gl_wl_display_roundtrip_queue() blocking the +streaming thread to wait for an event occur. Actually, no event can occur +becaue the swap_buffer event is queued by streaming thread but it is blocked. + +Solution: Use two event queue, One for surface and another for gl thread + +Upstream-Status: Pending + +bugzilla URL: https://bugzilla.gnome.org/show_bug.cgi?id=758984 + +Signed-off-by: Haihua Hu <[email protected]> +--- + gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c | 33 +++++++++++++++-------- + gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.h | 2 +- + 2 files changed, 23 insertions(+), 12 deletions(-) + +diff --git a/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c b/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c +index 1930585..326e051 100644 +--- a/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c ++++ b/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c +@@ -245,6 +245,10 @@ destroy_surfaces (GstGLWindowWaylandEGL * window_egl) + wl_egl_window_destroy (window_egl->window.native); + window_egl->window.native = NULL; + } ++ if(window_egl->window.surface_queue) { ++ wl_event_queue_destroy (window_egl->window.surface_queue); ++ window_egl->window.surface_queue = NULL; ++ } + } + + static void +@@ -253,13 +257,15 @@ create_surfaces (GstGLWindowWaylandEGL * window_egl) + GstGLDisplayWayland *display = + GST_GL_DISPLAY_WAYLAND (GST_GL_WINDOW (window_egl)->display); + gint width, height; ++ if (!window_egl->window.surface_queue) ++ window_egl->window.surface_queue = wl_display_create_queue (display->display); + + if (!window_egl->window.surface) { + window_egl->window.surface = + wl_compositor_create_surface (display->compositor); +- if (window_egl->window.queue) ++ if (window_egl->window.surface_queue) + wl_proxy_set_queue ((struct wl_proxy *) window_egl->window.surface, +- window_egl->window.queue); ++ window_egl->window.surface_queue); + } + + if (window_egl->window.foreign_surface) { +@@ -275,9 +281,9 @@ create_surfaces (GstGLWindowWaylandEGL * window_egl) + window_egl->window.subsurface = + wl_subcompositor_get_subsurface (display->subcompositor, + window_egl->window.surface, window_egl->window.foreign_surface); +- if (window_egl->window.queue) ++ if (window_egl->window.surface_queue) + wl_proxy_set_queue ((struct wl_proxy *) window_egl->window.subsurface, +- window_egl->window.queue); ++ window_egl->window.surface_queue); + + wl_subsurface_set_position (window_egl->window.subsurface, + window_egl->window.window_x, window_egl->window.window_y); +@@ -289,9 +295,9 @@ create_surfaces (GstGLWindowWaylandEGL * window_egl) + window_egl->window.shell_surface = + wl_shell_get_shell_surface (display->shell, + window_egl->window.surface); +- if (window_egl->window.queue) ++ if (window_egl->window.surface_queue) + wl_proxy_set_queue ((struct wl_proxy *) window_egl->window. +- shell_surface, window_egl->window.queue); ++ shell_surface, window_egl->window.surface_queue); + + wl_shell_surface_add_listener (window_egl->window.shell_surface, + &shell_surface_listener, window_egl); +@@ -319,9 +325,9 @@ create_surfaces (GstGLWindowWaylandEGL * window_egl) + + window_egl->window.native = + wl_egl_window_create (window_egl->window.surface, width, height); +- if (window_egl->window.queue) ++ if (window_egl->window.surface_queue) + wl_proxy_set_queue ((struct wl_proxy *) window_egl->window.native, +- window_egl->window.queue); ++ window_egl->window.surface_queue); + } + } + +@@ -372,6 +378,11 @@ gst_gl_window_wayland_egl_close (GstGLWindow * window) + + destroy_surfaces (window_egl); + ++ if(window_egl->window.wl_queue) { ++ wl_event_queue_destroy (window_egl->window.wl_queue); ++ window_egl->window.wl_queue = NULL; ++ } ++ + g_source_destroy (window_egl->wl_source); + g_source_unref (window_egl->wl_source); + window_egl->wl_source = NULL; +@@ -400,10 +411,10 @@ gst_gl_window_wayland_egl_open (GstGLWindow * window, GError ** error) + return FALSE; + } + +- window_egl->window.queue = wl_display_create_queue (display->display); ++ window_egl->window.wl_queue = wl_display_create_queue (display->display); + + window_egl->wl_source = wayland_event_source_new (display->display, +- window_egl->window.queue); ++ window_egl->window.wl_queue); + + if (!GST_GL_WINDOW_CLASS (parent_class)->open (window, error)) + return FALSE; +@@ -452,7 +463,7 @@ gst_gl_window_wayland_egl_show (GstGLWindow * window) + create_surfaces (window_egl); + + if (gst_gl_wl_display_roundtrip_queue (display_wayland->display, +- window_egl->window.queue) < 0) ++ window_egl->window.surface_queue) < 0) + GST_WARNING_OBJECT (window, "failed a roundtrip"); + } + +diff --git a/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.h b/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.h +index 16a0543..5256728 100644 +--- a/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.h ++++ b/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.h +@@ -63,7 +63,7 @@ struct display { + struct window { + struct display *display; + +- struct wl_event_queue *queue; ++ struct wl_event_queue *wl_queue, *surface_queue; + struct wl_surface *surface; + struct wl_shell_surface *shell_surface; + struct wl_egl_window *native; +-- +1.9.1 +recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0009-Fix-glimagesink-wayland-resize-showed-blurred-screen.patch new file +32
-0@@ -0,0 +1,32 @@ +From 60647b7ab90b2efdbfb9c342be8acfde94d12fad Mon Sep 17 00:00:00 2001 +From: Haihua Hu <[email protected]> +Date: Tue, 8 Dec 2015 16:06:34 +0800 +Subject: [PATCH 09/26] Fix glimagesink wayland resize showed blurred screen + +For imx, wl_egl_window type is not a wl_proxy object. Can not set +queue to wl_egl_window object. + +Upstream-Status: Inappropriate [i.MX specific] + +Signed-off-by: Haihua Hu <[email protected]> +--- + gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c b/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c +index 326e051..c6a4d19 100644 +--- a/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c ++++ b/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c +@@ -325,9 +325,6 @@ create_surfaces (GstGLWindowWaylandEGL * window_egl) + + window_egl->window.native = + wl_egl_window_create (window_egl->window.surface, width, height); +- if (window_egl->window.surface_queue) +- wl_proxy_set_queue ((struct wl_proxy *) window_egl->window.native, +- window_egl->window.surface_queue); + } + } + +-- +1.9.1 +recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0010-support-video-crop-for-glimagesink.patch new file +151
-0@@ -0,0 +1,151 @@ +From a90946b5890892f105bc89161f7c3b7b8f0b7f52 Mon Sep 17 00:00:00 2001 +From: Haihua Hu <[email protected]> +Date: Fri, 13 Nov 2015 10:51:25 +0800 +Subject: [PATCH 10/26] support video crop for glimagesink + +1.Add video crop meta copy in glupload +2.Calculate the new texture coordinate in vertices array and bind to buffer object +3.Make glimagesink only updating vertices array when video crop meta changed + +Upstream-Status: Inappropriate [i.MX specific] + +Signed-off-by: Haihua Hu <[email protected]> +--- + ext/gl/gstglimagesink.c | 58 +++++++++++++++++++++++++++++++++++++++++++++ + ext/gl/gstglimagesink.h | 3 +++ + ext/gl/gstgluploadelement.c | 14 +++++++++-- + 3 files changed, 73 insertions(+), 2 deletions(-) + +diff --git a/ext/gl/gstglimagesink.c b/ext/gl/gstglimagesink.c +index f6a61ac..75d3214 100644 +--- a/ext/gl/gstglimagesink.c ++++ b/ext/gl/gstglimagesink.c +@@ -764,6 +764,8 @@ gst_glimage_sink_init (GstGLImageSink * glimage_sink) + glimage_sink->handle_events = TRUE; + glimage_sink->ignore_alpha = TRUE; + glimage_sink->overlay_compositor = NULL; ++ glimage_sink->cropmeta = NULL; ++ glimage_sink->prev_cropmeta = NULL; + + glimage_sink->mview_output_mode = DEFAULT_MULTIVIEW_MODE; + glimage_sink->mview_output_flags = DEFAULT_MULTIVIEW_FLAGS; +@@ -1253,6 +1255,12 @@ gst_glimage_sink_change_state (GstElement * element, GstStateChange transition) + gst_object_unref (glimage_sink->display); + glimage_sink->display = NULL; + } ++ ++ glimage_sink->cropmeta = NULL; ++ if (glimage_sink->prev_cropmeta) ++ g_slice_free(GstVideoCropMeta, glimage_sink->prev_cropmeta); ++ glimage_sink->prev_cropmeta = NULL; ++ + break; + default: + break; +@@ -1737,6 +1745,8 @@ gst_glimage_sink_show_frame (GstVideoSink * vsink, GstBuffer * buf) + GST_VIDEO_SINK_WIDTH (glimage_sink), + GST_VIDEO_SINK_HEIGHT (glimage_sink)); + ++ glimage_sink->cropmeta = gst_buffer_get_video_crop_meta (buf); ++ + /* Ask the underlying window to redraw its content */ + if (!gst_glimage_sink_redisplay (glimage_sink)) + goto redisplay_failed; +@@ -2222,6 +2232,54 @@ gst_glimage_sink_on_draw (GstGLImageSink * gl_sink) + + gst_gl_shader_use (gl_sink->redisplay_shader); + ++ if (gl_sink->cropmeta) { ++ gint width = GST_VIDEO_SINK_WIDTH (gl_sink); ++ gint height = GST_VIDEO_SINK_HEIGHT (gl_sink); ++ ++ if (!gl_sink->prev_cropmeta){ ++ /* Initialize the previous crop meta and set all memroy to zero */ ++ gl_sink->prev_cropmeta = (GstVideoCropMeta *) g_slice_new0(GstVideoCropMeta); ++ } ++ ++ /* If crop meta not equal to the previous, recalculate the vertices */ ++ if (gl_sink->prev_cropmeta->x != gl_sink->cropmeta->x ++ || gl_sink->prev_cropmeta->y != gl_sink->cropmeta->y ++ || gl_sink->prev_cropmeta->width != gl_sink->cropmeta->width ++ || gl_sink->prev_cropmeta->height != gl_sink->cropmeta->height){ ++ ++ GLfloat crop_vertices[] = { ++ 1.0f, 1.0f, 0.0f, 1.0f, 0.0f, ++ -1.0f, 1.0f, 0.0f, 0.0f, 0.0f, ++ -1.0f, -1.0f, 0.0f, 0.0f, 1.0f, ++ 1.0f, -1.0f, 0.0f, 1.0f, 1.0f ++ }; ++ ++ crop_vertices[8] = (float)(gl_sink->cropmeta->x) / width; ++ crop_vertices[9] = (float)(gl_sink->cropmeta->y) / height; ++ ++ crop_vertices[3] = (float)(gl_sink->cropmeta->width + gl_sink->cropmeta->x) / width; ++ crop_vertices[4] = crop_vertices[9]; ++ ++ crop_vertices[13] = crop_vertices[8]; ++ crop_vertices[14] = (float)(gl_sink->cropmeta->height + gl_sink->cropmeta->y) / height; ++ ++ crop_vertices[18] = crop_vertices[3]; ++ crop_vertices[19] = crop_vertices[14]; ++ ++ gl->BindBuffer (GL_ARRAY_BUFFER, gl_sink->vertex_buffer); ++ gl->BufferData (GL_ARRAY_BUFFER, 4 * 5 * sizeof (GLfloat), crop_vertices, ++ GL_STATIC_DRAW); ++ ++ gl->BindBuffer (GL_ARRAY_BUFFER, 0); ++ ++ /* Store the previous crop meta */ ++ gl_sink->prev_cropmeta->x = gl_sink->cropmeta->x; ++ gl_sink->prev_cropmeta->y = gl_sink->cropmeta->y; ++ gl_sink->prev_cropmeta->width = gl_sink->cropmeta->width; ++ gl_sink->prev_cropmeta->height = gl_sink->cropmeta->height; ++ } ++ } ++ + if (gl->GenVertexArrays) + gl->BindVertexArray (gl_sink->vao); + _bind_buffer (gl_sink); +diff --git a/ext/gl/gstglimagesink.h b/ext/gl/gstglimagesink.h +index 8833103..0723e08 100644 +--- a/ext/gl/gstglimagesink.h ++++ b/ext/gl/gstglimagesink.h +@@ -120,6 +120,9 @@ struct _GstGLImageSink + guint window_width; + guint window_height; + ++ GstVideoCropMeta *cropmeta; ++ GstVideoCropMeta *prev_cropmeta; ++ + GstVideoRectangle display_rect; + + GstGLShader *redisplay_shader; +diff --git a/ext/gl/gstgluploadelement.c b/ext/gl/gstgluploadelement.c +index f9e52f6..52bd76a 100644 +--- a/ext/gl/gstgluploadelement.c ++++ b/ext/gl/gstgluploadelement.c +@@ -256,9 +256,19 @@ gst_gl_upload_element_prepare_output_buffer (GstBaseTransform * bt, + /* basetransform doesn't unref if they're the same */ + if (buffer == *outbuf) + gst_buffer_unref (*outbuf); +- else ++ else { ++ GstVideoCropMeta *incropmeta, *outcropmeta; ++ /* add video crop meta to out buffer if need */ ++ incropmeta = gst_buffer_get_video_crop_meta (buffer); ++ if (incropmeta) { ++ outcropmeta = gst_buffer_add_video_crop_meta (*outbuf); ++ outcropmeta->x = incropmeta->x; ++ outcropmeta->y = incropmeta->y; ++ outcropmeta->width = incropmeta->width; ++ outcropmeta->height = incropmeta->height; ++ } + bclass->copy_metadata (bt, buffer, *outbuf); +- ++ } + return GST_FLOW_OK; + } + +-- +1.9.1 +recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0011-Add-fps-print-in-glimagesink.patch new file +86
-0@@ -0,0 +1,86 @@ +From cbe0f26aef2ab0e8004bdc75fe1e0a053e649642 Mon Sep 17 00:00:00 2001 +From: Haihua Hu <[email protected]> +Date: Wed, 18 Nov 2015 15:10:22 +0800 +Subject: [PATCH 11/26] Add fps print in glimagesink + +In GST-1.6, Pipeline will set start time to 0 when state +change form PAUSE to READY, so get start time in state change +PLAYING_PAUSE. + +Upstream-Status: Inappropriate [i.MX specific] + +Signed-off-by: Haihua Hu <[email protected]> + +Conflicts: + ext/gl/gstglimagesink.h +--- + ext/gl/gstglimagesink.c | 15 +++++++++++++++ + ext/gl/gstglimagesink.h | 4 ++++ + 2 files changed, 19 insertions(+) + +diff --git a/ext/gl/gstglimagesink.c b/ext/gl/gstglimagesink.c +index 75d3214..e697bd0 100644 +--- a/ext/gl/gstglimagesink.c ++++ b/ext/gl/gstglimagesink.c +@@ -766,6 +766,8 @@ gst_glimage_sink_init (GstGLImageSink * glimage_sink) + glimage_sink->overlay_compositor = NULL; + glimage_sink->cropmeta = NULL; + glimage_sink->prev_cropmeta = NULL; ++ glimage_sink->frame_showed = 0; ++ glimage_sink->run_time = 0; + + glimage_sink->mview_output_mode = DEFAULT_MULTIVIEW_MODE; + glimage_sink->mview_output_flags = DEFAULT_MULTIVIEW_FLAGS; +@@ -1169,7 +1171,10 @@ gst_glimage_sink_change_state (GstElement * element, GstStateChange transition) + + switch (transition) { + case GST_STATE_CHANGE_PLAYING_TO_PAUSED: ++ { ++ glimage_sink->run_time = gst_element_get_start_time (GST_ELEMENT (glimage_sink)); + break; ++ } + case GST_STATE_CHANGE_PAUSED_TO_READY: + { + GstBuffer *buf[2]; +@@ -1261,6 +1266,14 @@ gst_glimage_sink_change_state (GstElement * element, GstStateChange transition) + g_slice_free(GstVideoCropMeta, glimage_sink->prev_cropmeta); + glimage_sink->prev_cropmeta = NULL; + ++ if (glimage_sink->run_time > 0) { ++ g_print ("Total showed frames (%lld), playing for (%"GST_TIME_FORMAT"), fps (%.3f).\n", ++ glimage_sink->frame_showed, GST_TIME_ARGS (glimage_sink->run_time), ++ (gfloat)GST_SECOND * glimage_sink->frame_showed / glimage_sink->run_time); ++ } ++ ++ glimage_sink->frame_showed = 0; ++ glimage_sink->run_time = 0; + break; + default: + break; +@@ -1759,6 +1772,8 @@ gst_glimage_sink_show_frame (GstVideoSink * vsink, GstBuffer * buf) + return GST_FLOW_ERROR; + } + ++ glimage_sink->frame_showed++; ++ + return GST_FLOW_OK; + + /* ERRORS */ +diff --git a/ext/gl/gstglimagesink.h b/ext/gl/gstglimagesink.h +index 0723e08..405db44 100644 +--- a/ext/gl/gstglimagesink.h ++++ b/ext/gl/gstglimagesink.h +@@ -143,6 +143,10 @@ struct _GstGLImageSink + GstGLRotateMethod current_rotate_method; + GstGLRotateMethod rotate_method; + const gfloat *transform_matrix; ++ ++ /* fps print support */ ++ guint64 frame_showed; ++ GstClockTime run_time; + }; + + struct _GstGLImageSinkClass +-- +1.9.1 +recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0012-glcolorconvert-convert-YUV-to-RGB-use-directviv.patch new file +168
-0@@ -0,0 +1,168 @@ +From 1808102fb3fce09f8f905364ec62595a48fb0753 Mon Sep 17 00:00:00 2001 +From: Haihua Hu <[email protected]> +Date: Thu, 25 Feb 2016 13:53:20 +0800 +Subject: [PATCH 12/26] glcolorconvert: convert YUV to RGB use directviv + +Add a property "disable_passthrough" in glcolorconvert for enable/disable passthrough. +When need convert YUV to RGB with directviv, set it to be TRUE. + +Upstream-Status: Inappropriate [i.MX specific] + +Signed-off-by: Haihua Hu <[email protected]> + +Conflicts: + gst-libs/gst/gl/gstglcolorconvert.c +--- + ext/gl/gstglcolorconvertelement.c | 70 +++++++++++++++++++++++++++++++++++++ + ext/gl/gstglcolorconvertelement.h | 1 + + gst-libs/gst/gl/gstglcolorconvert.c | 6 +++- + 3 files changed, 76 insertions(+), 1 deletion(-) + +diff --git a/ext/gl/gstglcolorconvertelement.c b/ext/gl/gstglcolorconvertelement.c +index 642b494..5e26f84 100644 +--- a/ext/gl/gstglcolorconvertelement.c ++++ b/ext/gl/gstglcolorconvertelement.c +@@ -35,6 +35,14 @@ G_DEFINE_TYPE_WITH_CODE (GstGLColorConvertElement, gst_gl_color_convert_element, + "glconvertelement", 0, "convert"); + ); + ++enum ++{ ++ GL_COLOR_CONVERT_PROP_0, ++ GL_COLOR_CONVERT_PROP_DISABLE_PASSTHROUGH ++}; ++ ++#define DISABLE_PASSTHROUGH_DAFAULT FALSE ++ + static gboolean gst_gl_color_convert_element_set_caps (GstBaseTransform * bt, + GstCaps * in_caps, GstCaps * out_caps); + static GstCaps *gst_gl_color_convert_element_transform_caps (GstBaseTransform * +@@ -54,6 +62,15 @@ static GstFlowReturn gst_gl_color_convert_element_transform (GstBaseTransform * + static GstCaps *gst_gl_color_convert_element_fixate_caps (GstBaseTransform * + bt, GstPadDirection direction, GstCaps * caps, GstCaps * othercaps); + ++static void gst_gl_color_convert_set_property (GObject *object, ++ guint prop_id, ++ const GValue *value, ++ GParamSpec *pspec); ++static void gst_gl_color_convert_get_property (GObject *object, ++ guint prop_id, ++ GValue *value, ++ GParamSpec *pspec); ++ + static GstStaticPadTemplate gst_gl_color_convert_element_src_pad_template = + GST_STATIC_PAD_TEMPLATE ("src", + GST_PAD_SRC, +@@ -89,6 +106,10 @@ gst_gl_color_convert_element_class_init (GstGLColorConvertElementClass * klass) + { + GstBaseTransformClass *bt_class = GST_BASE_TRANSFORM_CLASS (klass); + GstElementClass *element_class = GST_ELEMENT_CLASS (klass); ++ GObjectClass *object_class = G_OBJECT_CLASS (klass); ++ ++ object_class->set_property = gst_gl_color_convert_set_property; ++ object_class->get_property = gst_gl_color_convert_get_property; + + bt_class->transform_caps = gst_gl_color_convert_element_transform_caps; + bt_class->set_caps = gst_gl_color_convert_element_set_caps; +@@ -108,6 +129,13 @@ gst_gl_color_convert_element_class_init (GstGLColorConvertElementClass * klass) + gst_element_class_add_static_pad_template (element_class, + &gst_gl_color_convert_element_sink_pad_template); + ++ g_object_class_install_property (object_class, GL_COLOR_CONVERT_PROP_DISABLE_PASSTHROUGH, ++ g_param_spec_boolean ("disable_passthrough", ++ "Disable passthrough", ++ "Disable passthrough mode", ++ DISABLE_PASSTHROUGH_DAFAULT, ++ G_PARAM_READWRITE)); ++ + gst_element_class_set_metadata (element_class, + "OpenGL color converter", "Filter/Converter/Video", + "Converts between color spaces using OpenGL shaders", +@@ -119,6 +147,41 @@ gst_gl_color_convert_element_init (GstGLColorConvertElement * convert) + { + gst_base_transform_set_prefer_passthrough (GST_BASE_TRANSFORM (convert), + TRUE); ++ convert->disable_passthrough = FALSE; ++} ++ ++static void ++gst_gl_color_convert_set_property (GObject *object, ++ guint prop_id, ++ const GValue *value, ++ GParamSpec *pspec) ++{ ++ GstGLColorConvertElement *convert = GST_GL_COLOR_CONVERT_ELEMENT (object); ++ switch (prop_id) { ++ case GL_COLOR_CONVERT_PROP_DISABLE_PASSTHROUGH: ++ convert->disable_passthrough = g_value_get_boolean (value); ++ break; ++ default: ++ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); ++ break; ++ } ++} ++ ++static void ++gst_gl_color_convert_get_property (GObject *object, ++ guint prop_id, ++ GValue *value, ++ GParamSpec *pspec) ++{ ++ GstGLColorConvertElement *convert = GST_GL_COLOR_CONVERT_ELEMENT (object); ++ switch (prop_id) { ++ case GL_COLOR_CONVERT_PROP_DISABLE_PASSTHROUGH: ++ g_value_set_boolean (value, convert->disable_passthrough); ++ break; ++ default: ++ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); ++ break; ++ } + } + + static gboolean +@@ -133,6 +196,13 @@ gst_gl_color_convert_element_set_caps (GstBaseTransform * bt, + if (convert->convert) + gst_gl_color_convert_set_caps (convert->convert, in_caps, out_caps); + ++ if(gst_base_transform_is_passthrough (bt) && convert->disable_passthrough){ ++ /* if in passthrough mode and disable_passthrough is set to true, ++ * set passthrough to FALSE*/ ++ GST_DEBUG_OBJECT(convert, "Disable passthrough mode"); ++ gst_base_transform_set_passthrough(bt, FALSE); ++ } ++ + return TRUE; + } + +diff --git a/ext/gl/gstglcolorconvertelement.h b/ext/gl/gstglcolorconvertelement.h +index 2a0dd1d..5cdbd3a 100644 +--- a/ext/gl/gstglcolorconvertelement.h ++++ b/ext/gl/gstglcolorconvertelement.h +@@ -47,6 +47,7 @@ struct _GstGLColorConvertElement + GstGLColorConvert *convert; + GstCaps *in_caps; + GstCaps *out_caps; ++ gboolean disable_passthrough; + }; + + struct _GstGLColorConvertElementClass +diff --git a/gst-libs/gst/gl/gstglcolorconvert.c b/gst-libs/gst/gl/gstglcolorconvert.c +index 89edb16..adf5a6e 100644 +--- a/gst-libs/gst/gl/gstglcolorconvert.c ++++ b/gst-libs/gst/gl/gstglcolorconvert.c +@@ -718,7 +718,11 @@ _gst_gl_color_convert_set_caps_unlocked (GstGLColorConvert * convert, + convert->priv->to_texture_target = to_target; + convert->initted = FALSE; + +- convert->passthrough = passthrough; ++ /* We may disable passthrough via an external property ++ * By the way, when glconvertelement is in passthrough mode, ++ * the plugin will not call gst_gl_color_convert_perform().*/ ++ ++ //convert->passthrough = passthrough; + #ifndef GST_DISABLE_GST_DEBUG + if (G_UNLIKELY (convert->passthrough)) + GST_DEBUG_OBJECT (convert, +-- +1.9.1 +recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0013-videocompositor-Remove-output-format-alpha-check.patch new file +35
-0@@ -0,0 +1,35 @@ +From cd2d0769aaf242ecb24e18b7acc027bfb846b7c8 Mon Sep 17 00:00:00 2001 +From: Song Bing <[email protected]> +Date: Tue, 16 Aug 2016 13:11:57 +0800 +Subject: [PATCH 13/26] videocompositor: Remove output format alpha check + +Remove output format alpha check, or output without alpha will +fail if input has alpha. + +Upstream-Status: Pending + +https://bugzilla.gnome.org/show_bug.cgi?id=769962 +--- + gst-libs/gst/video/gstvideoaggregator.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/gst-libs/gst/video/gstvideoaggregator.c b/gst-libs/gst/video/gstvideoaggregator.c +index 1616b27..a987c15 100644 +--- a/gst-libs/gst/video/gstvideoaggregator.c ++++ b/gst-libs/gst/video/gstvideoaggregator.c +@@ -781,11 +781,9 @@ gst_video_aggregator_update_src_caps (GstVideoAggregator * vagg) + g_return_val_if_fail (finfo != NULL, FALSE); + + if (at_least_one_alpha && !(finfo->flags & GST_VIDEO_FORMAT_FLAG_ALPHA)) { +- GST_ELEMENT_ERROR (vagg, CORE, NEGOTIATION, ++ GST_WARNING_OBJECT (vagg, + ("At least one of the input pads contains alpha, but configured caps don't support alpha."), + ("Either convert your inputs to not contain alpha or add a videoconvert after the aggregator")); +- ret = FALSE; +- goto done; + } + } + +-- +1.9.1 +recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0014-Specific-patches-for-gstplayer-API.patch new file +367
-0@@ -0,0 +1,367 @@ +From e277ba3892378d6562913e2a803f3a126d46c720 Mon Sep 17 00:00:00 2001 +From: Lyon Wang <[email protected]> +Date: Fri, 30 Dec 2016 15:53:21 +0800 +Subject: [PATCH 14/26] Specific patches for gstplayer API + +player: Add get_rotate, set_rotate API + +- Add gstplayer get_rotate() and set_rotate() API + +player: Add force-aspect-ratio config + +- Add get/set force-aspect-ratio config API + +player: Add set audio / text sink API + +- Add get/set audio / text sink API + +Upstream-Status: Inappropriate [i.MX specific] + +Signed-off-by: Lyon Wang <[email protected]> + +Conflicts: + gst-libs/gst/player/gstplayer.c + gst-libs/gst/player/gstplayer.h +--- + gst-libs/gst/player/gstplayer.c | 284 ++++++++++++++++++++++++++++++++++++++++ + gst-libs/gst/player/gstplayer.h | 11 ++ + 2 files changed, 295 insertions(+) + +diff --git a/gst-libs/gst/player/gstplayer.c b/gst-libs/gst/player/gstplayer.c +index 273a480..92ad919 100644 +--- a/gst-libs/gst/player/gstplayer.c ++++ b/gst-libs/gst/player/gstplayer.c +@@ -82,6 +82,7 @@ typedef enum + CONFIG_QUARK_USER_AGENT = 0, + CONFIG_QUARK_POSITION_INTERVAL_UPDATE, + CONFIG_QUARK_ACCURATE_SEEK, ++ CONFIG_QUARK_FORCE_ASPECT_RATIO, + + CONFIG_QUARK_MAX + } ConfigQuarkId; +@@ -90,6 +91,7 @@ static const gchar *_config_quark_strings[] = { + "user-agent", + "position-interval-update", + "accurate-seek", ++ "force-aspect-ratio", + }; + + GQuark _config_quark_table[CONFIG_QUARK_MAX]; +@@ -286,6 +288,7 @@ gst_player_init (GstPlayer * self) + self->config = gst_structure_new_id (QUARK_CONFIG, + CONFIG_QUARK (POSITION_INTERVAL_UPDATE), G_TYPE_UINT, DEFAULT_POSITION_UPDATE_INTERVAL_MS, + CONFIG_QUARK (ACCURATE_SEEK), G_TYPE_BOOLEAN, FALSE, ++ CONFIG_QUARK (FORCE_ASPECT_RATIO), G_TYPE_BOOLEAN, TRUE, + NULL); + /* *INDENT-ON* */ + +@@ -4758,3 +4761,284 @@ gst_player_get_video_snapshot (GstPlayer * self, + + return sample; + } ++ ++/** ++ * gst_player_get_video_sink: ++ * @player: #GstPlayer instance ++ * ++ * Returns: actual video sink element ++ */ ++GstElement * ++gst_player_get_video_sink (GstPlayer * self) ++{ ++ GstElement *sink = NULL; ++ GstElement *actual_sink = NULL; ++ GstIteratorResult rc; ++ GstIterator *it; ++ GValue item = { 0, }; ++ g_return_val_if_fail (GST_IS_PLAYER (self), NULL); ++ ++ g_object_get (G_OBJECT (self->playbin), "video-sink", &sink, NULL); ++ if (NULL == sink) { ++ GST_WARNING_OBJECT (self, "No video-sink found"); ++ return NULL; ++ } ++ it = gst_bin_iterate_sinks ((GstBin *) sink); ++ do { ++ rc = gst_iterator_next (it, &item); ++ if (rc == GST_ITERATOR_OK) { ++ break; ++ } ++ } while (rc != GST_ITERATOR_DONE); ++ ++ g_object_unref (sink); ++ actual_sink = g_value_get_object (&item); ++ g_value_unset (&item); ++ gst_iterator_free (it); ++ ++ if (NULL == actual_sink) { ++ GST_WARNING_OBJECT (self, "No video-sink found"); ++ return NULL; ++ } ++ ++ return actual_sink; ++} ++ ++/** ++ * gst_palyer_set_rotate: ++ * @player: #GstPlayer instance ++ * @rotation: rotation degree value ++ * ++ * Returns: %TRUE or %FALSE ++ * ++ * Set the rotation vaule ++ */ ++gboolean ++gst_player_set_rotate (GstPlayer * self, gint rotation) ++{ ++ GstElement *video_sink = NULL; ++ GObjectClass *gobjclass = NULL; ++ g_return_val_if_fail (GST_IS_PLAYER (self), FALSE); ++ ++ video_sink = gst_player_get_video_sink (self); ++ if (NULL == video_sink) { ++ GST_WARNING_OBJECT (self, " cannot get video sink "); ++ return FALSE; ++ } ++ GST_DEBUG_OBJECT (self, "set rotation degree '%d'", rotation); ++ ++ gobjclass = G_OBJECT_GET_CLASS (G_OBJECT (video_sink)); ++ if (g_object_class_find_property (gobjclass, "rotate") ++ && g_object_class_find_property (gobjclass, "reconfig")) { ++ g_object_set (G_OBJECT (video_sink), "rotate", rotation / 90, NULL); ++ g_object_set (G_OBJECT (video_sink), "reconfig", 1, NULL); ++ } else if (g_object_class_find_property (gobjclass, "rotate-method")) { ++ g_object_set (G_OBJECT (video_sink), "rotate-method", rotation / 90, NULL); ++ } else { ++ GST_INFO_OBJECT (self, "can't set rotation for current video sink %s'", ++ gst_element_get_name (video_sink)); ++ return FALSE; ++ } ++ ++ return TRUE; ++} ++ ++/** ++ * gst_player_get_rotate: ++ * @player: #GstPlayer instance ++ * ++ * Returns: the rotation degree value ++ */ ++gint ++gst_player_get_rotate (GstPlayer * self) ++{ ++ GstElement *video_sink = NULL; ++ GObjectClass *gobjclass = NULL; ++ gint rotation = 0; ++ g_return_val_if_fail (GST_IS_PLAYER (self), 0); ++ ++ video_sink = gst_player_get_video_sink (self); ++ if (NULL == video_sink) { ++ GST_WARNING_OBJECT (self, " cannot get video sink "); ++ return 0; ++ } ++ ++ /* check if the element has "rotate" property */ ++ gobjclass = G_OBJECT_GET_CLASS (video_sink); ++ if (g_object_class_find_property (gobjclass, "rotate")) { ++ g_object_get (G_OBJECT (video_sink), "rotate", &rotation, NULL); ++ rotation = rotation * 90; ++ } else if (g_object_class_find_property (gobjclass, "rotate-method")) { ++ g_object_get (G_OBJECT (video_sink), "rotate-method", &rotation, NULL); ++ rotation = rotation * 90; ++ } ++ ++ GST_DEBUG_OBJECT (self, "get rotation degree '%d'", rotation); ++ ++ return rotation; ++} ++ ++/** ++ * gst_player_config_set_force_aspect_ratio: ++ * @player: #GstPlayer instance ++ * @force_aspect_ratio: keey original aspect ratio or not ++ * ++ * Enable or disable force aspect ratio ++ * force_aspect_ratio seeking is TRUE by default. ++ * ++ * Since: 1.12 ++ */ ++void ++gst_player_config_set_force_aspect_ratio (GstPlayer * self, gboolean force_aspect_ratio) ++{ ++ GstStructure *config = self->config; ++ g_return_if_fail (config != NULL); ++ ++ gst_structure_id_set (config, ++ CONFIG_QUARK (FORCE_ASPECT_RATIO), G_TYPE_BOOLEAN, force_aspect_ratio, NULL); ++ ++ g_object_set(self->playbin, "force-aspect-ratio", force_aspect_ratio, NULL); ++} ++ ++/** ++ * gst_player_config_get_force_aspect_ratio: ++ * @config: a #GstPlayer configuration ++ * ++ * Returns: %TRUE if force-aspect-ratio is enabled ++ * ++ * Since 1.12 ++ */ ++gboolean ++gst_player_config_get_force_aspect_ratio (const GstStructure * config) ++{ ++ gboolean force_aspect_ratio = TRUE; ++ ++ g_return_val_if_fail (config != NULL, FALSE); ++ ++ gst_structure_id_get (config, ++ CONFIG_QUARK (FORCE_ASPECT_RATIO), G_TYPE_BOOLEAN, &force_aspect_ratio, NULL); ++ ++ return force_aspect_ratio; ++} ++ ++/** ++ * gst_player_set_audio_sink: ++ * @player: #GstPlayer instance ++ * @audio_sink: the custom audio sink to set ++ * ++ * Returns: %TRUE or %FALSE ++ * ++ * Set the customize audio sink ++ */ ++gboolean ++gst_player_set_audio_sink (GstPlayer * self, GstElement * audio_sink) ++{ ++ g_return_val_if_fail (GST_IS_PLAYER (self), FALSE); ++ g_return_val_if_fail (audio_sink != NULL, FALSE); ++ ++ g_object_set (G_OBJECT (self->playbin), "audio-sink", audio_sink, NULL); ++ return TRUE; ++} ++ ++/** ++ * gst_player_set_text_sink: ++ * @player: #GstPlayer instance ++ * @text_sink: the custom text sink to set ++ * ++ * Returns: %TRUE or %FALSE ++ * ++ * Set the customize text sink ++ */ ++gboolean ++gst_player_set_text_sink (GstPlayer * self, GstElement * text_sink) ++{ ++ g_return_val_if_fail (GST_IS_PLAYER (self), FALSE); ++ g_return_val_if_fail (text_sink != NULL, FALSE); ++ ++ g_object_set (G_OBJECT (self->playbin), "text-sink", text_sink, NULL); ++ return TRUE; ++} ++ ++/** ++ * gst_player_get_audio_sink: ++ * @player: #GstPlayer instance ++ * ++ * Returns: actual audio sink element ++ */ ++GstElement * ++gst_player_get_audio_sink (GstPlayer * self) ++{ ++ GstElement *sink = NULL; ++ GstElement *actual_sink = NULL; ++ GstIteratorResult rc; ++ GstIterator *it; ++ GValue item = { 0, }; ++ g_return_val_if_fail (GST_IS_PLAYER (self), NULL); ++ ++ g_object_get (G_OBJECT (self->playbin), "audio-sink", &sink, NULL); ++ if (NULL == sink) { ++ GST_WARNING_OBJECT (self, "No audio-sink found"); ++ return NULL; ++ } ++ it = gst_bin_iterate_sinks ((GstBin *) sink); ++ do { ++ rc = gst_iterator_next (it, &item); ++ if (rc == GST_ITERATOR_OK) { ++ break; ++ } ++ } while (rc != GST_ITERATOR_DONE); ++ ++ g_object_unref (sink); ++ actual_sink = g_value_get_object (&item); ++ g_value_unset (&item); ++ gst_iterator_free (it); ++ ++ if (NULL == actual_sink) { ++ GST_WARNING_OBJECT (self, "No auido-sink found"); ++ return NULL; ++ } ++ ++ return actual_sink; ++} ++ ++/** ++ * gst_player_get_text_sink: ++ * @player: #GstPlayer instance ++ * ++ * Returns: actual text sink element ++ */ ++GstElement * ++gst_player_get_text_sink (GstPlayer * self) ++{ ++ GstElement *sink = NULL; ++ GstElement *actual_sink = NULL; ++ GstIteratorResult rc; ++ GstIterator *it; ++ GValue item = { 0, }; ++ g_return_val_if_fail (GST_IS_PLAYER (self), NULL); ++ ++ g_object_get (G_OBJECT (self->playbin), "text-sink", &sink, NULL); ++ if (NULL == sink) { ++ GST_WARNING_OBJECT (self, "No text-sink found"); ++ return NULL; ++ } ++ it = gst_bin_iterate_sinks ((GstBin *) sink); ++ do { ++ rc = gst_iterator_next (it, &item); ++ if (rc == GST_ITERATOR_OK) { ++ break; ++ } ++ } while (rc != GST_ITERATOR_DONE); ++ ++ g_object_unref (sink); ++ actual_sink = g_value_get_object (&item); ++ g_value_unset (&item); ++ gst_iterator_free (it); ++ ++ if (NULL == actual_sink) { ++ GST_WARNING_OBJECT (self, "No text-sink found"); ++ return NULL; ++ } ++ ++ return actual_sink; ++} +diff --git a/gst-libs/gst/player/gstplayer.h b/gst-libs/gst/player/gstplayer.h +index 0338d1a..f444918 100644 +--- a/gst-libs/gst/player/gstplayer.h ++++ b/gst-libs/gst/player/gstplayer.h +@@ -216,6 +216,17 @@ typedef enum + + GstSample * gst_player_get_video_snapshot (GstPlayer * player, + GstPlayerSnapshotFormat format, GstStructure * config); ++/* Custom gstplayer API */ ++gboolean gst_player_set_rotate (GstPlayer * player, gint rotation); ++gint gst_player_get_rotate (GstPlayer * player); ++ ++void gst_player_config_set_force_aspect_ratio (GstPlayer * self, gboolean force_aspect_ratio); ++gboolean gst_player_config_get_force_aspect_ratio (const GstStructure * config); ++ ++gboolean gst_player_set_audio_sink (GstPlayer * player, GstElement * audio_sink); ++gboolean gst_player_set_text_sink (GstPlayer * player, GstElement * text_sink); ++GstElement * gst_player_get_audio_sink (GstPlayer * player); ++GstElement * gst_player_get_text_sink (GstPlayer * player); + + G_END_DECLS + +-- +1.9.1 +recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0015-gstplayer-Add-gst_player_get_state-API.patch new file +63
-0@@ -0,0 +1,63 @@ +From 6e74c8bb4c93f07a83b6e79acfcef467e735abc5 Mon Sep 17 00:00:00 2001 +From: Lyon Wang <[email protected]> +Date: Fri, 17 Feb 2017 17:22:31 +0800 +Subject: [PATCH 15/26] gstplayer: Add gst_player_get_state() API + +- Add gst_player_get_state() API + +https://bugzilla.gnome.org/show_bug.cgi?id=778379 +Upstream-Status: Submitted + +Signed-off-by: Lyon Wang <[email protected]> + +Conflicts: + gst-libs/gst/player/gstplayer.c +--- + gst-libs/gst/player/gstplayer.c | 20 ++++++++++++++++++++ + gst-libs/gst/player/gstplayer.h | 2 ++ + 2 files changed, 22 insertions(+) + +diff --git a/gst-libs/gst/player/gstplayer.c b/gst-libs/gst/player/gstplayer.c +index 92ad919..ebad94e 100644 +--- a/gst-libs/gst/player/gstplayer.c ++++ b/gst-libs/gst/player/gstplayer.c +@@ -5042,3 +5042,23 @@ gst_player_get_text_sink (GstPlayer * self) + + return actual_sink; + } ++ ++/** ++ * gst_player_get_state: ++ * @player: #GstPlayer instance ++ * ++ * Gets internal GstPlayer state. ++ * It's not guaranteed that the state returned is the current state, ++ * it might've changed in the meantime. ++ * ++ * Returns: (transfer none): internal GstPlayerState ++ * ++ * Since 1.12 ++ */ ++GstPlayerState ++gst_player_get_state (GstPlayer * self) ++{ ++ g_return_val_if_fail (GST_IS_PLAYER (self), GST_PLAYER_STATE_STOPPED); ++ ++ return self->app_state; ++} +diff --git a/gst-libs/gst/player/gstplayer.h b/gst-libs/gst/player/gstplayer.h +index f444918..5ee3592 100644 +--- a/gst-libs/gst/player/gstplayer.h ++++ b/gst-libs/gst/player/gstplayer.h +@@ -228,6 +228,8 @@ gboolean gst_player_set_text_sink (GstPlayer * player, GstElement * text_sink + GstElement * gst_player_get_audio_sink (GstPlayer * player); + GstElement * gst_player_get_text_sink (GstPlayer * player); + ++GstPlayerState gst_player_get_state (GstPlayer * player); ++ + G_END_DECLS + + #endif /* __GST_PLAYER_H__ */ +-- +1.9.1 +recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0016-gstplayer-Add-play-stop-sync-API.patch new file +182
-0@@ -0,0 +1,182 @@ +From cbbb524a5e634463965935cf9b6d03ec91804e2d Mon Sep 17 00:00:00 2001 +From: Lyon Wang <[email protected]> +Date: Thu, 16 Feb 2017 18:50:28 +0800 +Subject: [PATCH 16/26] gstplayer: Add play/stop sync API + +- Add play/stop/pause sync API + gst_player_play_sync() + gst_player_stop_sync() + gst_player_pause_sync() + +https://bugzilla.gnome.org/show_bug.cgi?id=778390 + +Upstream-Status: Inappropriate [i.MX specific] + +Signed-off-by: Lyon Wang <[email protected]> + +Conflicts: + gst-libs/gst/player/gstplayer.c +--- + gst-libs/gst/player/gstplayer.c | 112 ++++++++++++++++++++++++++++++++++++++++ + gst-libs/gst/player/gstplayer.h | 4 ++ + 2 files changed, 116 insertions(+) + +diff --git a/gst-libs/gst/player/gstplayer.c b/gst-libs/gst/player/gstplayer.c +index ebad94e..8c94a98 100644 +--- a/gst-libs/gst/player/gstplayer.c ++++ b/gst-libs/gst/player/gstplayer.c +@@ -200,6 +200,10 @@ struct _GstPlayer + gchar *audio_sid; + gchar *subtitle_sid; + gulong stream_notify_id; ++ ++ /* When error occur, will set this flag to TRUE, ++ * so that it could quit for sync play/stop loop */ ++ gboolean got_error; + }; + + struct _GstPlayerClass +@@ -296,6 +300,7 @@ gst_player_init (GstPlayer * self) + self->seek_position = GST_CLOCK_TIME_NONE; + self->last_seek_time = GST_CLOCK_TIME_NONE; + self->inhibit_sigs = FALSE; ++ self->got_error = FALSE; + + GST_TRACE_OBJECT (self, "Initialized"); + } +@@ -1055,6 +1060,8 @@ emit_error (GstPlayer * self, GError * err) + GST_ERROR_OBJECT (self, "Error: %s (%s, %d)", err->message, + g_quark_to_string (err->domain), err->code); + ++ self->got_error = TRUE; ++ + if (g_signal_handler_find (self, G_SIGNAL_MATCH_ID, + signals[SIGNAL_ERROR], 0, NULL, NULL, NULL) != 0) { + ErrorSignalData *data = g_new (ErrorSignalData, 1); +@@ -5062,3 +5069,108 @@ gst_player_get_state (GstPlayer * self) + + return self->app_state; + } ++ ++/** ++ * gst_player_wait_state ++ * @player: #GstPlayer instance ++ * @target_state: target state ++ * @time_out: time out value ++ * negtive (< 0): infinitely waiting for state change. ++ * positive (>0): wait until time out. ++ * zero (0), do not wait for the state change. ++ * ++ * Wait for target state, quit loop when time out ++ */ ++static void ++gst_player_wait_state (GstPlayer * self, GstPlayerState target_state, ++ gint time_out) ++{ ++ gint wait_cnt = 0; ++ ++ while (time_out < 0 || wait_cnt < time_out * 20) { ++ if (self->app_state == target_state) { ++ break; ++ } else if (self->got_error == TRUE) { ++ self->got_error = FALSE; ++ return; ++ } else if (self->is_eos == TRUE) { ++ return; ++ } else { ++ wait_cnt++; ++ usleep (50000); ++ } ++ } ++ if (time_out > 0 && wait_cnt >= time_out * 20) { ++ emit_error (self, g_error_new (GST_PLAYER_ERROR, ++ GST_PLAYER_ERROR_FAILED, ++ "try to play /stop /pause failed, time out")); ++ } ++ ++ return; ++} ++ ++/** ++ * gst_player_play_sync: ++ * @player: #GstPlayer instance ++ * @time_out: time out value ++ * negtive (< 0): infinitely waiting for state change. ++ * positive (>0): wait until time out. ++ * zero (0), do not wait for the state change. ++ * ++ * Request to play the loaded stream in sync mode. ++ */ ++void ++gst_player_play_sync (GstPlayer * self, gint time_out) ++{ ++ g_return_if_fail (GST_IS_PLAYER (self)); ++ ++ gst_player_play (self); ++ ++ gst_player_wait_state (self, GST_PLAYER_STATE_PLAYING, time_out); ++ ++ return; ++} ++ ++/** ++ * gst_player_stop_sync: ++ * @player: #GstPlayer instance ++ * @time_out: time out value ++ * negtive (< 0): infinitely waiting for state change. ++ * positive (>0): wait until time out. ++ * zero (0), do not wait for the state change. ++ * ++ * Stops playing the current stream in sync mode. ++ */ ++void ++gst_player_stop_sync (GstPlayer * self, gint time_out) ++{ ++ g_return_if_fail (GST_IS_PLAYER (self)); ++ ++ gst_player_stop (self); ++ ++ gst_player_wait_state (self, GST_PLAYER_STATE_STOPPED, time_out); ++ ++ return; ++} ++ ++/** ++ * gst_player_pause_sync: ++ * @player: #GstPlayer instance ++ * @time_out: time out value ++ * negtive (< 0): infinitely waiting for state change. ++ * positive (>0): wait until time out. ++ * zero (0), do not wait for the state change. ++ * ++ * Pause current stream in sync mode. ++ */ ++void ++gst_player_pause_sync (GstPlayer * self, gint time_out) ++{ ++ g_return_if_fail (GST_IS_PLAYER (self)); ++ ++ gst_player_pause (self); ++ ++ gst_player_wait_state (self, GST_PLAYER_STATE_PAUSED, time_out); ++ ++ return; ++} +diff --git a/gst-libs/gst/player/gstplayer.h b/gst-libs/gst/player/gstplayer.h +index 5ee3592..ee1a8da 100644 +--- a/gst-libs/gst/player/gstplayer.h ++++ b/gst-libs/gst/player/gstplayer.h +@@ -230,6 +230,10 @@ GstElement * gst_player_get_text_sink (GstPlayer * player); + + GstPlayerState gst_player_get_state (GstPlayer * player); + ++void gst_player_play_sync (GstPlayer * player, gint time_out); ++void gst_player_stop_sync (GstPlayer * player, gint time_out); ++void gst_player_pause_sync (GstPlayer * player, gint time_out); ++ + G_END_DECLS + + #endif /* __GST_PLAYER_H__ */ +-- +1.9.1 +recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0018-Add-imx-physical-memory-allocator.patch new file +443
-0@@ -0,0 +1,443 @@ +From 09c72d6fcdee9b1d529db187047085653d264da4 Mon Sep 17 00:00:00 2001 +From: Haihua Hu <[email protected]> +Date: Thu, 18 May 2017 16:43:40 +0800 +Subject: [PATCH 18/26] Add imx physical memory allocator + +Upstream-Status: Inappropriate [i.MX specific] + +Signed-off-by: Haihua Hu <[email protected]> +--- + gst-libs/gst/allocators/Makefile.am | 6 +- + gst-libs/gst/allocators/badallocators.h | 1 + + gst-libs/gst/allocators/gstallocatorphymem.c | 314 +++++++++++++++++++++++++++ + gst-libs/gst/allocators/gstallocatorphymem.h | 64 ++++++ + 4 files changed, 383 insertions(+), 2 deletions(-) + create mode 100755 gst-libs/gst/allocators/gstallocatorphymem.c + create mode 100755 gst-libs/gst/allocators/gstallocatorphymem.h + +diff --git a/gst-libs/gst/allocators/Makefile.am b/gst-libs/gst/allocators/Makefile.am +index e50d077..46c75c0 100644 +--- a/gst-libs/gst/allocators/Makefile.am ++++ b/gst-libs/gst/allocators/Makefile.am +@@ -4,12 +4,14 @@ libgstbadallocators_@GST_API_VERSION@_includedir = $(includedir)/gstreamer-@GST_ + + libgstbadallocators_@GST_API_VERSION@_include_HEADERS = \ + badallocators.h \ +- gstphysmemory.h ++ gstphysmemory.h \ ++ gstallocatorphymem.h + + noinst_HEADERS = + + libgstbadallocators_@GST_API_VERSION@_la_SOURCES = \ +- gstphysmemory.c ++ gstphysmemory.c \ ++ gstallocatorphymem.c + + libgstbadallocators_@GST_API_VERSION@_la_LIBADD = $(GST_LIBS) $(LIBM) + libgstbadallocators_@GST_API_VERSION@_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS) +diff --git a/gst-libs/gst/allocators/badallocators.h b/gst-libs/gst/allocators/badallocators.h +index 4e18215..2c143f4 100644 +--- a/gst-libs/gst/allocators/badallocators.h ++++ b/gst-libs/gst/allocators/badallocators.h +@@ -23,6 +23,7 @@ + #define __GST_ALLOCATORS_BAD_H__ + + #include <gst/allocators/gstphysmemory.h> ++#include <gst/allocators/gstallocatorphymem.h> + + #endif /* __GST_ALLOCATORS_BAD_H__ */ + +diff --git a/gst-libs/gst/allocators/gstallocatorphymem.c b/gst-libs/gst/allocators/gstallocatorphymem.c +new file mode 100755 +index 0000000..cf5995e +--- /dev/null ++++ b/gst-libs/gst/allocators/gstallocatorphymem.c +@@ -0,0 +1,314 @@ ++/* ++ * Copyright (c) 2013-2015, Freescale Semiconductor, Inc. All rights reserved. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Library General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Library General Public License for more details. ++ * ++ * You should have received a copy of the GNU Library General Public ++ * License along with this library; if not, write to the ++ * Free Software Foundation, Inc., 59 Temple Place - Suite 330, ++ * Boston, MA 02111-1307, USA. ++ */ ++ ++#include <stdio.h> ++#include <string.h> ++#include "gstallocatorphymem.h" ++ ++typedef struct { ++ GstMemory mem; ++ guint8 *vaddr; ++ guint8 *paddr; ++ PhyMemBlock block; ++} GstMemoryPhy; ++ ++static int ++default_copy (GstAllocatorPhyMem *allocator, PhyMemBlock *dst_mem, ++ PhyMemBlock *src_mem, guint offset, guint size) ++{ ++ GST_WARNING ("No default copy implementation for physical memory allocator.\n"); ++ return -1; ++} ++ ++static gpointer ++gst_phymem_map (GstMemory * mem, gsize maxsize, GstMapFlags flags) ++{ ++ GstMemoryPhy *phymem = (GstMemoryPhy*) mem; ++ ++ if (GST_MEMORY_IS_READONLY(mem) && (flags & GST_MAP_WRITE)) { ++ GST_ERROR("memory is read only"); ++ return NULL; ++ } ++ ++ return phymem->vaddr; ++} ++ ++static void ++gst_phymem_unmap (GstMemory * mem) ++{ ++ return; ++} ++ ++static GstMemory * ++gst_phymem_copy (GstMemory * mem, gssize offset, gssize size) ++{ ++ GstAllocatorPhyMemClass *klass; ++ GstMemoryPhy *src_mem = (GstMemoryPhy *)mem; ++ ++ GstMemoryPhy *dst_mem = g_slice_alloc(sizeof(GstMemoryPhy)); ++ if(dst_mem == NULL) { ++ GST_ERROR("Can't allocate for GstMemoryPhy structure.\n"); ++ return NULL; ++ } ++ ++ klass = GST_ALLOCATOR_PHYMEM_CLASS(G_OBJECT_GET_CLASS(mem->allocator)); ++ if(klass == NULL) { ++ GST_ERROR("Can't get class from allocator object.\n"); ++ return NULL; ++ } ++ ++ if(klass->copy_phymem((GstAllocatorPhyMem*)mem->allocator, ++ &dst_mem->block, &src_mem->block, offset, size) < 0) { ++ GST_WARNING ("Copy phymem %d failed.\n", size); ++ return NULL; ++ } ++ ++ GST_DEBUG ("copied phymem, vaddr(%p), paddr(%p), size(%d).\n", ++ dst_mem->block.vaddr, dst_mem->block.paddr, dst_mem->block.size); ++ ++ dst_mem->vaddr = dst_mem->block.vaddr; ++ dst_mem->paddr = dst_mem->block.paddr; ++ ++ gst_memory_init (GST_MEMORY_CAST (dst_mem), ++ mem->mini_object.flags&(~GST_MEMORY_FLAG_READONLY), ++ mem->allocator, NULL, mem->maxsize, mem->align, ++ mem->offset, mem->size); ++ ++ return (GstMemory*)dst_mem; ++} ++ ++static GstMemory * ++gst_phymem_share (GstMemory * mem, gssize offset, gssize size) ++{ ++ GST_ERROR("Not implemented mem_share in gstallocatorphymem.\n"); ++ return NULL; ++} ++ ++static gboolean ++gst_phymem_is_span (GstMemory * mem1, GstMemory * mem2, gsize * offset) ++{ ++ return FALSE; ++} ++ ++static gpointer ++gst_phymem_get_phy (GstMemory * mem) ++{ ++ GstMemoryPhy *phymem = (GstMemoryPhy*) mem; ++ ++ return phymem->paddr; ++} ++ ++static GstMemory * ++base_alloc (GstAllocator * allocator, gsize size, ++ GstAllocationParams * params) ++{ ++ GstAllocatorPhyMemClass *klass; ++ GstMemoryPhy *mem; ++ gsize maxsize, aoffset, offset, align, padding; ++ guint8 *data; ++ ++ mem = g_slice_alloc(sizeof(GstMemoryPhy)); ++ if(mem == NULL) { ++ GST_ERROR("Can allocate for GstMemoryPhy structure.\n"); ++ return NULL; ++ } ++ ++ klass = GST_ALLOCATOR_PHYMEM_CLASS(G_OBJECT_GET_CLASS(allocator)); ++ if(klass == NULL) { ++ GST_ERROR("Can't get class from allocator object.\n"); ++ return NULL; ++ } ++ ++ GST_DEBUG ("allocate params, prefix (%d), padding (%d), align (%d), flags (%x).\n", ++ params->prefix, params->padding, params->align, params->flags); ++ ++ maxsize = size + params->prefix + params->padding; ++ mem->block.size = maxsize; ++ if(klass->alloc_phymem((GstAllocatorPhyMem*)allocator, &mem->block) < 0) { ++ GST_ERROR("Allocate phymem %d failed.\n", maxsize); ++ return NULL; ++ } ++ ++ GST_DEBUG ("allocated phymem, vaddr(%p), paddr(%p), size(%d).\n", ++ mem->block.vaddr, mem->block.paddr, mem->block.size); ++ ++ data = mem->block.vaddr; ++ offset = params->prefix; ++ align = params->align; ++ /* do alignment */ ++ if ((aoffset = ((guintptr)data & align))) { ++ aoffset = (align + 1) - aoffset; ++ data += aoffset; ++ maxsize -= aoffset; ++ } ++ mem->vaddr = mem->block.vaddr + aoffset; ++ mem->paddr = mem->block.paddr + aoffset; ++ ++ GST_DEBUG ("aligned vaddr(%p), paddr(%p), size(%d).\n", ++ mem->block.vaddr, mem->block.paddr, mem->block.size); ++ ++ if (offset && (params->flags & GST_MEMORY_FLAG_ZERO_PREFIXED)) ++ memset (data, 0, offset); ++ ++ padding = maxsize - (offset + size); ++ if (padding && (params->flags & GST_MEMORY_FLAG_ZERO_PADDED)) ++ memset (data + offset + size, 0, padding); ++ ++ gst_memory_init (GST_MEMORY_CAST (mem), params->flags, allocator, NULL, maxsize, align, offset, size); ++ ++ return (GstMemory*)mem; ++} ++ ++static void ++base_free (GstAllocator * allocator, GstMemory * mem) ++{ ++ GstAllocatorPhyMemClass *klass; ++ GstMemoryPhy *phymem; ++ ++ klass = GST_ALLOCATOR_PHYMEM_CLASS(G_OBJECT_GET_CLASS(allocator)); ++ if(klass == NULL) { ++ GST_ERROR("Can't get class from allocator object, can't free %p\n", mem); ++ return; ++ } ++ ++ phymem = (GstMemoryPhy*)mem; ++ ++ GST_DEBUG ("free phymem, vaddr(%p), paddr(%p), size(%d).\n", ++ phymem->block.vaddr, phymem->block.paddr, phymem->block.size); ++ ++ klass->free_phymem((GstAllocatorPhyMem*)allocator, &phymem->block); ++ g_slice_free1(sizeof(GstMemoryPhy), mem); ++ ++ return; ++} ++ ++static int ++default_alloc (GstAllocatorPhyMem *allocator, PhyMemBlock *phy_mem) ++{ ++ GST_ERROR ("No default allocating implementation for physical memory allocation.\n"); ++ return -1; ++} ++ ++static int ++default_free (GstAllocatorPhyMem *allocator, PhyMemBlock *phy_mem) ++{ ++ GST_ERROR ("No default free implementation for physical memory allocation.\n"); ++ return -1; ++} ++ ++G_DEFINE_TYPE (GstAllocatorPhyMem, gst_allocator_phymem, GST_TYPE_ALLOCATOR); ++ ++static void ++gst_allocator_phymem_class_init (GstAllocatorPhyMemClass * klass) ++{ ++ GstAllocatorClass *allocator_class; ++ ++ allocator_class = (GstAllocatorClass *) klass; ++ ++ allocator_class->alloc = base_alloc; ++ allocator_class->free = base_free; ++ klass->alloc_phymem = default_alloc; ++ klass->free_phymem = default_free; ++ klass->copy_phymem = default_copy; ++} ++ ++static void ++gst_allocator_phymem_init (GstAllocatorPhyMem * allocator) ++{ ++ GstAllocator *alloc = GST_ALLOCATOR_CAST (allocator); ++ ++ alloc->mem_map = gst_phymem_map; ++ alloc->mem_unmap = gst_phymem_unmap; ++ alloc->mem_copy = gst_phymem_copy; ++ alloc->mem_share = gst_phymem_share; ++ alloc->mem_is_span = gst_phymem_is_span; ++} ++ ++ ++//global functions ++ ++gboolean ++gst_buffer_is_phymem (GstBuffer *buffer) ++{ ++ gboolean ret = FALSE; ++ PhyMemBlock * memblk; ++ GstMemory *mem = gst_buffer_get_memory (buffer, 0); ++ if(mem == NULL) { ++ GST_ERROR ("Not get memory from buffer.\n"); ++ return FALSE; ++ } ++ ++ if(GST_IS_ALLOCATOR_PHYMEM(mem->allocator)) { ++ if (NULL == ((GstMemoryPhy*)mem)->block.paddr) { ++ GST_WARNING("physical address in memory block is invalid"); ++ ret = FALSE; ++ } else { ++ ret = TRUE; ++ } ++ } ++ ++ gst_memory_unref (mem); ++ ++ return ret; ++} ++ ++PhyMemBlock * ++gst_buffer_query_phymem_block (GstBuffer *buffer) ++{ ++ GstMemory *mem; ++ GstMemoryPhy *memphy; ++ PhyMemBlock *memblk; ++ ++ mem = gst_buffer_get_memory (buffer, 0); ++ if(mem == NULL) { ++ GST_ERROR ("Not get memory from buffer.\n"); ++ return NULL; ++ } ++ ++ if(!GST_IS_ALLOCATOR_PHYMEM(mem->allocator)) { ++ gst_memory_unref (mem); ++ return NULL; ++ } ++ ++ memphy = (GstMemoryPhy*) mem; ++ memblk = &memphy->block; ++ ++ gst_memory_unref (mem); ++ ++ return memblk; ++} ++ ++PhyMemBlock * ++gst_memory_query_phymem_block (GstMemory *mem) ++{ ++ GstMemoryPhy *memphy; ++ PhyMemBlock *memblk; ++ ++ if (!mem) ++ return NULL; ++ ++ if (!GST_IS_ALLOCATOR_PHYMEM(mem->allocator)) ++ return NULL; ++ ++ memphy = (GstMemoryPhy*) mem; ++ memblk = &memphy->block; ++ ++ return memblk; ++} ++ +diff --git a/gst-libs/gst/allocators/gstallocatorphymem.h b/gst-libs/gst/allocators/gstallocatorphymem.h +new file mode 100755 +index 0000000..f0833ae +--- /dev/null ++++ b/gst-libs/gst/allocators/gstallocatorphymem.h +@@ -0,0 +1,64 @@ ++/* ++ * Copyright (c) 2013-2015, Freescale Semiconductor, Inc. All rights reserved. ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Library General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Library General Public License for more details. ++ * ++ * You should have received a copy of the GNU Library General Public ++ * License along with this library; if not, write to the ++ * Free Software Foundation, Inc., 59 Temple Place - Suite 330, ++ * Boston, MA 02111-1307, USA. ++ */ ++ ++#ifndef __ALLOCATOR_PHYMEM_H__ ++#define __ALLOCATOR_PHYMEM_H__ ++ ++#include <gst/gst.h> ++#include <gst/gstallocator.h> ++ ++#define PAGE_ALIGN(x) (((x) + 4095) & ~4095) ++ ++#define GST_TYPE_ALLOCATOR_PHYMEM (gst_allocator_phymem_get_type()) ++#define GST_ALLOCATOR_PHYMEM(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_ALLOCATOR_PHYMEM, GstAllocatorPhyMem)) ++#define GST_ALLOCATOR_PHYMEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_ALLOCATOR_PHYMEM, GstAllocatorPhyMemClass)) ++#define GST_IS_ALLOCATOR_PHYMEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GST_TYPE_ALLOCATOR_PHYMEM)) ++#define GST_IS_ALLOCATOR_PHYMEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), GST_TYPE_ALLOCATOR_PHYMEM)) ++ ++typedef struct _GstAllocatorPhyMem GstAllocatorPhyMem; ++typedef struct _GstAllocatorPhyMemClass GstAllocatorPhyMemClass; ++ ++/* also change gst-libs/gst/gl/gstglvivdirecttexture.c in gst-plugins-bad git ++ * if changed below structure */ ++typedef struct { ++ guint8 *vaddr; ++ guint8 *paddr; ++ guint8 *caddr; ++ gsize size; ++ gpointer *user_data; ++} PhyMemBlock; ++ ++struct _GstAllocatorPhyMem { ++ GstAllocator parent; ++}; ++ ++struct _GstAllocatorPhyMemClass { ++ GstAllocatorClass parent_class; ++ int (*alloc_phymem) (GstAllocatorPhyMem *allocator, PhyMemBlock *phy_mem); ++ int (*free_phymem) (GstAllocatorPhyMem *allocator, PhyMemBlock *phy_mem); ++ int (*copy_phymem) (GstAllocatorPhyMem *allocator, PhyMemBlock *det_mem, ++ PhyMemBlock *src_mem, guint offset, guint size); ++}; ++ ++GType gst_allocator_phymem_get_type (void); ++gboolean gst_buffer_is_phymem (GstBuffer *buffer); ++PhyMemBlock *gst_buffer_query_phymem_block (GstBuffer *buffer); ++PhyMemBlock *gst_memory_query_phymem_block (GstMemory *mem); ++ ++#endif +-- +1.9.1 +recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0019-Add-implement-of-interface-get_phys_addr-to-support-.patch new file +48
-0@@ -0,0 +1,48 @@ +From ccbb5a40d9260e63fbf87c737adb05102c82fbb3 Mon Sep 17 00:00:00 2001 +From: Haihua Hu <[email protected]> +Date: Mon, 22 May 2017 13:38:05 +0800 +Subject: [PATCH 19/26] Add implement of interface "get_phys_addr" to support + directviv upload + +Upstream-Status: Inappropriate [i.MX specific] +--- + gst-libs/gst/allocators/gstallocatorphymem.c | 16 +++++++++++++++- + 1 file changed, 15 insertions(+), 1 deletion(-) + +diff --git a/gst-libs/gst/allocators/gstallocatorphymem.c b/gst-libs/gst/allocators/gstallocatorphymem.c +index cf5995e..d128b83 100755 +--- a/gst-libs/gst/allocators/gstallocatorphymem.c ++++ b/gst-libs/gst/allocators/gstallocatorphymem.c +@@ -20,6 +20,7 @@ + #include <stdio.h> + #include <string.h> + #include "gstallocatorphymem.h" ++#include "gstphysmemory.h" + + typedef struct { + GstMemory mem; +@@ -212,7 +213,20 @@ default_free (GstAllocatorPhyMem *allocator, PhyMemBlock *phy_mem) + return -1; + } + +-G_DEFINE_TYPE (GstAllocatorPhyMem, gst_allocator_phymem, GST_TYPE_ALLOCATOR); ++static guintptr ++gst_allocator_phymem_get_phys_addr (GstPhysMemoryAllocator *allocator, GstMemory *mem) ++{ ++ return gst_phymem_get_phy (mem); ++} ++ ++static void gst_allocator_phymem_iface_init(gpointer g_iface) ++{ ++ GstPhysMemoryAllocatorInterface *iface = g_iface; ++ iface->get_phys_addr = gst_allocator_phymem_get_phys_addr; ++} ++ ++G_DEFINE_TYPE_WITH_CODE (GstAllocatorPhyMem, gst_allocator_phymem, GST_TYPE_ALLOCATOR, ++ G_IMPLEMENT_INTERFACE(GST_TYPE_PHYS_MEMORY_ALLOCATOR, gst_allocator_phymem_iface_init)); + + static void + gst_allocator_phymem_class_init (GstAllocatorPhyMemClass * klass) +-- +1.9.1 +recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0020-Accelerate-gldownload-with-directviv.patch new file +698
-0@@ -0,0 +1,698 @@ +From 80d15dc6e8484bb65cbcc994ab5cae8f4860094d Mon Sep 17 00:00:00 2001 +From: Haihua Hu <[email protected]> +Date: Tue, 16 May 2017 14:20:42 +0800 +Subject: [PATCH] Accelerate gldownload with directviv + +1.Propose a physical buffer pool to upstream in gldownload +2.Bind the physical buffer with texture via dirctviv +3.In gldownload, wrap the physical buffer to gstbuffer, pass to + downstream plugins. +4.Add some configure check for g2d and phymem + +Upstream-Status: Inappropriate [i.MX specific] + +Signed-off-by: Haihua Hu <[email protected]> +--- + configure.ac | 14 ++ + ext/gl/gstgldownloadelement.c | 99 +++++++++++ + gst-libs/gst/gl/Makefile.am | 6 + + gst-libs/gst/gl/gstglbufferpool.c | 21 ++- + gst-libs/gst/gl/gstglphymemory.c | 363 ++++++++++++++++++++++++++++++++++++++ + gst-libs/gst/gl/gstglphymemory.h | 44 +++++ + 6 files changed, 546 insertions(+), 1 deletion(-) + create mode 100644 gst-libs/gst/gl/gstglphymemory.c + create mode 100644 gst-libs/gst/gl/gstglphymemory.h + +diff --git a/configure.ac b/configure.ac +index 8a05495..d7a2a46 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -871,6 +871,17 @@ if test "x$HAVE_VIV_DIRECTVIV" = "xyes"; then + GST_GL_HAVE_VIV_DIRECTVIV=1 + fi + ++dnl check imx6 g2d support ++HAVE_G2D=no ++AC_CHECK_HEADER(g2d.h, HAVE_G2D=yes, HAVE_G2D=no) ++ ++GST_GL_HAVE_PHYMEM=0 ++if test "x$HAVE_G2D" = "xyes" -a "x$HAVE_VIV_DIRECTVIV" = "xyes"; then ++ GST_GL_HAVE_PHYMEM=1 ++else ++ AC_MSG_WARN([Physical memory do not support]) ++fi ++ + dnl check if we can include both GL and GLES2 at the same time + if test "x$HAVE_GL" = "xyes" -a "x$HAVE_GLES2" = "xyes"; then + GLES3_H_DEFINE=0 +@@ -1291,6 +1302,7 @@ GL_CONFIG_DEFINES="$GL_CONFIG_DEFINES + GL_CONFIG_DEFINES="$GL_CONFIG_DEFINES + #define GST_GL_HAVE_DMABUF $GST_GL_HAVE_DMABUF + #define GST_GL_HAVE_VIV_DIRECTVIV $GST_GL_HAVE_VIV_DIRECTVIV ++#define GST_GL_HAVE_PHYMEM $GST_GL_HAVE_PHYMEM + " + + dnl Check for no platforms/window systems +@@ -1326,6 +1338,7 @@ if test "x$GL_APIS" = "x" -o "x$GL_PLATFORMS" = "x" -o "x$GL_WINDOWS" = "x"; the + HAVE_WINDOW_COCOA=no + HAVE_WINDOW_EAGL=no + HAVE_WINDOW_VIV_FB=no ++ HAVE_G2D=no + fi + + AC_SUBST(GL_APIS) +@@ -1345,6 +1358,7 @@ AM_CONDITIONAL(HAVE_WINDOW_WAYLAND, test "x$HAVE_WINDOW_WAYLAND" = "xyes") + AM_CONDITIONAL(HAVE_WINDOW_ANDROID, test "x$HAVE_WINDOW_ANDROID" = "xyes") + AM_CONDITIONAL(HAVE_WINDOW_EAGL, test "x$HAVE_WINDOW_EAGL" = "xyes") + AM_CONDITIONAL(HAVE_WINDOW_VIV_FB, test "x$HAVE_WINDOW_VIV_FB" = "xyes") ++AM_CONDITIONAL(HAVE_GL_PHYMEM, test "x$HAVE_G2D" = "xyes" -a "x$HAVE_VIV_DIRECTVIV" = "xyes") + + AM_CONDITIONAL(USE_OPENGL, test "x$USE_OPENGL" = "xyes") + AM_CONDITIONAL(USE_GLES2, test "x$USE_GLES2" = "xyes") +diff --git a/ext/gl/gstgldownloadelement.c b/ext/gl/gstgldownloadelement.c +index 36821df..03f4479 100644 +--- a/ext/gl/gstgldownloadelement.c ++++ b/ext/gl/gstgldownloadelement.c +@@ -25,6 +25,10 @@ + #include <gst/gl/gl.h> + #include "gstgldownloadelement.h" + ++#if GST_GL_HAVE_PHYMEM ++#include <gst/gl/gstglphymemory.h> ++#endif ++ + GST_DEBUG_CATEGORY_STATIC (gst_gl_download_element_debug); + #define GST_CAT_DEFAULT gst_gl_download_element_debug + +@@ -45,6 +49,8 @@ gst_gl_download_element_prepare_output_buffer (GstBaseTransform * bt, + GstBuffer * buffer, GstBuffer ** outbuf); + static GstFlowReturn gst_gl_download_element_transform (GstBaseTransform * bt, + GstBuffer * buffer, GstBuffer * outbuf); ++static gboolean gst_gl_download_element_propose_allocation (GstBaseTransform * ++ bt, GstQuery * decide_query, GstQuery * query); + + static GstStaticPadTemplate gst_gl_download_element_src_pad_template = + GST_STATIC_PAD_TEMPLATE ("src", +@@ -70,6 +76,7 @@ gst_gl_download_element_class_init (GstGLDownloadElementClass * klass) + bt_class->prepare_output_buffer = + gst_gl_download_element_prepare_output_buffer; + bt_class->transform = gst_gl_download_element_transform; ++ bt_class->propose_allocation = gst_gl_download_element_propose_allocation; + + bt_class->passthrough_on_same_caps = TRUE; + +@@ -160,9 +167,26 @@ static GstFlowReturn + gst_gl_download_element_prepare_output_buffer (GstBaseTransform * bt, + GstBuffer * inbuf, GstBuffer ** outbuf) + { ++ GstGLDownloadElement *download = GST_GL_DOWNLOAD_ELEMENT (bt); + GstCaps *src_caps = gst_pad_get_current_caps (bt->srcpad); + GstCapsFeatures *features = NULL; + gint i, n; ++ GstGLMemory *glmem; ++ ++#if GST_GL_HAVE_PHYMEM ++ glmem = gst_buffer_peek_memory (inbuf, 0); ++ if (gst_is_gl_physical_memory (glmem)) { ++ GstGLContext *context = GST_GL_BASE_FILTER (bt)->context; ++ GstVideoInfo info; ++ ++ gst_video_info_from_caps (&info, src_caps); ++ *outbuf = gst_gl_phymem_buffer_to_gstbuffer (context, &info, inbuf); ++ ++ GST_DEBUG_OBJECT (download, "gl download with direct viv."); ++ ++ return GST_FLOW_OK; ++ } ++#endif /* GST_GL_HAVE_PHYMEM */ + + *outbuf = inbuf; + +@@ -194,3 +218,78 @@ gst_gl_download_element_transform (GstBaseTransform * bt, + { + return GST_FLOW_OK; + } ++ ++static gboolean ++gst_gl_download_element_propose_allocation (GstBaseTransform * bt, ++ GstQuery * decide_query, GstQuery * query) ++{ ++ GstGLContext *context = GST_GL_BASE_FILTER (bt)->context; ++ GstGLDownloadElement *download = GST_GL_DOWNLOAD_ELEMENT (bt); ++ GstAllocationParams params; ++ GstAllocator *allocator = NULL; ++ GstBufferPool *pool = NULL; ++ guint n_pools, i; ++ GstVideoInfo info; ++ GstCaps *caps; ++ GstStructure *config; ++ gsize size; ++ ++ gst_query_parse_allocation (query, &caps, NULL); ++ if (!gst_video_info_from_caps (&info, caps)) { ++ GST_WARNING_OBJECT (bt, "invalid caps specified"); ++ return FALSE; ++ } ++ ++ GST_DEBUG_OBJECT (bt, "video format is %s", gst_video_format_to_string (GST_VIDEO_INFO_FORMAT (&info))); ++ ++ gst_allocation_params_init (¶ms); ++ ++#if GST_GL_HAVE_PHYMEM ++ if (gst_is_gl_physical_memory_supported_fmt (&info)) { ++ allocator = gst_phy_mem_allocator_obtain (); ++ GST_DEBUG_OBJECT (bt, "obtain physical memory allocator %p.", allocator); ++ } ++#endif /* GST_GL_HAVE_PHYMEM */ ++ ++ if (!allocator) ++ allocator = gst_allocator_find (GST_GL_MEMORY_ALLOCATOR_NAME); ++ ++ if (!allocator) { ++ GST_ERROR_OBJECT (bt, "Can't obtain gl memory allocator."); ++ return FALSE; ++ } ++ ++ gst_query_add_allocation_param (query, allocator, ¶ms); ++ gst_object_unref (allocator); ++ ++ n_pools = gst_query_get_n_allocation_pools (query); ++ for (i = 0; i < n_pools; i++) { ++ gst_query_parse_nth_allocation_pool (query, i, &pool, NULL, NULL, NULL); ++ gst_object_unref (pool); ++ pool = NULL; ++ } ++ ++ //new buffer pool ++ pool = gst_gl_buffer_pool_new (context); ++ config = gst_buffer_pool_get_config (pool); ++ ++ /* the normal size of a frame */ ++ size = info.size; ++ gst_buffer_pool_config_set_params (config, caps, size, 0, 0); ++ gst_buffer_pool_config_add_option (config, GST_BUFFER_POOL_OPTION_GL_SYNC_META); ++ ++ if (!gst_buffer_pool_set_config (pool, config)) { ++ gst_object_unref (pool); ++ GST_WARNING_OBJECT (bt, "failed setting config"); ++ return FALSE; ++ } ++ ++ GST_DEBUG_OBJECT (download, "create pool %p", pool); ++ ++ //propose 3 buffers for better performance ++ gst_query_add_allocation_pool (query, pool, size, 3, 0); ++ ++ gst_object_unref (pool); ++ ++ return TRUE; ++} +diff --git a/gst-libs/gst/gl/Makefile.am b/gst-libs/gst/gl/Makefile.am +index 2ae4773..e97a386 100644 +--- a/gst-libs/gst/gl/Makefile.am ++++ b/gst-libs/gst/gl/Makefile.am +@@ -131,6 +131,12 @@ libgstgl_@GST_API_VERSION@_la_LIBADD += egl/libgstgl-egl.la + libgstgl_@GST_API_VERSION@_la_LIBADD += -lgstallocators-$(GST_API_VERSION) + endif + ++if HAVE_GL_PHYMEM ++libgstgl_@GST_API_VERSION@_la_SOURCES += gstglphymemory.c ++libgstgl_@GST_API_VERSION@include_HEADERS += gstglphymemory.h ++libgstgl_@GST_API_VERSION@_la_LIBADD += -lg2d ++endif ++ + configexecincludedir = $(libdir)/gstreamer-@GST_API_VERSION@/include/gst/gl + nodist_configexecinclude_HEADERS = $(built_sys_header_configure) + +diff --git a/gst-libs/gst/gl/gstglbufferpool.c b/gst-libs/gst/gl/gstglbufferpool.c +index e886557..e8bde19 100644 +--- a/gst-libs/gst/gl/gstglbufferpool.c ++++ b/gst-libs/gst/gl/gstglbufferpool.c +@@ -26,6 +26,10 @@ + #include "gstglbufferpool.h" + #include "gstglutils.h" + ++#if GST_GL_HAVE_PHYMEM ++#include <gst/gl/gstglphymemory.h> ++#endif ++ + /** + * SECTION:gstglbufferpool + * @title: GstGlBufferPool +@@ -117,7 +121,11 @@ gst_gl_buffer_pool_set_config (GstBufferPool * pool, GstStructure * config) + gst_object_unref (priv->allocator); + + if (allocator) { +- if (!GST_IS_GL_MEMORY_ALLOCATOR (allocator)) { ++ if (!GST_IS_GL_MEMORY_ALLOCATOR (allocator) ++#if GST_GL_HAVE_PHYMEM ++ && (g_strcmp0 (allocator->mem_type, GST_GL_PHY_MEM_ALLOCATOR) != 0) ++#endif ++ ) { + gst_object_unref (allocator); + goto wrong_allocator; + } else { +@@ -274,10 +282,21 @@ gst_gl_buffer_pool_alloc (GstBufferPool * pool, GstBuffer ** buffer, + goto no_buffer; + } + ++#if GST_GL_HAVE_PHYMEM ++ if ((g_strcmp0 (priv->allocator->mem_type, GST_GL_PHY_MEM_ALLOCATOR) == 0)) { ++ if (!gst_gl_physical_memory_setup_buffer (priv->allocator, buf, priv->gl_params)) { ++ GST_ERROR_OBJECT (pool, "Can't create physcial buffer."); ++ return GST_FLOW_ERROR; ++ } ++ goto done; ++ } ++#endif ++ + alloc = GST_GL_MEMORY_ALLOCATOR (priv->allocator); + if (!gst_gl_memory_setup_buffer (alloc, buf, priv->gl_params, NULL, NULL, 0)) + goto mem_create_failed; + ++done: + if (priv->add_glsyncmeta) + gst_buffer_add_gl_sync_meta (glpool->context, buf); + +diff --git a/gst-libs/gst/gl/gstglphymemory.c b/gst-libs/gst/gl/gstglphymemory.c +new file mode 100644 +index 0000000..11e6c8e +--- /dev/null ++++ b/gst-libs/gst/gl/gstglphymemory.c +@@ -0,0 +1,363 @@ ++/* ++ * GStreamer ++ * Copyright (c) 2015, Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Library General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Library General Public License for more details. ++ * ++ * You should have received a copy of the GNU Library General Public ++ * License along with this library; if not, write to the ++ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, ++ * Boston, MA 02110-1301, USA. ++ */ ++ ++#ifdef HAVE_CONFIG_H ++#include "config.h" ++#endif ++ ++#include "gstglphymemory.h" ++#include <g2d.h> ++ ++GST_DEBUG_CATEGORY_STATIC (GST_CAT_GL_PHY_MEMORY); ++#define GST_CAT_DEFAULT GST_CAT_GL_PHY_MEMORY ++ ++#ifndef GL_BGRA_EXT ++#define GL_BGRA_EXT 0x80E1 ++#endif ++#ifndef GL_VIV_YV12 ++#define GL_VIV_YV12 0x8FC0 ++#endif ++#ifndef GL_VIV_NV12 ++#define GL_VIV_NV12 0x8FC1 ++#endif ++#ifndef GL_VIV_YUY2 ++#define GL_VIV_YUY2 0x8FC2 ++#endif ++#ifndef GL_VIV_UYVY ++#define GL_VIV_UYVY 0x8FC3 ++#endif ++#ifndef GL_VIV_NV21 ++#define GL_VIV_NV21 0x8FC4 ++#endif ++#ifndef GL_VIV_I420 ++#define GL_VIV_I420 0x8FC5 ++#endif ++ ++typedef void (*TexDirectVIVMap) (GLenum Target, GLsizei Width, GLsizei Height, ++ GLenum Format, GLvoid ** Logical, const GLuint * Physical); ++typedef void (*TexDirectInvalidateVIV) (GLenum Target); ++static TexDirectVIVMap pTexDirectVIVMap = NULL; ++static TexDirectInvalidateVIV pTexDirectInvalidateVIV = NULL; ++ ++typedef struct { ++ guint tex_id; ++ guint w; ++ guint h; ++ guint fmt; ++ void *vaddr; ++ guint paddr; ++ gboolean ret; ++}DirectVIVData; ++ ++typedef struct _GstPhyMemAllocator GstPhyMemAllocator; ++typedef struct _GstPhyMemAllocatorClass GstPhyMemAllocatorClass; ++ ++struct _GstPhyMemAllocator ++{ ++ GstAllocatorPhyMem parent; ++}; ++ ++struct _GstPhyMemAllocatorClass ++{ ++ GstAllocatorPhyMemClass parent_class; ++}; ++ ++GType gst_phy_mem_allocator_get_type (void); ++G_DEFINE_TYPE (GstPhyMemAllocator, gst_phy_mem_allocator, GST_TYPE_ALLOCATOR_PHYMEM); ++ ++static int ++alloc_phymem (GstAllocatorPhyMem *allocator, PhyMemBlock *memblk) ++{ ++ struct g2d_buf *pbuf = NULL; ++ ++ memblk->size = PAGE_ALIGN(memblk->size); ++ ++ pbuf = g2d_alloc (memblk->size, 0); ++ if (!pbuf) { ++ GST_ERROR("G2D allocate %u bytes memory failed: %s", ++ memblk->size, strerror(errno)); ++ return -1; ++ } ++ ++ memblk->vaddr = (guchar*) pbuf->buf_vaddr; ++ memblk->paddr = (guchar*) pbuf->buf_paddr; ++ memblk->user_data = (gpointer) pbuf; ++ GST_DEBUG("G2D allocated memory (%p)", memblk->paddr); ++ ++ return 1; ++} ++ ++static int ++free_phymem (GstAllocatorPhyMem *allocator, PhyMemBlock *memblk) ++{ ++ GST_DEBUG("G2D free memory (%p)", memblk->paddr); ++ gint ret = g2d_free ((struct g2d_buf*)(memblk->user_data)); ++ memblk->user_data = NULL; ++ memblk->vaddr = NULL; ++ memblk->paddr = NULL; ++ memblk->size = 0; ++ ++ return ret; ++} ++ ++static void ++gst_phy_mem_allocator_class_init (GstPhyMemAllocatorClass * klass) ++{ ++ GstAllocatorPhyMemClass *phy_allocator_klass = (GstAllocatorPhyMemClass *) klass; ++ ++ phy_allocator_klass->alloc_phymem = alloc_phymem; ++ phy_allocator_klass->free_phymem = free_phymem; ++} ++ ++static void ++gst_phy_mem_allocator_init (GstPhyMemAllocator * allocator) ++{ ++ GstAllocator *alloc = GST_ALLOCATOR_CAST (allocator); ++ ++ alloc->mem_type = GST_GL_PHY_MEM_ALLOCATOR; ++} ++ ++ ++static gpointer ++gst_phy_mem_allocator_init_instance (gpointer data) ++{ ++ GstAllocator *allocator = ++ g_object_new (gst_phy_mem_allocator_get_type (), NULL); ++ ++ GST_DEBUG_CATEGORY_INIT (GST_CAT_GL_PHY_MEMORY, "glphymemory", 0, ++ "GLPhysical Memory"); ++ ++ gst_allocator_register (GST_GL_PHY_MEM_ALLOCATOR, gst_object_ref (allocator)); ++ ++ return allocator; ++} ++ ++static void ++_finish_texture (GstGLContext * ctx, gpointer *data) ++{ ++ GstGLFuncs *gl = ctx->gl_vtable; ++ ++ gl->Finish (); ++} ++ ++static void ++_do_viv_direct_tex_bind_mem(GstGLContext * ctx, DirectVIVData *data) ++{ ++ GstGLFuncs *gl = ctx->gl_vtable; ++ ++ GST_DEBUG ("viv direct bind, tex_id %d, fmt: %d, res: (%dx%d)", data->tex_id, data->fmt, data->w, data->h); ++ GST_DEBUG ("Physical memory buffer, vaddr: %p, paddr: %p", data->vaddr, data->paddr); ++ ++ gl->BindTexture (GL_TEXTURE_2D, data->tex_id); ++ pTexDirectVIVMap (GL_TEXTURE_2D, data->w, data->h, data->fmt, &data->vaddr, &data->paddr); ++ pTexDirectInvalidateVIV (GL_TEXTURE_2D); ++ data->ret = TRUE; ++} ++ ++static GLenum ++_directviv_video_format_to_gl_format (GstVideoFormat format) ++{ ++ switch (format) { ++ case GST_VIDEO_FORMAT_I420: ++ return GL_VIV_I420; ++ case GST_VIDEO_FORMAT_YV12: ++ return GL_VIV_YV12; ++ case GST_VIDEO_FORMAT_NV12: ++ return GL_VIV_NV12; ++ case GST_VIDEO_FORMAT_NV21: ++ return GL_VIV_NV21; ++ case GST_VIDEO_FORMAT_YUY2: ++ return GL_VIV_YUY2; ++ case GST_VIDEO_FORMAT_UYVY: ++ return GL_VIV_UYVY; ++ case GST_VIDEO_FORMAT_RGB16: ++ return GL_RGB565; ++ case GST_VIDEO_FORMAT_RGBA: ++ return GL_RGBA; ++ case GST_VIDEO_FORMAT_BGRA: ++ return GL_BGRA_EXT; ++ case GST_VIDEO_FORMAT_RGBx: ++ return GL_RGBA; ++ case GST_VIDEO_FORMAT_BGRx: ++ return GL_BGRA_EXT; ++ default: ++ return 0; ++ } ++} ++ ++static void ++gst_gl_phy_mem_destroy (GstMemory *mem) ++{ ++ gst_memory_unref (mem); ++} ++ ++ ++GstAllocator * ++gst_phy_mem_allocator_obtain (void) ++{ ++ static GOnce once = G_ONCE_INIT; ++ ++ g_once (&once, gst_phy_mem_allocator_init_instance, NULL); ++ ++ g_return_val_if_fail (once.retval != NULL, NULL); ++ ++ return (GstAllocator *) (g_object_ref (once.retval)); ++} ++ ++gboolean ++gst_is_gl_physical_memory (GstMemory * mem) ++{ ++ GstGLBaseMemory *glmem; ++ g_return_val_if_fail (gst_is_gl_memory (mem), FALSE); ++ ++ glmem = (GstGLBaseMemory*) mem; ++ ++ if (glmem->user_data ++ && GST_IS_MINI_OBJECT_TYPE(glmem->user_data, GST_TYPE_MEMORY)) ++ return gst_memory_is_type ((GstMemory*)glmem->user_data, GST_GL_PHY_MEM_ALLOCATOR); ++ else ++ return FALSE; ++} ++ ++gboolean ++gst_is_gl_physical_memory_supported_fmt (GstVideoInfo * info) ++{ ++ if (GST_VIDEO_INFO_IS_RGB(info) ++ && _directviv_video_format_to_gl_format (GST_VIDEO_INFO_FORMAT (info))) { ++ return TRUE; ++ } ++ else ++ return FALSE; ++} ++ ++gboolean ++gst_gl_physical_memory_setup_buffer (GstAllocator * allocator, GstBuffer *buffer, ++ GstGLVideoAllocationParams * params) ++{ ++ GstGLBaseMemoryAllocator *gl_alloc; ++ GstMemory *mem = NULL; ++ PhyMemBlock *memblk = NULL; ++ GstGLMemory *glmem = NULL; ++ gsize size; ++ ++ GstVideoInfo * info = params->v_info; ++ GstVideoAlignment * valign = params->valign; ++ ++ GST_DEBUG ("glphymemory setup buffer format %s", gst_video_format_to_string (GST_VIDEO_INFO_FORMAT (info))); ++ ++ if (!gst_is_gl_physical_memory_supported_fmt (info)) { ++ GST_DEBUG ("Not support format."); ++ return FALSE; ++ } ++ ++ if(!pTexDirectVIVMap || !pTexDirectInvalidateVIV) { ++ pTexDirectVIVMap = ++ gst_gl_context_get_proc_address (params->parent.context, "glTexDirectVIVMap"); ++ pTexDirectInvalidateVIV = ++ gst_gl_context_get_proc_address (params->parent.context, "glTexDirectInvalidateVIV"); ++ } ++ ++ if(!pTexDirectVIVMap || !pTexDirectInvalidateVIV) { ++ GST_DEBUG ("Load directviv functions failed."); ++ return FALSE; ++ } ++ ++ size = gst_gl_get_plane_data_size (info, valign, 0); ++ mem = gst_allocator_alloc (allocator, size, params->parent.alloc_params); ++ if (!mem) { ++ GST_DEBUG ("Can't allocate physical memory size %d", size); ++ return FALSE; ++ } ++ ++ memblk = gst_memory_query_phymem_block (mem); ++ if (!memblk) { ++ GST_ERROR("Can't find physic memory block."); ++ return FALSE; ++ } ++ ++ gl_alloc = ++ GST_GL_BASE_MEMORY_ALLOCATOR (gst_gl_memory_allocator_get_default ++ (params->parent.context)); ++ ++ params->plane = 0; ++ params->parent.user_data = mem; ++ params->parent.notify = gst_gl_phy_mem_destroy; ++ params->tex_format = ++ gst_gl_format_from_video_info(params->parent.context, info, 0); ++ ++ glmem = (GstGLMemory *)gst_gl_base_memory_alloc (gl_alloc, (GstGLAllocationParams *) params); ++ gst_object_unref (gl_alloc); ++ if (!glmem) { ++ GST_ERROR("Can't get gl memory."); ++ return FALSE; ++ } ++ ++ gst_buffer_append_memory (buffer, (GstMemory *) glmem); ++ ++ gst_buffer_add_video_meta_full (buffer, 0, ++ GST_VIDEO_INFO_FORMAT (info), GST_VIDEO_INFO_WIDTH (info), ++ GST_VIDEO_INFO_HEIGHT (info), 1, info->offset, info->stride); ++ ++ guint viv_fmt = _directviv_video_format_to_gl_format (GST_VIDEO_INFO_FORMAT (info)); ++ ++ DirectVIVData directvivdata = ++ { ++ glmem->tex_id, ++ GST_VIDEO_INFO_WIDTH (info), ++ GST_VIDEO_INFO_HEIGHT (info), ++ viv_fmt, ++ memblk->vaddr, ++ memblk->paddr, ++ FALSE ++ }; ++ ++ gst_gl_context_thread_add (params->parent.context, ++ _do_viv_direct_tex_bind_mem, &directvivdata); ++ ++ return directvivdata.ret; ++} ++ ++GstBuffer * ++gst_gl_phymem_buffer_to_gstbuffer (GstGLContext * ctx, ++ GstVideoInfo * info, GstBuffer *glbuf) ++{ ++ GstBuffer *buf; ++ GstGLBaseMemory *glmem; ++ ++ gst_gl_context_thread_add (ctx, (GstGLContextThreadFunc) _finish_texture, NULL); ++ ++ glmem = gst_buffer_peek_memory (glbuf, 0); ++ ++ buf = gst_buffer_new (); ++ gst_buffer_append_memory (buf, (GstMemory *) glmem->user_data); ++ gst_memory_ref ((GstMemory *)glmem->user_data); ++ ++ gst_buffer_add_video_meta_full (buf, 0, ++ GST_VIDEO_INFO_FORMAT (info), GST_VIDEO_INFO_WIDTH (info), ++ GST_VIDEO_INFO_HEIGHT (info), 1, info->offset, info->stride); ++ GST_BUFFER_FLAGS (buf) = GST_BUFFER_FLAGS (glbuf); ++ GST_BUFFER_PTS (buf) = GST_BUFFER_PTS (glbuf); ++ GST_BUFFER_DTS (buf) = GST_BUFFER_DTS (glbuf); ++ GST_BUFFER_DURATION (buf) = GST_BUFFER_DURATION (glbuf); ++ ++ return buf; ++} ++ +diff --git a/gst-libs/gst/gl/gstglphymemory.h b/gst-libs/gst/gl/gstglphymemory.h +new file mode 100644 +index 0000000..9ebb3ea +--- /dev/null ++++ b/gst-libs/gst/gl/gstglphymemory.h +@@ -0,0 +1,44 @@ ++/* ++ * GStreamer ++ * Copyright (c) 2015, Freescale Semiconductor, Inc. ++ * Copyright 2017 NXP ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Library General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Library General Public License for more details. ++ * ++ * You should have received a copy of the GNU Library General Public ++ * License along with this library; if not, write to the ++ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, ++ * Boston, MA 02110-1301, USA. ++ */ ++ ++#ifndef _GST_GL_PHY_MEMORY_H_ ++#define _GST_GL_PHY_MEMORY_H_ ++ ++#include <gst/gst.h> ++#include <gst/gstmemory.h> ++#include <gst/video/video.h> ++#include <gst/allocators/gstallocatorphymem.h> ++ ++#include <gst/gl/gl.h> ++ ++G_BEGIN_DECLS ++ ++#define GST_GL_PHY_MEM_ALLOCATOR "GLPhyMemory" ++ ++GstAllocator *gst_phy_mem_allocator_obtain (void); ++gboolean gst_is_gl_physical_memory (GstMemory * mem); ++gboolean gst_is_gl_physical_memory_supported_fmt (GstVideoInfo * info); ++gboolean gst_gl_physical_memory_setup_buffer (GstAllocator * allocator, GstBuffer *buffer, GstGLVideoAllocationParams * params); ++GstBuffer * gst_gl_phymem_buffer_to_gstbuffer (GstGLContext * ctx, GstVideoInfo * info, GstBuffer *glbuf); ++ ++G_END_DECLS ++ ++#endif /* _GST_GL_PHY_MEMORY_H_ */ +-- +1.9.1 +recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0021-ionmemory-dmabuf-memory-allocator-based-on-ion-drive.patch new file +390
-0@@ -0,0 +1,390 @@ +From b245b00342439a0fc2b3e7892dceb1f595fbf67e Mon Sep 17 00:00:00 2001 +From: Song Bing <[email protected]> +Date: Tue, 12 Sep 2017 13:42:01 +0800 +Subject: [PATCH 2/3] ionmemory: dmabuf memory allocator based on ion driver. + +Upstream Status: Pending + +https://bugzilla.gnome.org/show_bug.cgi?id=768794 +--- + configure.ac | 6 + + gst-libs/gst/allocators/Makefile.am | 14 ++ + gst-libs/gst/allocators/gstionmemory.c | 241 +++++++++++++++++++++++++++++++++ + gst-libs/gst/allocators/gstionmemory.h | 65 +++++++++ + 4 files changed, 326 insertions(+) + create mode 100755 gst-libs/gst/allocators/gstionmemory.c + create mode 100755 gst-libs/gst/allocators/gstionmemory.h + +diff --git a/configure.ac b/configure.ac +index d17bb64..30acf1c 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -565,6 +565,12 @@ if test "x$HAVE_WINSOCK2_H" = "xyes"; then + AC_SUBST(WINSOCK2_LIBS) + fi + ++dnl check for ion ++translit(dnm, m, l) AM_CONDITIONAL(USE_ION, true) ++AG_GST_CHECK_FEATURE(ION, [ion], ion, [ ++ AC_CHECK_HEADER(linux/ion.h, HAVE_ION="yes", HAVE_ION="no") ++]) ++ + dnl *** opengl *** + AC_ARG_ENABLE([opengl], + [ --enable-opengl Enable Desktop OpenGL support @<:@default=auto@:>@], +diff --git a/gst-libs/gst/allocators/Makefile.am b/gst-libs/gst/allocators/Makefile.am +index 46c75c0..07d86f9 100644 +--- a/gst-libs/gst/allocators/Makefile.am ++++ b/gst-libs/gst/allocators/Makefile.am +@@ -7,16 +7,30 @@ libgstbadallocators_@GST_API_VERSION@_include_HEADERS = \ + gstphysmemory.h \ + gstallocatorphymem.h + ++if USE_ION ++libgstbadallocators_@GST_API_VERSION@_include_HEADERS += \ ++ gstionmemory.h ++endif ++ + noinst_HEADERS = + + libgstbadallocators_@GST_API_VERSION@_la_SOURCES = \ + gstphysmemory.c \ + gstallocatorphymem.c + ++if USE_ION ++libgstbadallocators_@GST_API_VERSION@_la_SOURCES += \ ++ gstionmemory.c ++endif ++ + libgstbadallocators_@GST_API_VERSION@_la_LIBADD = $(GST_LIBS) $(LIBM) + libgstbadallocators_@GST_API_VERSION@_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_CFLAGS) + libgstbadallocators_@GST_API_VERSION@_la_LDFLAGS = $(GST_LIB_LDFLAGS) $(GST_ALL_LDFLAGS) $(GST_LT_LDFLAGS) + ++if USE_ION ++libgstbadallocators_@GST_API_VERSION@_la_LIBADD += -lgstallocators-$(GST_API_VERSION) ++endif ++ + if HAVE_INTROSPECTION + BUILT_GIRSOURCES = GstBadAllocators-@[email protected] + +diff --git a/gst-libs/gst/allocators/gstionmemory.c b/gst-libs/gst/allocators/gstionmemory.c +new file mode 100755 +index 0000000..bfe13ad +--- /dev/null ++++ b/gst-libs/gst/allocators/gstionmemory.c +@@ -0,0 +1,241 @@ ++/* ++ * Copyright (c) 2016, Freescale Semiconductor, Inc. All rights reserved. ++ * Copyright 2017 NXP ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Library General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Library General Public License for more details. ++ * ++ * You should have received a copy of the GNU Library General Public ++ * License along with this library; if not, write to the ++ * Free Software Foundation, Inc., 59 Temple Place - Suite 330, ++ * Boston, MA 02111-1307, USA. ++ */ ++ ++#include <errno.h> ++#include <fcntl.h> ++#include <stdio.h> ++#include <string.h> ++#include <unistd.h> ++#include <sys/ioctl.h> ++#include <sys/mman.h> ++#include <sys/types.h> ++#include <linux/ion.h> ++ ++#include <gst/allocators/gstdmabuf.h> ++#include "gstionmemory.h" ++ ++GST_DEBUG_CATEGORY_STATIC (ion_allocator_debug); ++#define GST_CAT_DEFAULT ion_allocator_debugLines of this file are not shown. View the raw message.
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0022-ionmemory-support-get-phys-memory.patch new file +94
-0Lines of this file are not shown. View the raw message.
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0023-glupload-add-crop-meta-support-in-dmafd-uploader.patch new file +52
-0Lines of this file are not shown. View the raw message.
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0024-glupload-add-ion-dmabuf-support-in-glupload.patch new file +477
-0Lines of this file are not shown. View the raw message.
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0025-Add-ion-dmabuf-support-in-gldownload.patch new file +473
-0Lines of this file are not shown. View the raw message.
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0026-glframebuffer-check-frame-buffer-status-need-use-spe.patch new file +132
-0Lines of this file are not shown. View the raw message.
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0027-qml-add-EGL-platform-support-for-x11-backend.patch new file +63
-0Lines of this file are not shown. View the raw message.
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0028-kmssink-use-control-node-to-setplane-to-.patch new file +108
-0Lines of this file are not shown. View the raw message.
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0029-kmssink-support-videooverlay-interface.patch new file +343
-0Lines of this file are not shown. View the raw message.
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0030-kmssink-check-scaleable-when-set_caps.patch new file +74
-0Lines of this file are not shown. View the raw message.
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0031-glimagesink-fix-segmentation-fault-when-.patch new file +35
-0Lines of this file are not shown. View the raw message.
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0032-gl-viv-fb-fix-wrong-pos-x-y-calculate-in.patch new file +52
-0Lines of this file are not shown. View the raw message.
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0033-gl-viv-fb-transform-screen-coordinate-to.patch new file +52
-0Lines of this file are not shown. View the raw message.
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0034-glimagesink-expose-should-do-redisplay-a.patch new file +37
-0Lines of this file are not shown. View the raw message.
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0035-videoaggregator-passthrough-interlace-mo.patch new file +99
-0Lines of this file are not shown. View the raw message.
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0036-glvideomixer-need-update-output-geometry.patch new file +83
-0Lines of this file are not shown. View the raw message.
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0037-gleglimage-fix-YUY2-import-error-when-up.patch new file +30
-0Lines of this file are not shown. View the raw message.
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0038-glupload-need-upload-each-plane-to-singl.patch new file +101
-0Lines of this file are not shown. View the raw message.
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.12.%.bbappend +61
-1Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
2.13.6
--
_______________________________________________
meta-freescale mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-freescale
Signature · 3 lines
Otavio Salvador O.S. Systems http://www.ossystems.com.br http://code.ossystems.com.br Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750
Part of the diff is not shown here. View the raw message.
PATCH 6/6 gstreamer1.0-libav: Add NXP specific patches
In reply to Stefan AgnerFrom: Stefan Agner <[email protected]>
Add NXP specific patches from morty-4.9.51-mx8_beta branch. This allows to use imx-gst1.0-plugin 4.3.1 with gstreamer 1.12.2.
--- ...tavcodecmap-Do-not-require-a-channel-mask.patch | 46 ++++++++++++++++++++++ .../gstreamer/gstreamer1.0-libav_1.12.%.bbappend | 3 ++ 2 files changed, 49 insertions(+) create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-libav/0002-gstavcodecmap-Do-not-require-a-channel-mask.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-libav_1.12.%.bbappend
recipes-multimedia/gstreamer/gstreamer1.0-libav/0002-gstavcodecmap-Do-not-require-a-channel-mask.patch new file +46 -0
@@ -0,0 +1,46 @@ +From 1553cc0f1843213801767dedb973e30db2d23855 Mon Sep 17 00:00:00 2001 +From: Mathieu Duponchelle <[email protected]> +Date: Thu, 17 Aug 2017 14:28:22 +0200 +Subject: [PATCH] gstavcodecmap: Do not require a channel-mask + +.. for mono or stereo input. + +Upstream-Status: Backport [1.13.1] + +https://bugzilla.gnome.org/show_bug.cgi?id=786401 +--- + ext/libav/gstavcodecmap.c | 17 ++++++++++++----- + 1 file changed, 12 insertions(+), 5 deletions(-) + +diff --git a/ext/libav/gstavcodecmap.c b/ext/libav/gstavcodecmap.c +index 35a2ca0..7033f54 100644 +--- a/ext/libav/gstavcodecmap.c ++++ b/ext/libav/gstavcodecmap.c +@@ -651,12 +651,19 @@ gst_ff_aud_caps_new (AVCodecContext * context, AVCodec * codec, + + if (gst_audio_channel_positions_to_mask (pos, nbits_set, FALSE, + &mask)) { +- GstCaps *tmp = +- gst_caps_new_simple (mimetype, "channel-mask", GST_TYPE_BITMASK, +- mask, +- "channels", G_TYPE_INT, nbits_set, NULL); ++ GstStructure *s = ++ gst_structure_new (mimetype, "channels", G_TYPE_INT, nbits_set, ++ NULL); ++ ++ /* No need to require a channel mask for mono or stereo */ ++ if (!(nbits_set == 1 && pos[0] == GST_AUDIO_CHANNEL_POSITION_MONO) ++ && !(nbits_set == 2 ++ && pos[0] == GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT ++ && pos[1] == GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT)) ++ gst_structure_set (s, "channel-mask", GST_TYPE_BITMASK, mask, ++ NULL); + +- gst_caps_append (caps, tmp); ++ gst_caps_append_structure (caps, s); + } + } + layouts++; +-- +1.9.1 +
recipes-multimedia/gstreamer/gstreamer1.0-libav_1.12.%.bbappend new file +3 -0
@@ -0,0 +1,3 @@ +SRC_URI_append = " \ + file://0002-gstavcodecmap-Do-not-require-a-channel-mask.patch \ +"
Signature · 1 line
2.13.6
Re: [PATCH 6/6] gstreamer1.0-libav: Add NXP specific patches
same.
Quoted 82 lines · Stefan Agner
From: Stefan Agner <[email protected]>
Add NXP specific patches from morty-4.9.51-mx8_beta branch. This allows to use imx-gst1.0-plugin 4.3.1 with gstreamer 1.12.2.
Signed-off-by Stefan Agner <[email protected]>--- ...tavcodecmap-Do-not-require-a-channel-mask.patch | 46 ++++++++++++++++++++++ .../gstreamer/gstreamer1.0-libav_1.12.%.bbappend | 3 ++ 2 files changed, 49 insertions(+) create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-libav/0002-gstavcodecmap-Do-not-require-a-channel-mask.patch create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-libav_1.12.%.bbappendrecipes-multimedia/gstreamer/gstreamer1.0-libav/0002-gstavcodecmap-Do-not-require-a-channel-mask.patch new file +46
-0@@ -0,0 +1,46 @@ +From 1553cc0f1843213801767dedb973e30db2d23855 Mon Sep 17 00:00:00 2001 +From: Mathieu Duponchelle <[email protected]> +Date: Thu, 17 Aug 2017 14:28:22 +0200 +Subject: [PATCH] gstavcodecmap: Do not require a channel-mask + +.. for mono or stereo input. + +Upstream-Status: Backport [1.13.1] + +https://bugzilla.gnome.org/show_bug.cgi?id=786401 +--- + ext/libav/gstavcodecmap.c | 17 ++++++++++++----- + 1 file changed, 12 insertions(+), 5 deletions(-) + +diff --git a/ext/libav/gstavcodecmap.c b/ext/libav/gstavcodecmap.c +index 35a2ca0..7033f54 100644 +--- a/ext/libav/gstavcodecmap.c ++++ b/ext/libav/gstavcodecmap.c +@@ -651,12 +651,19 @@ gst_ff_aud_caps_new (AVCodecContext * context, AVCodec * codec, + + if (gst_audio_channel_positions_to_mask (pos, nbits_set, FALSE, + &mask)) { +- GstCaps *tmp = +- gst_caps_new_simple (mimetype, "channel-mask", GST_TYPE_BITMASK, +- mask, +- "channels", G_TYPE_INT, nbits_set, NULL); ++ GstStructure *s = ++ gst_structure_new (mimetype, "channels", G_TYPE_INT, nbits_set, ++ NULL); ++ ++ /* No need to require a channel mask for mono or stereo */ ++ if (!(nbits_set == 1 && pos[0] == GST_AUDIO_CHANNEL_POSITION_MONO) ++ && !(nbits_set == 2 ++ && pos[0] == GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT ++ && pos[1] == GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT)) ++ gst_structure_set (s, "channel-mask", GST_TYPE_BITMASK, mask, ++ NULL); + +- gst_caps_append (caps, tmp); ++ gst_caps_append_structure (caps, s); + } + } + layouts++; +-- +1.9.1 +recipes-multimedia/gstreamer/gstreamer1.0-libav_1.12.%.bbappend new file +3
-1@@ -0,0 +1,3 @@ +SRC_URI_append = " \ + file://0002-gstavcodecmap-Do-not-require-a-channel-mask.patch \ +" --2.13.6
--
_______________________________________________
meta-freescale mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-freescale
Signature · 3 lines
Otavio Salvador O.S. Systems http://www.ossystems.com.br http://code.ossystems.com.br Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750