From 52a10ff88dbbc6dc020ac0db42d981bb1dffea89 Mon Sep 17 00:00:00 2001 From: Jose Diaz de Grenu Date: Tue, 26 Dec 2017 13:37:30 +0100 Subject: [PATCH] rocko migration: remove duplicated NXP packages All these recipes and patches are now available and maintained in the meta-freescale layer. https://jira.digi.com/browse/DEL-5518 Signed-off-by: Jose Diaz de Grenu --- .../firmware-imx/firmware-imx_6.0.bb | 13 - .../recipes-bsp/imx-vpu/imx-vpu_5.4.37.bb | 21 - .../imx-gpu-g2d/imx-gpu-g2d_6.2.2.p0.bb | 36 - .../imx-gpu-viv/imx-gpu-viv-v6.inc | 327 --- .../imx-gpu-viv_6.2.2.p0-aarch32.bb | 16 - .../recipes-graphics/mesa/mesa_%.bbappend | 26 - ...top-using-Git-to-write-local-version.patch | 87 - .../xf86-video-imxfb-vivante/rc.autohdmi | 42 - .../xf86-video-imxfb-vivante_6.2.2.p0.bb | 24 - .../0001-handle-base-parse-error.patch | 32 - ...st-inspect-Chris-Lord-chris-openedha.patch | 29 - ...et-FLAG_DISCONT-when-push-to-adapter.patch | 30 - ...r-remainning-data-in-pass-through-mo.patch | 50 - ...ould-proceed-non-active-pad-buffer-e.patch | 48 - ...mux-Need-get-pid-when-create-streams.patch | 44 - ...Need-detect-picture-coding-type-when.patch | 45 - ...eed-detect-picture-coding-type-when-.patch | 45 - .../0004-modifiy-the-videoparse-rank.patch | 72 - ...ost-frame-rate-info-when-fixate-caps.patch | 50 - ...o-stitching-support-based-on-Open-CV.patch | 1918 ----------------- ...e-property-to-set-sink-element-for-v.patch | 180 -- ...-plugin-not-built-in-wayland-backend.patch | 29 - ...nd-fix-loop-test-hang-in-glimagesink.patch | 140 -- ...wayland-resize-showed-blurred-screen.patch | 30 - ...1-support-video-crop-for-glimagesink.patch | 149 -- .../0012-Add-fps-print-in-glimagesink.patch | 81 - ...ort-video-rotation-using-transform-m.patch | 570 ----- ...4-ion-DMA-Buf-allocator-based-on-ion.patch | 481 ----- ...rong-attribute-list-type-for-EGL-1.5.patch | 191 -- ...ix-horizontal-vertical-flip-matrizes.patch | 41 - ...magesink-cannot-show-frame-when-conn.patch | 68 - ..._allocator-refine-ion-allocator-code.patch | 369 ---- ...tor-Remove-output-format-alpha-check.patch | 32 - .../gstreamer1.0-plugins-bad_1.8.3.bbappend | 32 - ...make-memory-copy-when-video-buffer-s.patch | 75 - ...t-set-async-of-custom-text-sink-to-f.patch | 31 - ...-to-down-stream-if-all-the-frame-cor.patch | 54 - ...004-handle-audio-video-decoder-error.patch | 62 - ...-print-warning-istead-of-return-ERRO.patch | 43 - ...mization-for-lib-video-in-plugins-ba.patch | 30 - .../gstreamer1.0-plugins-base_1.8.3.bbappend | 12 - ...to-check-if-pa-stream-is-still-valid.patch | 36 - ...02-Fix-aacpase-error-tolerance-issue.patch | 30 - ...dn-t-implement-transform-if-don-t-su.patch | 44 - .../gstreamer1.0-plugins-good_1.8.3.bbappend | 11 - .../gstreamer1.0-rtsp-server_1.8.3.bbappend | 37 - .../gstreamer/gstreamer1.0_1.8.3.bbappend | 11 - .../imx-codec/imx-codec_4.2.1.bb | 11 - .../imx-parser/imx-parser_4.2.1.bb | 11 - 49 files changed, 5846 deletions(-) delete mode 100644 meta-digi-arm/recipes-bsp/firmware-imx/firmware-imx_6.0.bb delete mode 100644 meta-digi-arm/recipes-bsp/imx-vpu/imx-vpu_5.4.37.bb delete mode 100644 meta-digi-dey/recipes-graphics/imx-gpu-g2d/imx-gpu-g2d_6.2.2.p0.bb delete mode 100644 meta-digi-dey/recipes-graphics/imx-gpu-viv/imx-gpu-viv-v6.inc delete mode 100644 meta-digi-dey/recipes-graphics/imx-gpu-viv/imx-gpu-viv_6.2.2.p0-aarch32.bb delete mode 100644 meta-digi-dey/recipes-graphics/mesa/mesa_%.bbappend delete mode 100644 meta-digi-dey/recipes-graphics/xorg-driver/xf86-video-imxfb-vivante/Stop-using-Git-to-write-local-version.patch delete mode 100644 meta-digi-dey/recipes-graphics/xorg-driver/xf86-video-imxfb-vivante/rc.autohdmi delete mode 100644 meta-digi-dey/recipes-graphics/xorg-driver/xf86-video-imxfb-vivante_6.2.2.p0.bb delete mode 100644 meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-1.8.3/0001-handle-base-parse-error.patch delete mode 100644 meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-1.8.3/0002-Fix-crash-with-gst-inspect-Chris-Lord-chris-openedha.patch delete mode 100644 meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-1.8.3/0003-unset-FLAG_DISCONT-when-push-to-adapter.patch delete mode 100644 meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-1.8.3/0004-Need-push-adapter-remainning-data-in-pass-through-mo.patch delete mode 100644 meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-1.8.3/0005-inputselector-should-proceed-non-active-pad-buffer-e.patch delete mode 100644 meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0001-mpegtsmux-Need-get-pid-when-create-streams.patch delete mode 100644 meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0002-mpeg4videoparse-Need-detect-picture-coding-type-when.patch delete mode 100644 meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0003-mpegvideoparse-Need-detect-picture-coding-type-when-.patch delete mode 100644 meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0004-modifiy-the-videoparse-rank.patch delete mode 100644 meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0005-glfilter-Lost-frame-rate-info-when-fixate-caps.patch delete mode 100644 meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0006-opencv-Add-video-stitching-support-based-on-Open-CV.patch delete mode 100644 meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0007-camerabin-Add-one-property-to-set-sink-element-for-v.patch delete mode 100644 meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0008-Fix-for-gl-plugin-not-built-in-wayland-backend.patch delete mode 100644 meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0009-gl-wayland-fix-loop-test-hang-in-glimagesink.patch delete mode 100644 meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0010-Fix-glimagesink-wayland-resize-showed-blurred-screen.patch delete mode 100644 meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0011-support-video-crop-for-glimagesink.patch delete mode 100644 meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0012-Add-fps-print-in-glimagesink.patch delete mode 100644 meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0013-glimagesink-support-video-rotation-using-transform-m.patch delete mode 100644 meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0014-ion-DMA-Buf-allocator-based-on-ion.patch delete mode 100644 meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0015-EGL_DMA_Buf-Wrong-attribute-list-type-for-EGL-1.5.patch delete mode 100644 meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0016-glimagesink-Fix-horizontal-vertical-flip-matrizes.patch delete mode 100644 meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0017-glwindow-Fix-glimagesink-cannot-show-frame-when-conn.patch delete mode 100644 meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0018-ion_allocator-refine-ion-allocator-code.patch delete mode 100644 meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0019-videocompositor-Remove-output-format-alpha-check.patch delete mode 100644 meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.8.3.bbappend delete mode 100644 meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base-1.8.3/0001-basetextoverlay-make-memory-copy-when-video-buffer-s.patch delete mode 100644 meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base-1.8.3/0002-gstplaysink-don-t-set-async-of-custom-text-sink-to-f.patch delete mode 100644 meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base-1.8.3/0003-taglist-not-send-to-down-stream-if-all-the-frame-cor.patch delete mode 100644 meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base-1.8.3/0004-handle-audio-video-decoder-error.patch delete mode 100644 meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base-1.8.3/0005-gstaudiobasesink-print-warning-istead-of-return-ERRO.patch delete mode 100644 meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base-1.8.3/0006-Disable-orc-optimization-for-lib-video-in-plugins-ba.patch delete mode 100644 meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.8.3.bbappend delete mode 100644 meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good-1.8.3/0001-Need-to-check-if-pa-stream-is-still-valid.patch delete mode 100644 meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good-1.8.3/0002-Fix-aacpase-error-tolerance-issue.patch delete mode 100644 meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good-1.8.3/0003-ximageutil-shouldn-t-implement-transform-if-don-t-su.patch delete mode 100644 meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.8.3.bbappend delete mode 100644 meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server_1.8.3.bbappend delete mode 100644 meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0_1.8.3.bbappend delete mode 100644 meta-digi-dey/recipes-multimedia/imx-codec/imx-codec_4.2.1.bb delete mode 100644 meta-digi-dey/recipes-multimedia/imx-parser/imx-parser_4.2.1.bb diff --git a/meta-digi-arm/recipes-bsp/firmware-imx/firmware-imx_6.0.bb b/meta-digi-arm/recipes-bsp/firmware-imx/firmware-imx_6.0.bb deleted file mode 100644 index c924c19ad..000000000 --- a/meta-digi-arm/recipes-bsp/firmware-imx/firmware-imx_6.0.bb +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright (C) 2012-2016 Freescale Semiconductor -# Copyright 2017 NXP - -require recipes-bsp/firmware-imx/firmware-imx.inc -LIC_FILES_CHKSUM = "file://COPYING;md5=6b552f505eedab4a11ab538cf3db743a" - -SRC_URI[md5sum] = "088fb08b565748b537f6481b1ad6c9d7" -SRC_URI[sha256sum] = "9fa7c204a6ff8a30f2b5e8f9002d8c5736791e455dc137b952fa725dc0c3aeb8" - -#BRCM firmware git -SRCREV = "951c1363abe95dd75ab3e9447f640d7807240236" - -COMPATIBLE_MACHINE = "(ccimx6)" diff --git a/meta-digi-arm/recipes-bsp/imx-vpu/imx-vpu_5.4.37.bb b/meta-digi-arm/recipes-bsp/imx-vpu/imx-vpu_5.4.37.bb deleted file mode 100644 index 5cb79ee4d..000000000 --- a/meta-digi-arm/recipes-bsp/imx-vpu/imx-vpu_5.4.37.bb +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright (C) 2013-2016 Freescale Semiconductor -# Copyright 2017 NXP - -require recipes-bsp/imx-vpu/imx-vpu.inc -LIC_FILES_CHKSUM = "file://COPYING;md5=6b552f505eedab4a11ab538cf3db743a" - -PE = "1" - -SRC_URI[md5sum] = "2b8311cb6e5b5813253db706e807d962" -SRC_URI[sha256sum] = "ee265e88d17c7369bd9cb917e7cce035b8c7ee2ba4491645fdab9f382f54beb0" - -# imx-vpu can only support imx6q platform, in order to build out the vpu case in unit test, -# using a workaround to transfer "IMX6Q" on imx6ul & imx7d platform. -PLATFORM_mx6ul = "IMX6Q" -PLATFORM_mx7 = "IMX6Q" -PLATFORM_mx6sll = "IMX6Q" - -PROVIDES = "virtual/libvpu" -RPROVIDES_${PN} = "virtual/libvpu" - -COMPATIBLE_MACHINE = "(ccimx6)" diff --git a/meta-digi-dey/recipes-graphics/imx-gpu-g2d/imx-gpu-g2d_6.2.2.p0.bb b/meta-digi-dey/recipes-graphics/imx-gpu-g2d/imx-gpu-g2d_6.2.2.p0.bb deleted file mode 100644 index 8be05f93f..000000000 --- a/meta-digi-dey/recipes-graphics/imx-gpu-g2d/imx-gpu-g2d_6.2.2.p0.bb +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright (C) 2016 Freescale Semiconductor -# Copyright 2017 NXP -# Released under the MIT license (see COPYING.MIT for the terms) - -DESCRIPTION = "GPU G2D library and apps for imx6" -LICENSE = "Proprietary" -LIC_FILES_CHKSUM = "file://COPYING;md5=08fd295cce89b0a9c74b9b83ed74f671" - -PROVIDES += "virtual/libg2d" - -SRC_URI = "${FSL_MIRROR}/${PN}-${PV}.bin;fsl-eula=true" - -S="${WORKDIR}/${PN}-${PV}" - -inherit fsl-eula-unpack - -SRC_URI[md5sum] = "64720dda9b96fd7af5be7e2c654ab72a" -SRC_URI[sha256sum] = "070a95aa9942bd67e8ba4012962df74143bffb9998301ac097dab5e1437000d8" - -do_install () { - - install -d ${D}${libdir} - install -d ${D}${includedir} - - cp ${S}/g2d/usr/lib/*.so* ${D}${libdir} - cp -Pr ${S}/g2d/usr/include/* ${D}${includedir} - cp -r ${S}/gpu-demos/opt ${D} -} - -RDEPENDS_${PN} = "libgal-imx" - -FILES_${PN} = "${libdir}/libg2d* /opt" -FILES_${PN}-dev = "${includedir}" -INSANE_SKIP_${PN} = "ldflags" - -COMPATIBLE_MACHINE = "(mx6|mx7ulp)" diff --git a/meta-digi-dey/recipes-graphics/imx-gpu-viv/imx-gpu-viv-v6.inc b/meta-digi-dey/recipes-graphics/imx-gpu-viv/imx-gpu-viv-v6.inc deleted file mode 100644 index d7716601d..000000000 --- a/meta-digi-dey/recipes-graphics/imx-gpu-viv/imx-gpu-viv-v6.inc +++ /dev/null @@ -1,327 +0,0 @@ -# Copyright (C) 2012-2016 Freescale Semiconductor -# Copyright (C) 2012-2016 O.S. Systems Software LTDA. -# Released under the MIT license (see COPYING.MIT for the terms) - -DESCRIPTION = "GPU driver and apps for imx" -SECTION = "libs" -LICENSE = "Proprietary" -LIC_FILES_CHKSUM = "file://COPYING;md5=08fd295cce89b0a9c74b9b83ed74f671" - -DEPENDS += " \ - ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland', \ - bb.utils.contains('DISTRO_FEATURES', 'x11', 'virtual/libx11 libxdamage libxext libxfixes', \ - '', d), d)} \ -" -DEPENDS += "libdrm" - -# imx-gpu-viv does not provide everything it needs to for virtual/libgl -# on x11 backend or on Wayland backend with XWayland support. -# We depend on mesa to fill in what is missing. -DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'mesa', '', d)}" - -EXTRA_PROVIDES = "" -EXTRA_PROVIDES_append_imxgpu3d = " virtual/libgl virtual/libgles1 virtual/libgles2" -EXTRA_PROVIDES_append_mx6q = " virtual/opencl-icd opencl-headers" -EXTRA_PROVIDES_append_mx8 = " virtual/opencl-icd opencl-headers virtual/libopenvx" -PROVIDES += "imx-gpu-viv virtual/wayland-egl virtual/libgal-x11 virtual/egl virtual/libopenvg ${EXTRA_PROVIDES}" - -RPROVIDES_${PN}_imxgpu3d += "imx-gpu-viv" - -PE = "1" - -inherit fsl-eula-unpack - -SRC_URI = "${FSL_MIRROR}/${PN}-${PV}.bin;fsl-eula=true" - -# Note : If you add a package here, to prevent a naming conflict see the python_anonymous() futher below -PACKAGES =+ "libclc-imx libclc-imx-dev \ - libgl-imx libgl-imx-dev \ - libgles-imx libgles-imx-dev \ - libgles2-imx libgles2-imx-dev \ - libgles3-imx-dev \ - libglslc-imx libglslc-imx-dev \ - libopencl-imx libopencl-imx-dev \ - libopenvg-imx libopenvg-imx-dev \ - libvdk-imx libvdk-imx-dev \ - libegl-imx libegl-imx-dev \ - libgal-imx libgal-imx-dev \ - libvivante-dri-imx \ - libvsc-imx \ - libgbm-imx libgbm-imx-dev \ - libwayland-viv-imx libwayland-viv-imx-dev \ - libgc-wayland-protocol-imx libgc-wayland-protocol-imx-dev \ - libwayland-egl-imx-dev \ - imx-gpu-viv-tools \ - imx-gpu-viv-demos \ - libvulkan-imx libvulkan-imx-dev \ - libopenvx-imx libopenvx-imx-dev \ -" -python __anonymous () { - has_vivante_kernel_driver_support = (d.getVar('MACHINE_HAS_VIVANTE_KERNEL_DRIVER_SUPPORT', True) or '0') - if has_vivante_kernel_driver_support != '1': - raise bb.parse.SkipPackage('The kernel of machine needs to have Vivante kernel driver support for this recipe to be used.') -} - -USE_X11 = "${@bb.utils.contains("DISTRO_FEATURES", "x11", "yes", "no", d)}" -USE_WL = "${@bb.utils.contains("DISTRO_FEATURES", "wayland", "yes", "no", d)}" - -# Inhibit warnings about files being stripped. -INHIBIT_PACKAGE_STRIP = "1" -INHIBIT_PACKAGE_DEBUG_SPLIT = "1" - -# FIXME: The provided binary doesn't provide soname. If in future BSP -# release the libraries are fixed, we can drop this hack. -REALSOLIBS := "${SOLIBS}" -SOLIBS = "${SOLIBSDEV}" - -# For the packages that make up the OpenGL interfaces, inject variables so that -# they don't get Debian-renamed (which would remove the -imx suffix). -# -# FIXME: All binaries lack GNU_HASH in elf binary but as we don't have -# the source we cannot fix it. Disable the insane check for now. -python __anonymous() { - packages = d.getVar('PACKAGES', True).split() - for p in packages: - d.appendVar("INSANE_SKIP_%s" % p, " ldflags") - - for p in (("libegl", "libegl1"), ("libgl", "libgl1"), - ("libgles1", "libglesv1-cm1"), ("libgles2", "libglesv2-2"), - ("libgles3",) , ("libvulkan",)): - fullp = p[0] + "-imx" - pkgs = " ".join(p) - d.setVar("DEBIAN_NOAUTONAME_" + fullp, "1") - d.appendVar("RREPLACES_" + fullp, pkgs) - d.appendVar("RPROVIDES_" + fullp, pkgs) - d.appendVar("RCONFLICTS_" + fullp, pkgs) - - # For -dev, the first element is both the Debian and original name - fullp += "-dev" - pkgs = p[0] + "-dev" - d.setVar("DEBIAN_NOAUTONAME_" + fullp, "1") - d.appendVar("RREPLACES_" + fullp, pkgs) - d.appendVar("RPROVIDES_" + fullp, pkgs) - d.appendVar("RCONFLICTS_" + fullp, pkgs) -} - -IS_MX6SL = "0" -IS_MX6SL_mx6sl = "1" - -IS_MX8 = "0" -IS_MX8_mx8 = "1" - -do_install () { - install -d ${D}${libdir} - install -d ${D}${includedir} - install -d ${D}${bindir} - - cp -P ${S}/gpu-core/usr/lib/*.so* ${D}${libdir} - cp -r ${S}/gpu-core/usr/include/* ${D}${includedir} - cp -r ${S}/gpu-demos/opt ${D} - cp -r ${S}/gpu-tools/gmem-info/usr/bin/* ${D}${bindir} - - - install -d ${D}${libdir}/pkgconfig - - # The preference order, based in DISTRO_FEATURES, is Wayland (with or without X11), X11 and fb - if [ "${USE_WL}" = "yes" ]; then - - backend=wl - - install -m 0644 ${S}/gpu-core/usr/lib/pkgconfig/egl_wayland.pc ${D}${libdir}/pkgconfig/egl.pc - install -m 0644 ${S}/gpu-core/usr/lib/pkgconfig/glesv1_cm.pc ${D}${libdir}/pkgconfig/glesv1_cm.pc - install -m 0644 ${S}/gpu-core/usr/lib/pkgconfig/glesv2.pc ${D}${libdir}/pkgconfig/glesv2.pc - install -m 0644 ${S}/gpu-core/usr/lib/pkgconfig/vg.pc ${D}${libdir}/pkgconfig/vg.pc - install -m 0644 ${S}/gpu-core/usr/lib/pkgconfig/gc_wayland_protocol.pc ${D}${libdir}/pkgconfig/gc_wayland_protocol.pc - install -m 0644 ${S}/gpu-core/usr/lib/pkgconfig/wayland-egl.pc ${D}${libdir}/pkgconfig/wayland-egl.pc - install -m 0644 ${S}/gpu-core/usr/lib/pkgconfig/wayland-viv.pc ${D}${libdir}/pkgconfig/wayland-viv.pc - install -m 0644 ${S}/gpu-core/usr/lib/pkgconfig/gbm.pc ${D}${libdir}/pkgconfig/gbm.pc - - if [ "${USE_X11}" = "yes" ]; then - - cp -r ${S}/gpu-core/usr/lib/dri ${D}${libdir} - - fi - - elif [ "${USE_X11}" = "yes" ]; then - - cp -r ${S}/gpu-core/usr/lib/dri ${D}${libdir} - - backend=x11 - - install -m 0644 ${S}/gpu-core/usr/lib/pkgconfig/gl_x11.pc ${D}${libdir}/pkgconfig/gl.pc - install -m 0644 ${S}/gpu-core/usr/lib/pkgconfig/egl_x11.pc ${D}${libdir}/pkgconfig/egl.pc - install -m 0644 ${S}/gpu-core/usr/lib/pkgconfig/glesv1_cm_x11.pc ${D}${libdir}/pkgconfig/glesv1_cm.pc - install -m 0644 ${S}/gpu-core/usr/lib/pkgconfig/glesv2_x11.pc ${D}${libdir}/pkgconfig/glesv2.pc - install -m 0644 ${S}/gpu-core/usr/lib/pkgconfig/vg_x11.pc ${D}${libdir}/pkgconfig/vg.pc - - else - install -m 0644 ${S}/gpu-core/usr/lib/pkgconfig/glesv1_cm.pc ${D}${libdir}/pkgconfig/glesv1_cm.pc - install -m 0644 ${S}/gpu-core/usr/lib/pkgconfig/glesv2.pc ${D}${libdir}/pkgconfig/glesv2.pc - install -m 0644 ${S}/gpu-core/usr/lib/pkgconfig/vg.pc ${D}${libdir}/pkgconfig/vg.pc - - # Regular framebuffer - install -m 0644 ${S}/gpu-core/usr/lib/pkgconfig/egl_linuxfb.pc ${D}${libdir}/pkgconfig/egl.pc - - backend=fb - - fi - - # Install Vendor ICDs for OpenCL's installable client driver loader (ICDs Loader) - install -d ${D}${sysconfdir}/OpenCL/vendors/ - install -m 0644 ${S}/gpu-core/etc/Vivante.icd ${D}${sysconfdir}/OpenCL/vendors/Vivante.icd - - # We'll only have one backend here so we rename it to generic name - # and avoid rework in other packages, when possible - mv ${D}${libdir}/libGL.so.1.2 ${D}${libdir}/libGL.so.1.2.0 - ln -sf libGL.so.1.2.0 ${D}${libdir}/libGL.so.1.2 - ln -sf libGL.so.1.2.0 ${D}${libdir}/libGL.so.1 - ln -sf libGL.so.1.2.0 ${D}${libdir}/libGL.so - mv ${D}${libdir}/libEGL-${backend}.so ${D}${libdir}/libEGL.so.1.0 - ln -sf libEGL.so.1.0 ${D}${libdir}/libEGL.so.1 - ln -sf libEGL.so.1.0 ${D}${libdir}/libEGL.so - mv ${D}${libdir}/libGAL-${backend}.so ${D}${libdir}/libGAL.so - mv ${D}${libdir}/libVDK-${backend}.so ${D}${libdir}/libVDK.so - - # update libglesv2 as backend dependent - rm -rf ${D}${libdir}/libGLESv2* - cp ${S}/gpu-core/usr/lib/libGLESv2-${backend}.so ${D}${libdir}/libGLESv2.so.2.0.0 - ln -sf libGLESv2.so.2.0.0 ${D}${libdir}/libGLESv2.so.2 - ln -sf libGLESv2.so.2.0.0 ${D}${libdir}/libGLESv2.so - - if [ "${IS_MX8}" = "1" ]; then - # Install the vulkan driver in a sub-folder. When installed in the same - # folder as the vulkan loader layer library, an incorrect linkage is - # created from libvulkan.so.1 to our library instead of the loader - # layer library. - install -d ${D}${libdir}/vulkan - mv ${D}${libdir}/libvulkan-${backend}.so ${D}${libdir}/vulkan/libvulkan_VSI.so - fi - - # skip packaging wayland libraries if no support is requested - if [ "${USE_WL}" = "no" ]; then - rm ${D}${libdir}/libgc_wayland_protocol.* - rm ${D}${libdir}/libwayland-viv.* - fi - - for i in wl x11 fb dri; do - find ${D}${libdir} -name "*-$i.so" -exec rm '{}' ';' - find ${D}${libdir} -name "*.$i.so" -exec rm '{}' ';' - done - - # FIXME: MX6SL does not have 3D support; hack it for now - if [ "${IS_MX6SL}" = "1" ]; then - rm -rf ${D}${libdir}/libCLC* ${D}${includedir}/CL \ - \ - ${D}${libdir}/libGL* ${D}${includedir}/GL* ${D}${libdir}/pkgconfig/gl.pc \ - \ - ${D}${libdir}/libGLES* ${D}${libdir}/pkgconfig/gles*.pc \ - \ - ${D}${libdir}/libOpenCL* ${D}${includedir}/CL \ - \ - ${D}${libdir}/libOpenVG.3d.so \ - \ - ${D}${libdir}/libVivanteOpenCL.so \ - \ - ${D}/opt/viv_samples/vdk \ - ${D}/opt/viv_samples/es20 ${D}/opt/viv_samples/cl11 - - ln -sf libOpenVG.2d.so ${D}${libdir}/libOpenVG.so - fi - - find ${D}${libdir} -type f -exec chmod 644 {} \; - find ${D}${includedir} -type f -exec chmod 644 {} \; - - chown -R root:root "${D}" -} - -ALLOW_EMPTY_${PN} = "1" - -# FIXME: Remove the following lines after adding libopenvx package -INSANE_SKIP_imx-gpu-viv-dev += "dev-elf" -INSANE_SKIP_libclc-imx += "dev-deps" - -FILES_libclc-imx = "${libdir}/libCLC${SOLIBS}" -FILES_libclc-imx-dev = "${includedir}/CL ${libdir}/libCLC${SOLIBSDEV}" - -# libEGL.so is used by some demo apps from Freescale -INSANE_SKIP_libegl-imx += "dev-so" -FILES_libegl-imx = "${libdir}/libEGL${REALSOLIBS} ${libdir}/libEGL${SOLIBSDEV} " -FILES_libegl-imx-dev = "${includedir}/EGL ${includedir}/KHR ${libdir}/pkgconfig/egl.pc" -RDEPENDS_libegl-imx += "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'libgc-wayland-protocol-imx libwayland-viv-imx libgc-wayland-protocol-imx', '', d)}" -RDEPENDS_libegl-imx-dev += "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'libwayland-egl-imx-dev', '', d)}" - -FILES_libgal-imx = "${libdir}/libGAL${SOLIBS} ${libdir}/libGAL_egl${SOLIBS}" -FILES_libgal-imx-dev = "${libdir}/libGAL${SOLIBSDEV} ${includedir}/HAL" -RDEPENDS_libgal-imx += "kernel-module-imx-gpu-viv" -RPROVIDES_libgal-imx += "libgal-imx" -INSANE_SKIP_libgal-imx += "build-deps" - -FILES_libvsc-imx = "${libdir}/libVSC${SOLIBS}" - -FILES_libgbm-imx = "${libdir}/libgbm${SOLIBS} ${libdir}/gbm_viv${SOLIBS}" -FILES_libgbm-imx-dev = "${libdir}/pkgconfig/gbm.pc ${includedir}/gbm.h ${libdir}/libgbm${SOLIBSDEV}" -RDEPENDS_libgbm-imx += "libdrm" - -FILES_libvulkan-imx = "${libdir}/vulkan/libvulkan_VSI${SOLIBS}" -FILES_libvulkan-imx-dev = "${includedir}/vulkan ${libdir}/vulkan/libvulkan_VSI${SOLIBSDEV}" -INSANE_SKIP_libvulkan-imx += "dev-deps dev-so" - -FILES_libopenvx-imx = "${libdir}/libOpenVX${SOLIBS} ${libdir}/libOpenVXC${SOLIBS} ${libdir}/libOpenVXU${SOLIBS}" -FILES_libopenvx-imx-dev = "${includedir}/VX ${libdir}/libopenVX${SOLIBSDEV}" - -FILES_libgl-imx = "${libdir}/libGL${REALSOLIBS}" -FILES_libgl-imx-dev = "${libdir}/libGL${SOLIBSDEV} ${includedir}/GL" -# Includes GL headers from mesa -RDEPENDS_libgl-imx-dev += "libgl-mesa-dev" - -# libEGL needs to open libGLESv1.so -INSANE_SKIP_libgles-imx += "dev-so" -FILES_libgles-imx = "${libdir}/libGLESv1*${REALSOLIBS} ${libdir}/libGLESv1*${SOLIBS} ${libdir}/libGLES_*${REALSOLIBS} ${libdir}/libGLES_*${SOLIBS}" -FILES_libgles-imx-dev = "${includedir}/GLES ${libdir}/libGLESv1*${SOLIBS} ${libdir}/libGLES_*${SOLIBSDEV} ${libdir}/pkgconfig/glesv1_cm.pc" - -# libEGL needs to open libGLESv2.so -INSANE_SKIP_libgles2-imx += "dev-so" -FILES_libgles2-imx = "${libdir}/libGLESv2${REALSOLIBS} ${libdir}/libGLESv2${SOLIBS}" -FILES_libgles2-imx-dev = "${includedir}/GLES2 ${libdir}/libGLESv2${SOLIBSDEV} ${libdir}/pkgconfig/glesv2.pc" -RDEPENDS_libgles2-imx = "libglslc-imx" - -FILES_libgles3-imx-dev = "${includedir}/GLES3" -# as long as there is no libgles3: ship libgles3-dev along with -# libgles2-dev - otherwise GLES3 headers have to be added manually -RDEPENDS_libgles2-imx-dev += "libgles3-imx-dev" - -FILES_libglslc-imx = "${libdir}/libGLSLC${SOLIBS}" -FILES_libglslc-imx-dev = "${includedir}/CL ${libdir}/libGLSLC${SOLIBSDEV}" - -FILES_libopencl-imx = "${libdir}/libOpenCL${SOLIBS} \ - ${libdir}/libVivanteOpenCL${SOLIBS} \ - ${sysconfdir}/OpenCL/vendors/Vivante.icd" -FILES_libopencl-imx-dev = "${includedir}/CL ${libdir}/libOpenCL${SOLIBSDEV}" -RDEPENDS_libopencl-imx= "libclc-imx" - -INSANE_SKIP_libopenvg-imx += "dev-so" -FILES_libopenvg-imx = "${libdir}/libOpenVG*${SOLIBS}" -FILES_libopenvg-imx-dev = "${includedir}/VG ${libdir}/libOpenVG*${SOLIBSDEV} ${libdir}/pkgconfig/vg.pc" -RDEPENDS_libopenvg-imx += "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd-gpuconfig', '', d)}" - -FILES_libvdk-imx = "${libdir}/libVDK${SOLIBS}" -FILES_libvdk-imx-dev = "${includedir}/*vdk*.h ${libdir}/libVDK${SOLIBSDEV}" - -FILES_libvivante-dri-imx = "${libdir}/dri/vivante_dri.so" -RDEPENDS_libvivante-dri-imx = "libdrm" - -INSANE_SKIP_libwayland-viv-imx += "dev-so" -FILES_libwayland-viv-imx = "${libdir}/libwayland-viv${REALSOLIBS} ${libdir}/libwayland-viv${SOLIBS}" -FILES_libwayland-viv-imx-dev = "${includedir}/wayland-viv ${libdir})/libwayland-viv${SOLIBSDEV} ${libdir}/pkgconfig/wayland-viv.pc" -RPROVIDES_libwayland-viv-imx += "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'xf86-video-imxfb-vivante', '', d)}" - -INSANE_SKIP_libgc-wayland-protocol-imx += "dev-so" -FILES_libgc-wayland-protocol-imx = "${libdir}/libgc_wayland_protocol${REALSOLIBS} ${libdir}/libgc_wayland_protocol${SOLIBS}" -FILES_libgc-wayland-protocol-imx-dev = "${libdir}/libgc_wayland_protocol${SOLIBSDEV} ${libdir}/pkgconfig/gc_wayland_protocol.pc" - -FILES_libwayland-egl-imx-dev = "${libdir}/pkgconfig/wayland-egl.pc" - -FILES_imx-gpu-viv-tools = "${bindir}/gmem_info" - -FILES_imx-gpu-viv-demos = "/opt" -INSANE_SKIP_imx-gpu-viv-demos += "rpaths dev-deps" diff --git a/meta-digi-dey/recipes-graphics/imx-gpu-viv/imx-gpu-viv_6.2.2.p0-aarch32.bb b/meta-digi-dey/recipes-graphics/imx-gpu-viv/imx-gpu-viv_6.2.2.p0-aarch32.bb deleted file mode 100644 index c48216ab5..000000000 --- a/meta-digi-dey/recipes-graphics/imx-gpu-viv/imx-gpu-viv_6.2.2.p0-aarch32.bb +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright (C) 2013-2016 Freescale Semiconductor -# Copyright 2017 NXP -# Released under the MIT license (see COPYING.MIT for the terms) - -require recipes-graphics/imx-gpu-viv/imx-gpu-viv-v6.inc - -SRC_URI = "${FSL_MIRROR}/${PN}-${PV}.bin;fsl-eula=true" - -S="${WORKDIR}/${PN}-${PV}" - -SRC_URI[md5sum] = "7d43f73b8bc0c1c442587f819218a1d5" -SRC_URI[sha256sum] = "4f93a4412c93ca5959aa2437bfed2ecbaf983b5b272be5977f76a967de5db150" - -PACKAGE_FP_TYPE = "hardfp" - -COMPATIBLE_MACHINE = "(mx6q|mx6dl|mx6sx|mx6sl|mx7ulp)" diff --git a/meta-digi-dey/recipes-graphics/mesa/mesa_%.bbappend b/meta-digi-dey/recipes-graphics/mesa/mesa_%.bbappend deleted file mode 100644 index 81ee3f8bb..000000000 --- a/meta-digi-dey/recipes-graphics/mesa/mesa_%.bbappend +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright (C) 2017 Digi International - -# -# Add runtime dependency so that GLES3 headers don't need to be added manually -# -RDEPENDS_libgles2-mesa-dev += "libgles3-mesa-dev" - -# -# Add platform dependency to maintain compatibility -# with GPU driver previous to v6. -# -PROVIDES_remove = "gbm" -PACKAGECONFIG_remove = "gbm" - -BACKEND = \ - "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'wayland', \ - bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', \ - 'fb', d), d)}" - -do_install_append () { - rm -f ${D}${includedir}/GL/glx.h \ - ${D}${includedir}/GL/glxext.h - if [ "${BACKEND}" = "x11" ]; then - rm -f ${D}${libdir}/pkgconfig/gl.pc - fi -} diff --git a/meta-digi-dey/recipes-graphics/xorg-driver/xf86-video-imxfb-vivante/Stop-using-Git-to-write-local-version.patch b/meta-digi-dey/recipes-graphics/xorg-driver/xf86-video-imxfb-vivante/Stop-using-Git-to-write-local-version.patch deleted file mode 100644 index f541e5c17..000000000 --- a/meta-digi-dey/recipes-graphics/xorg-driver/xf86-video-imxfb-vivante/Stop-using-Git-to-write-local-version.patch +++ /dev/null @@ -1,87 +0,0 @@ -From 69a92f4576a1e789ba2fcf957164d2c4013020c5 Mon Sep 17 00:00:00 2001 -From: Otavio Salvador -Date: Wed, 2 Dec 2015 13:36:25 +0000 -Subject: [PATCH] Stop using Git to write local version -Organization: O.S. Systems Software LTDA. - -The standard version does not use a Git repository so we should not -use Git to identify the commit of the build as it can end getting the -version from a wrong repository and can be misleading. - -Upstream-Status: Pending - -Signed-off-by: Otavio Salvador ---- - EXA/src/makefile.tc | 6 +++--- - FslExt/src/makefile.tc | 6 +++--- - util/autohdmi/makefile.tc | 6 +++--- - util/pandisplay/makefile.tc | 6 +++--- - 4 files changed, 12 insertions(+), 12 deletions(-) - -diff --git a/EXA/src/makefile.tc b/EXA/src/makefile.tc -index 0b9a9e6..ec6e68d 100644 ---- a/EXA/src/makefile.tc -+++ b/EXA/src/makefile.tc -@@ -52,8 +52,8 @@ prefix ?= /usr - sysroot ?= / - - # get git commit number --COMMITNR := `git log -n 1 --format=%H` --DIRTY := `git diff-index --quiet HEAD || echo '-dirty'` --LOCAL_CFLAGS += -DCOMMIT="${COMMITNR}${DIRTY}" -+#COMMITNR := `git log -n 1 --format=%H` -+#DIRTY := `git diff-index --quiet HEAD || echo '-dirty'` -+#LOCAL_CFLAGS += -DCOMMIT="${COMMITNR}${DIRTY}" - - -diff --git a/FslExt/src/makefile.tc b/FslExt/src/makefile.tc -index 0b9a9e6..ec6e68d 100644 ---- a/FslExt/src/makefile.tc -+++ b/FslExt/src/makefile.tc -@@ -52,8 +52,8 @@ prefix ?= /usr - sysroot ?= / - - # get git commit number --COMMITNR := `git log -n 1 --format=%H` --DIRTY := `git diff-index --quiet HEAD || echo '-dirty'` --LOCAL_CFLAGS += -DCOMMIT="${COMMITNR}${DIRTY}" -+#COMMITNR := `git log -n 1 --format=%H` -+#DIRTY := `git diff-index --quiet HEAD || echo '-dirty'` -+#LOCAL_CFLAGS += -DCOMMIT="${COMMITNR}${DIRTY}" - - -diff --git a/util/autohdmi/makefile.tc b/util/autohdmi/makefile.tc -index c9de0a6..d0a468c 100644 ---- a/util/autohdmi/makefile.tc -+++ b/util/autohdmi/makefile.tc -@@ -64,8 +64,8 @@ prefix ?= /usr - sysroot ?= / - - # get git commit number --COMMITNR := `git log -n 1 --format=%H` --DIRTY := `git diff-index --quiet HEAD || echo '-dirty'` --LOCAL_CFLAGS += -DCOMMIT="${COMMITNR}${DIRTY}" -+#COMMITNR := `git log -n 1 --format=%H` -+#DIRTY := `git diff-index --quiet HEAD || echo '-dirty'` -+#LOCAL_CFLAGS += -DCOMMIT="${COMMITNR}${DIRTY}" - - -diff --git a/util/pandisplay/makefile.tc b/util/pandisplay/makefile.tc -index 28732b9..bf54c20 100644 ---- a/util/pandisplay/makefile.tc -+++ b/util/pandisplay/makefile.tc -@@ -64,8 +64,8 @@ prefix ?= /usr - sysroot ?= / - - # get git commit number --COMMITNR := `git log -n 1 --format=%H` --DIRTY := `git diff-index --quiet HEAD || echo '-dirty'` --LOCAL_CFLAGS += -DCOMMIT="${COMMITNR}${DIRTY}" -+#COMMITNR := `git log -n 1 --format=%H` -+#DIRTY := `git diff-index --quiet HEAD || echo '-dirty'` -+#LOCAL_CFLAGS += -DCOMMIT="${COMMITNR}${DIRTY}" - - --- -2.1.4 - diff --git a/meta-digi-dey/recipes-graphics/xorg-driver/xf86-video-imxfb-vivante/rc.autohdmi b/meta-digi-dey/recipes-graphics/xorg-driver/xf86-video-imxfb-vivante/rc.autohdmi deleted file mode 100644 index 8c16a1d7f..000000000 --- a/meta-digi-dey/recipes-graphics/xorg-driver/xf86-video-imxfb-vivante/rc.autohdmi +++ /dev/null @@ -1,42 +0,0 @@ -#! /bin/sh -### BEGIN INIT INFO -# Provides: rc.autohdmi -# Required-Start: $all -# Required-Stop: -# Default-Start: 2 3 4 5 -# Default-Stop: -### END INIT INFO - -PATH=/sbin:/usr/sbin:/bin:/usr/bin - -# Source function library. -. /etc/init.d/functions - -case "$1" in - start) - echo -n "Starting autohdmi: " - export DISPLAY=:0 - autohdmi & - echo - exit 0 - ;; - reload|force-reload) - echo "Error: argument '$1' not supported" >&2 - exit 3 - ;; - stop) - echo -n "Shutting down autohdmi: " - killproc autohdmi - echo - ;; - restart) - echo -n "Restarting autohdmi: " - $0 stop - $0 start - echo - ;; - *) - echo "Usage: $0 start|stop" >&2 - exit 3 - ;; -esac diff --git a/meta-digi-dey/recipes-graphics/xorg-driver/xf86-video-imxfb-vivante_6.2.2.p0.bb b/meta-digi-dey/recipes-graphics/xorg-driver/xf86-video-imxfb-vivante_6.2.2.p0.bb deleted file mode 100644 index 3768064a3..000000000 --- a/meta-digi-dey/recipes-graphics/xorg-driver/xf86-video-imxfb-vivante_6.2.2.p0.bb +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright (C) 2012-2016 Freescale Semiconductor -# Copyright (C) 2012-2014 O.S. Systems Software LTDA. -# Copyright 2017 NXP -# Released under the MIT license (see COPYING.MIT for the terms) - -FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" - -require recipes-graphics/xorg-driver/xf86-video-imxfb-vivante.inc - -NXP_REPO_MIRROR ?= "nxp/" -SRCBRANCH = "${NXP_REPO_MIRROR}imx_4.9.11_1.0.0_ga" -S = "${WORKDIR}/git/" -XF86_VIDEO_IMX_VIVANTE_SRC ?= "git://source.codeaurora.org/external/imx/xf86-video-imx-vivante.git;protocol=https" -SRC_URI = "${XF86_VIDEO_IMX_VIVANTE_SRC};branch=${SRCBRANCH}" -SRC_URI +="file://rc.autohdmi" -SRCREV = "07ef065dfe09f1c05a1a188c371577faa3677a17" - -DEPENDS += "virtual/libg2d" - -RDEPENDS_${PN}_remove = "libvivante-dri-mx6" - -RDEPENDS_${PN}_append = " libvivante-dri-imx" - -COMPATIBLE_MACHINE = "(mx6|mx8|mx7ulp)" diff --git a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-1.8.3/0001-handle-base-parse-error.patch b/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-1.8.3/0001-handle-base-parse-error.patch deleted file mode 100644 index ca398f2f9..000000000 --- a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-1.8.3/0001-handle-base-parse-error.patch +++ /dev/null @@ -1,32 +0,0 @@ -From: Lyon Wang -Date: Wed, 14 Oct 2015 14:15:11 +0800 -Subject: [PATCH] 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 - -Bugzilla https://bugzilla.gnome.org/show_bug.cgi?id=741542 -Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=741542] - -Signed-off-by: Lyon Wang ---- - 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 45bc869ffc0a..1d4c9248d2db 100644 ---- a/libs/gst/base/gstbaseparse.c -+++ b/libs/gst/base/gstbaseparse.c -@@ -1358,8 +1358,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 diff --git a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-1.8.3/0002-Fix-crash-with-gst-inspect-Chris-Lord-chris-openedha.patch b/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-1.8.3/0002-Fix-crash-with-gst-inspect-Chris-Lord-chris-openedha.patch deleted file mode 100644 index 46bba8597..000000000 --- a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-1.8.3/0002-Fix-crash-with-gst-inspect-Chris-Lord-chris-openedha.patch +++ /dev/null @@ -1,29 +0,0 @@ -From: Carlos Rafael Giani -Date: Sat, 6 Apr 2013 23:52:11 +0200 -Subject: [PATCH] Fix crash with gst-inspect Chris Lord - -Upstream-Status: Pending - -Signed-off-by: Carlos Rafael Giani - -Conflicts: - tools/gst-inspect.c - -Signed-off-by: Lyon Wang ---- - 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 845f52e82f23..7c99e647aa8e 100644 ---- a/tools/gst-inspect.c -+++ b/tools/gst-inspect.c -@@ -1511,7 +1511,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; diff --git a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-1.8.3/0003-unset-FLAG_DISCONT-when-push-to-adapter.patch b/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-1.8.3/0003-unset-FLAG_DISCONT-when-push-to-adapter.patch deleted file mode 100644 index bde65c43f..000000000 --- a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-1.8.3/0003-unset-FLAG_DISCONT-when-push-to-adapter.patch +++ /dev/null @@ -1,30 +0,0 @@ -From: Lyon Wang -Date: Wed, 4 Nov 2015 18:16:52 +0800 -Subject: [PATCH] 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. - -https://bugzilla.gnome.org/show_bug.cgi?id=757575 - -Upstream-Status: Pending - -Signed-off-by: Lyon Wang ---- - 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 1d4c9248d2db..18667cc4edca 100644 ---- a/libs/gst/base/gstbaseparse.c -+++ b/libs/gst/base/gstbaseparse.c -@@ -3160,6 +3160,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); - } - diff --git a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-1.8.3/0004-Need-push-adapter-remainning-data-in-pass-through-mo.patch b/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-1.8.3/0004-Need-push-adapter-remainning-data-in-pass-through-mo.patch deleted file mode 100644 index b42cc305f..000000000 --- a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-1.8.3/0004-Need-push-adapter-remainning-data-in-pass-through-mo.patch +++ /dev/null @@ -1,50 +0,0 @@ -From: Lyon Wang -Date: Fri, 15 Jan 2016 17:30:14 +0800 -Subject: [PATCH] Need push adapter remainning data in pass through mode - -When switching to pass through mode, there might be remainning -data in the adpater, and it will be no chance to push to downstream when -in pass through mode. -So need check adapter available data and push downstream to avoid missing data - -package: gstreamer1.0 -ticket https://bugzilla.gnome.org/show_bug.cgi?id=760513 -Upstream-Status: Pending - -Signed-off-by: Lyon Wang -Signed-off-by: Lyon Wang ---- - libs/gst/base/gstbaseparse.c | 17 +++++++++++++++++ - 1 file changed, 17 insertions(+) - mode change 100644 => 100755 libs/gst/base/gstbaseparse.c - -diff --git a/libs/gst/base/gstbaseparse.c b/libs/gst/base/gstbaseparse.c -old mode 100644 -new mode 100755 -index 18667cc4edca..5d22e33a6f98 ---- a/libs/gst/base/gstbaseparse.c -+++ b/libs/gst/base/gstbaseparse.c -@@ -3141,6 +3141,23 @@ gst_base_parse_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer) - && parse->priv->passthrough)) { - GstBaseParseFrame frame; - -+ av = gst_adapter_available (parse->priv->adapter); -+ if (av) { -+ tmpbuf = gst_adapter_get_buffer (parse->priv->adapter, av); -+ -+ if (parse->priv->upstream_format == GST_FORMAT_TIME) { -+ tmpbuf = gst_buffer_make_writable (tmpbuf); -+ GST_BUFFER_PTS (tmpbuf) = parse->priv->next_pts; -+ GST_BUFFER_DTS (tmpbuf) = parse->priv->next_dts; -+ GST_BUFFER_DURATION (tmpbuf) = GST_CLOCK_TIME_NONE; -+ } -+ -+ ret = gst_pad_push (parse->srcpad, tmpbuf); -+ -+ gst_adapter_clear (parse->priv->adapter); -+ -+ } -+ - gst_base_parse_frame_init (&frame); - frame.buffer = gst_buffer_make_writable (buffer); - ret = gst_base_parse_push_frame (parse, &frame); diff --git a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-1.8.3/0005-inputselector-should-proceed-non-active-pad-buffer-e.patch b/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-1.8.3/0005-inputselector-should-proceed-non-active-pad-buffer-e.patch deleted file mode 100644 index f1b5c793c..000000000 --- a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-1.8.3/0005-inputselector-should-proceed-non-active-pad-buffer-e.patch +++ /dev/null @@ -1,48 +0,0 @@ -From: Song Bing -Date: Wed, 11 May 2016 16:57:23 +0800 -Subject: [PATCH] inputselector: should proceed non-active pad buffer even if - active pad reach eos - -non-active pad will be blocked if active pad reach eos in inputselector. -Which will cause all pipeline be blocked. -Inputselector should proceed non-active pad buffer based on clock even -if active pad reach eos -Change to sync with clock for better user experience. - -https://bugzilla.gnome.org/show_bug.cgi?id=766261 - -Upstream status: pending - -Signed-off-by: Song Bing bing.song@nxp.com ---- - plugins/elements/gstinputselector.c | 10 ++++++++-- - 1 file changed, 8 insertions(+), 2 deletions(-) - -diff --git a/plugins/elements/gstinputselector.c b/plugins/elements/gstinputselector.c -index 4af219047e09..441a4e40abba 100644 ---- a/plugins/elements/gstinputselector.c -+++ b/plugins/elements/gstinputselector.c -@@ -763,7 +763,7 @@ gst_input_selector_wait_running_time (GstInputSelector * sel, - } - - cur_running_time = GST_CLOCK_TIME_NONE; -- if (sel->sync_mode == GST_INPUT_SELECTOR_SYNC_MODE_CLOCK) { -+ if (sel->sync_mode == GST_INPUT_SELECTOR_SYNC_MODE_CLOCK || active_selpad->eos) { - clock = gst_element_get_clock (GST_ELEMENT_CAST (sel)); - if (clock) { - GstClockTime base_time; -@@ -805,7 +805,13 @@ gst_input_selector_wait_running_time (GstInputSelector * sel, - "Waiting for active streams to advance. %" GST_TIME_FORMAT " >= %" - GST_TIME_FORMAT, GST_TIME_ARGS (running_time), - GST_TIME_ARGS (cur_running_time)); -- GST_INPUT_SELECTOR_WAIT (sel); -+ if (active_selpad->eos) { -+ GST_INPUT_SELECTOR_UNLOCK (sel); -+ g_usleep (5000); -+ GST_INPUT_SELECTOR_LOCK (sel); -+ } else { -+ GST_INPUT_SELECTOR_WAIT (sel); -+ } - } else { - GST_INPUT_SELECTOR_UNLOCK (sel); - break; diff --git a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0001-mpegtsmux-Need-get-pid-when-create-streams.patch b/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0001-mpegtsmux-Need-get-pid-when-create-streams.patch deleted file mode 100644 index 07415c57f..000000000 --- a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0001-mpegtsmux-Need-get-pid-when-create-streams.patch +++ /dev/null @@ -1,44 +0,0 @@ -From a3118c47585d98891454731f66e62d79fff153d9 Mon Sep 17 00:00:00 2001 -From: Song Bing -Date: Wed, 22 Apr 2015 18:06:35 +0800 -Subject: [PATCH] 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. - -https://bugzilla.gnome.org/show_bug.cgi?id=748288 - -UpStream Status: Pending - -Signed-off-by: Lyon Wang ---- - gst/mpegtsmux/mpegtsmux.c | 15 +++++++++++++++ - 1 file changed, 15 insertions(+) - -diff --git a/gst/mpegtsmux/mpegtsmux.c b/gst/mpegtsmux/mpegtsmux.c -index 4c68e3e95f96..d93374520e36 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 = diff --git a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0002-mpeg4videoparse-Need-detect-picture-coding-type-when.patch b/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0002-mpeg4videoparse-Need-detect-picture-coding-type-when.patch deleted file mode 100644 index 6017a9c1a..000000000 --- a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0002-mpeg4videoparse-Need-detect-picture-coding-type-when.patch +++ /dev/null @@ -1,45 +0,0 @@ -From ede36691cbd17db3f8a65d7ed61402111dea6140 Mon Sep 17 00:00:00 2001 -From: Song Bing -Date: Wed, 20 May 2015 15:13:20 +0800 -Subject: [PATCH] mpeg4videoparse: Need detect picture coding type when drain -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -our use case is demuxer only output key frame when backward playback. -every frame is DISCONT and KEY frame. mpeg4videoparse will detect coding -type when detect start code after VOP. our use case will drain after VOP -and can't detect start code after VOP. Add check coding type code when -drain. - -Upstream Status: Waiting for review. - -https://bugzilla.gnome.org/show_bug.cgi?id=749617 -Signed-off-by: Lyon Wang ---- - gst/videoparsers/gstmpeg4videoparse.c | 12 ++++++++++++ - 1 file changed, 12 insertions(+) - -diff --git a/gst/videoparsers/gstmpeg4videoparse.c b/gst/videoparsers/gstmpeg4videoparse.c -index a1fd3b2a3b4c..453effddd680 100644 ---- a/gst/videoparsers/gstmpeg4videoparse.c -+++ b/gst/videoparsers/gstmpeg4videoparse.c -@@ -502,6 +502,18 @@ next: - case (GST_MPEG4_PARSER_ERROR): - /* if draining, take all */ - if (GST_BASE_PARSE_DRAINING (parse)) { -+ /* need decide intra_frame */ -+ if (mp4vparse->vop_offset >= 0) { -+ if (G_LIKELY (size > mp4vparse->vop_offset + 1)) { -+ mp4vparse->intra_frame = -+ ((data[mp4vparse->vop_offset + 1] >> 6 & 0x3) == 0); -+ } else { -+ GST_WARNING_OBJECT (mp4vparse, "no data following VOP startcode"); -+ mp4vparse->intra_frame = FALSE; -+ } -+ GST_LOG_OBJECT (mp4vparse, "is intra %d %d", -+ mp4vparse->intra_frame, mp4vparse->vop_offset); -+ } - framesize = size; - ret = TRUE; - } else { diff --git a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0003-mpegvideoparse-Need-detect-picture-coding-type-when-.patch b/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0003-mpegvideoparse-Need-detect-picture-coding-type-when-.patch deleted file mode 100644 index 25b6dfed8..000000000 --- a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0003-mpegvideoparse-Need-detect-picture-coding-type-when-.patch +++ /dev/null @@ -1,45 +0,0 @@ -From cd3bd818c9bfd28bd5eef99181d6343a6a6f2c91 Mon Sep 17 00:00:00 2001 -From: Song Bing -Date: Wed, 20 May 2015 15:15:08 +0800 -Subject: [PATCH] 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: Waiting for review. - -https://bugzilla.gnome.org/show_bug.cgi?id=749617 -Signed-off-by: Lyon Wang ---- - gst/videoparsers/gstmpegvideoparse.c | 16 ++++++++++++++++ - 1 file changed, 16 insertions(+) - -diff --git a/gst/videoparsers/gstmpegvideoparse.c b/gst/videoparsers/gstmpegvideoparse.c -index bf71a3e7cf1d..7ba624eb8c74 100644 ---- a/gst/videoparsers/gstmpegvideoparse.c -+++ b/gst/videoparsers/gstmpegvideoparse.c -@@ -717,6 +717,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"); diff --git a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0004-modifiy-the-videoparse-rank.patch b/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0004-modifiy-the-videoparse-rank.patch deleted file mode 100644 index 33f5f15ec..000000000 --- a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0004-modifiy-the-videoparse-rank.patch +++ /dev/null @@ -1,72 +0,0 @@ -From 6d38b354a7b6496b208d03fdb45e49b70d825080 Mon Sep 17 00:00:00 2001 -From: Lyon Wang -Date: Fri, 29 May 2015 09:54:56 +0800 -Subject: [PATCH] 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: [i.MX specific] internal use only - -Signed-off-by: Lyon Wang - -[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 - -http://sw-jira.freescale.net/browse/MMFMWK-7012 -Upstream Status: [i.MX specific] - -Signed-off-by: Lyon Wang ---- - 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 79d1df65d577..6fb01614fb4a 100644 ---- a/gst/videoparsers/plugin.c -+++ b/gst/videoparsers/plugin.c -@@ -35,7 +35,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", -@@ -52,7 +52,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_MARGINAL-1, GST_TYPE_H265_PARSE); -+ ret |= gst_element_register (plugin, "vc1parse", -+ GST_RANK_NONE, GST_TYPE_VC1_PARSE); -+#endif - return ret; - } - diff --git a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0005-glfilter-Lost-frame-rate-info-when-fixate-caps.patch b/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0005-glfilter-Lost-frame-rate-info-when-fixate-caps.patch deleted file mode 100644 index 29e9a1cf6..000000000 --- a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0005-glfilter-Lost-frame-rate-info-when-fixate-caps.patch +++ /dev/null @@ -1,50 +0,0 @@ -From a4f0b87d5c4bbe1de5e7cf223d107afbae126110 Mon Sep 17 00:00:00 2001 -From: Song Bing -Date: Mon, 8 Jun 2015 17:06:22 +0800 -Subject: [PATCH] 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: Waiting for review. - -https://bugzilla.gnome.org/show_bug.cgi?id=750545 -Signed-off-by: Lyon Wang ---- - 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 d25bb72988f1..6840f4ca97a7 100644 ---- a/gst-libs/gst/gl/gstglfilter.c -+++ b/gst-libs/gst/gl/gstglfilter.c -@@ -247,7 +247,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,}; - -@@ -260,6 +261,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"); - diff --git a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0006-opencv-Add-video-stitching-support-based-on-Open-CV.patch b/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0006-opencv-Add-video-stitching-support-based-on-Open-CV.patch deleted file mode 100644 index ab7ae4b9a..000000000 --- a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0006-opencv-Add-video-stitching-support-based-on-Open-CV.patch +++ /dev/null @@ -1,1918 +0,0 @@ -From 348adcf57d05bf396b457be2af3496d416a7c20b Mon Sep 17 00:00:00 2001 -From: Song Bing -Date: Mon, 1 Jun 2015 13:30:11 +0800 -Subject: [PATCH] opencv: Add video stitching support based on Open CV - -Add video stitching element based on Open CV. - -https://bugzilla.gnome.org/show_bug.cgi?id=751203 - -Conflicts: - ext/opencv/Makefile.am - -Signed-off-by: Lyon Wang ---- - docs/plugins/Makefile.am | 1 + - ext/opencv/Makefile.am | 14 +- - ext/opencv/gstcvstitching.cpp | 834 +++++++++++++++++++++++++++++++++++++++ - ext/opencv/gstcvstitching.h | 130 ++++++ - ext/opencv/gstopencv.cpp | 4 + - ext/opencv/gstopencvaggregator.c | 705 +++++++++++++++++++++++++++++++++ - ext/opencv/gstopencvaggregator.h | 118 ++++++ - 7 files changed, 1804 insertions(+), 2 deletions(-) - create mode 100644 ext/opencv/gstcvstitching.cpp - create mode 100644 ext/opencv/gstcvstitching.h - create mode 100644 ext/opencv/gstopencvaggregator.c - create mode 100644 ext/opencv/gstopencvaggregator.h - -diff --git a/docs/plugins/Makefile.am b/docs/plugins/Makefile.am -index 7607b558fd42..95f2661d0a42 100644 ---- a/docs/plugins/Makefile.am -+++ b/docs/plugins/Makefile.am -@@ -97,6 +97,7 @@ EXTRA_HFILES = \ - $(top_srcdir)/ext/opencv/gstpyramidsegment.h \ - $(top_srcdir)/ext/opencv/gsttemplatematch.h \ - $(top_srcdir)/ext/opencv/gsttextoverlay.h \ -+ $(top_srcdir)/ext/opencv/gstcvstitching.h \ - $(top_srcdir)/ext/openni2/gstopenni2src.h \ - $(top_srcdir)/ext/rsvg/gstrsvgdec.h \ - $(top_srcdir)/ext/rsvg/gstrsvgoverlay.h \ -diff --git a/ext/opencv/Makefile.am b/ext/opencv/Makefile.am -index 0eee38c450d5..8cea91fda70f 100644 ---- a/ext/opencv/Makefile.am -+++ b/ext/opencv/Makefile.am -@@ -24,11 +24,15 @@ libgstopencv_la_SOURCES = gstopencv.cpp \ - gstsegmentation.cpp \ - gstgrabcut.cpp \ - gstdisparity.cpp \ -+ gstopencvaggregator.c \ -+ gstcvstitching.cpp \ - motioncells_wrapper.cpp \ - MotionCells.cpp - --libgstopencv_la_CXXFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CXXFLAGS) $(OPENCV_CFLAGS) \ -- -DGST_HAAR_CASCADES_DIR=\"$(pkgdatadir)/@GST_API_VERSION@/opencv_haarcascades\" -+libgstopencv_la_CXXFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CXXFLAGS) $(OPENCV_CFLAGS) \ -+ -DGST_HAAR_CASCADES_DIR=\"$(pkgdatadir)/@GST_API_VERSION@/opencv_haarcascades\" \ -+ -I$(top_srcdir)/gst-libs \ -+ -I$(top_builddir)/gst-libs - - # flags used to compile this facedetect - # add other _CFLAGS and _LIBS as needed -@@ -37,10 +41,14 @@ libgstopencv_la_CXXFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_C - # OpenCV's define isn't good enough to avoid 'unused' gcc warnings (at v2.1.0) - libgstopencv_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) \ - $(GST_CFLAGS) $(OPENCV_CFLAGS) \ -+ -I$(top_srcdir)/gst-libs \ -+ -I$(top_builddir)/gst-libs \ -+ -DGST_HAAR_CASCADES_DIR=\"$(pkgdatadir)/@GST_API_VERSION@/opencv_haarcascades\" \ - -DCV_INLINE="static inline" \ - -DCV_NO_BACKWARD_COMPATIBILITY - - libgstopencv_la_LIBADD = $(GST_LIBS) $(GST_BASE_LIBS) $(OPENCV_LIBS) \ -+ $(top_builddir)/gst-libs/gst/video/libgstbadvideo-$(GST_API_VERSION).la \ - $(GSTPB_BASE_LIBS) -lgstvideo-$(GST_API_VERSION) - - libgstopencv_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) -@@ -67,6 +75,8 @@ noinst_HEADERS = gstopencvvideofilter.h gstopencvutils.h \ - gstsegmentation.h \ - gstgrabcut.h \ - gstdisparity.h \ -+ gstopencvaggregator.h \ -+ gstcvstitching.h \ - gstmotioncells.h \ - motioncells_wrapper.h \ - MotionCells.h -diff --git a/ext/opencv/gstcvstitching.cpp b/ext/opencv/gstcvstitching.cpp -new file mode 100644 -index 000000000000..47105f723594 ---- /dev/null -+++ b/ext/opencv/gstcvstitching.cpp -@@ -0,0 +1,834 @@ -+/* -+ * GStreamer -+ * Copyright (C) 2015 Song Bing -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a -+ * copy of this software and associated documentation files (the "Software"), -+ * to deal in the Software without restriction, including without limitation -+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, -+ * and/or sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following conditions: -+ * -+ * The above copyright notice and this permission notice shall be included in -+ * all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -+ * DEALINGS IN THE SOFTWARE. -+ * -+ * Alternatively, the contents of this file may be used under the -+ * GNU Lesser General Public License Version 2.1 (the "LGPL"), in -+ * which case the following provisions apply instead of the ones -+ * mentioned above: -+ * -+ * 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. -+ */ -+ -+/** -+ * SECTION:element-cvstitching -+ * -+ * video or image stitching. -+ * -+ * video or image stitching. -+ * -+ * -+ * Example launch line -+ * |[ -+ * gst-launch-1.0 filesrc location=IMG_20150529_152901.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. filesrc location=IMG_20150529_152907.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. cvstitching name=stitcher stitcher.src ! videoconvert ! ximagesink sync=false -+ * ]| image stitching. -+ * |[ -+ * gst-launch-1.0 filesrc location=IMG_20150529_152901.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. filesrc location=IMG_20150529_152907.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. filesrc location=IMG_20150529_152913.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. filesrc location=IMG_20150529_152918.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. filesrc location=IMG_20150529_152924.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. filesrc location=IMG_20150529_152929.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. filesrc location=IMG_20150529_152933.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. filesrc location=IMG_20150529_152938.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. filesrc location=IMG_20150529_152942.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. filesrc location=IMG_20150529_152947.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. filesrc location=IMG_20150529_152951.jpg ! jpegdec ! videoconvert ! imagefreeze ! stitcher. cvstitching name=stitcher stitcher.src ! videoconvert ! ximagesink sync=false -+ * ]| images stitching. -+ * -+ * -+ */ -+ -+#ifdef HAVE_CONFIG_H -+# include -+#endif -+ -+#include "gstopencvutils.h" -+#include "gstcvstitching.h" -+ -+// default settings. -+bool preview = false; -+bool try_gpu = false; -+double work_megapix = 0.6; -+double seam_megapix = 0.1; -+double compose_megapix = -1; -+float conf_thresh = 1.f; -+string ba_refine_mask = "xxxxx"; -+bool do_wave_correct = true; -+WaveCorrectKind wave_correct = detail::WAVE_CORRECT_HORIZ; -+int expos_comp_type = ExposureCompensator::GAIN_BLOCKS; -+float match_conf = 0.3f; -+int blend_type = Blender::MULTI_BAND; -+float blend_strength = 5; -+ -+#define gst_cv_stitching_parent_class parent_class -+ -+#define GST_CAT_DEFAULT gst_cv_stitching_debug -+GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT); -+ -+#define DEFAULT_FEATURE_TYPE 0 -+#define DEFAULT_WARP_TYPE 0 -+#define DEFAULT_SEAM_FIND 0 -+#define DEFAULT_BA_COST_FUNC 0 -+enum -+{ -+ PROP_0, -+ PROP_FEATURE_TYPE, -+ PROP_WARP_TYPE, -+ PROP_SEAM_FIND_TYPE, -+ PROP_BA_COST_FUNC -+}; -+ -+static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink_%u", -+ GST_PAD_SINK, -+ GST_PAD_REQUEST, -+ GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE ("RGB")) -+ ); -+ -+static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src", -+ GST_PAD_SRC, -+ GST_PAD_ALWAYS, -+ GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE ("RGB")) -+ ); -+ -+G_DEFINE_TYPE (GstCvStitching, gst_cv_stitching, GST_TYPE_OPENCV_AGGREGATOR); -+ -+G_DEFINE_TYPE (GstCvStitchingPad, gst_cv_stitching_pad, -+ GST_TYPE_OPENCV_AGGREGATOR_PAD); -+ -+static void gst_cv_stitching_pad_set_property (GObject * object, -+ guint prop_id, const GValue * value, GParamSpec * pspec); -+static void gst_cv_stitching_pad_get_property (GObject * object, -+ guint prop_id, GValue * value, GParamSpec * pspec); -+ -+enum -+{ -+ PROP_PAD_0, -+}; -+ -+static void -+gst_cv_stitching_pad_class_init (GstCvStitchingPadClass * klass) -+{ -+ GObjectClass *gobject_class = (GObjectClass *) klass; -+ -+ gobject_class->set_property = gst_cv_stitching_pad_set_property; -+ gobject_class->get_property = gst_cv_stitching_pad_get_property; -+} -+ -+static void -+gst_cv_stitching_pad_init (GstCvStitchingPad * pad) -+{ -+} -+ -+static void -+gst_cv_stitching_pad_get_property (GObject * object, guint prop_id, -+ GValue * value, GParamSpec * pspec) -+{ -+ switch (prop_id) { -+ default: -+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); -+ break; -+ } -+} -+ -+static void -+gst_cv_stitching_pad_set_property (GObject * object, guint prop_id, -+ const GValue * value, GParamSpec * pspec) -+{ -+ switch (prop_id) { -+ default: -+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); -+ break; -+ } -+} -+ -+static void gst_cv_stitching_set_property (GObject * object, guint prop_id, -+ const GValue * value, GParamSpec * pspec); -+static void gst_cv_stitching_get_property (GObject * object, guint prop_id, -+ GValue * value, GParamSpec * pspec); -+static gboolean gst_cv_stitching_start (GstAggregator * agg); -+static gboolean gst_cv_stitching_stop (GstAggregator * agg); -+static gboolean -+gst_cv_stitching_process (GstOpencvAggregator * agg, GPtrArray *imgs, -+ IplImage *outimg); -+ -+enum _GstCvStitchingFeatureTypes { -+ GST_CV_STITCHING_FEATURE_TYPES_SURF = 0, -+ GST_CV_STITCHING_FEATURE_TYPES_ORB = 1 -+}; -+ -+#define GST_TYPE_CV_STITCHING_FEATURE_TYPES (cv_stitching_feature_type_get_type ()) -+ -+static GType -+cv_stitching_feature_type_get_type (void) -+{ -+ static GType cv_stitching_feature_type_type = 0; -+ static const GEnumValue cv_stitching_feature_type[] = { -+ {GST_CV_STITCHING_FEATURE_TYPES_SURF, "feature type surf", "surf"}, -+ {GST_CV_STITCHING_FEATURE_TYPES_ORB, "feature type surf", "orb"}, -+ {0, NULL, NULL}, -+ }; -+ -+ if (!cv_stitching_feature_type_type) { -+ cv_stitching_feature_type_type = -+ g_enum_register_static ("GstCvStitchingFeatureTypes", cv_stitching_feature_type); -+ } -+ return cv_stitching_feature_type_type; -+} -+ -+enum _GstCvStitchingWarpTypes { -+ GST_CV_STITCHING_WARP_TYPES_PLANE = 0, -+ GST_CV_STITCHING_WARP_TYPES_CYLINDRICAL = 1, -+ GST_CV_STITCHING_WARP_TYPES_SPHERICAL = 2, -+ GST_CV_STITCHING_WARP_TYPES_FISHEYE = 3, -+ GST_CV_STITCHING_WARP_TYPES_STEREOGRAPHIC = 4, -+ GST_CV_STITCHING_WARP_TYPES_COMPRESSEDPLANEA2B1 = 5, -+ GST_CV_STITCHING_WARP_TYPES_COMPRESSEDPLANEA1_5B1 = 6, -+ GST_CV_STITCHING_WARP_TYPES_COMPRESSEDPLANEPORTRAITA2B1 = 7, -+ GST_CV_STITCHING_WARP_TYPES_COMPRESSEDPLANEPORTRAITA1_5B1 = 8, -+ GST_CV_STITCHING_WARP_TYPES_PANINIA2B1 = 9, -+ GST_CV_STITCHING_WARP_TYPES_PANINIA1_5B1 = 10, -+ GST_CV_STITCHING_WARP_TYPES_PANINIPORTRAITA2B1 = 11, -+ GST_CV_STITCHING_WARP_TYPES_PANINIPORTRAITA1_5B1 = 12, -+ GST_CV_STITCHING_WARP_TYPES_MERCATOR = 13, -+ GST_CV_STITCHING_WARP_TYPES_TRANSVERSEMERCATOR = 14 -+}; -+ -+#define GST_TYPE_CV_STITCHING_WARP_TYPES (cv_stitching_warp_type_get_type ()) -+ -+static GType -+cv_stitching_warp_type_get_type (void) -+{ -+ static GType cv_stitching_warp_type_type = 0; -+ static const GEnumValue cv_stitching_warp_type[] = { -+ {GST_CV_STITCHING_WARP_TYPES_PLANE, "warp type plane", "plane"}, -+ {GST_CV_STITCHING_WARP_TYPES_CYLINDRICAL, "warp type cylindrical", "cylindrical"}, -+ {GST_CV_STITCHING_WARP_TYPES_SPHERICAL, "warp type spherical", "spherical"}, -+ {GST_CV_STITCHING_WARP_TYPES_FISHEYE, "warp type fisheye", "fisheye"}, -+ {GST_CV_STITCHING_WARP_TYPES_STEREOGRAPHIC, "warp type stereographic", "stereographic"}, -+ {GST_CV_STITCHING_WARP_TYPES_COMPRESSEDPLANEA2B1, "warp type compressedPlaneA2B1", "compressedPlaneA2B1"}, -+ {GST_CV_STITCHING_WARP_TYPES_COMPRESSEDPLANEA1_5B1, "warp type compressedPlaneA1.5B1", "compressedPlaneA1.5B1"}, -+ {GST_CV_STITCHING_WARP_TYPES_COMPRESSEDPLANEPORTRAITA2B1, "warp type compressedPlanePortraitA2B1", "compressedPlanePortraitA2B1"}, -+ {GST_CV_STITCHING_WARP_TYPES_COMPRESSEDPLANEPORTRAITA1_5B1, "warp type compressedPlanePortraitA1.5B1", "compressedPlanePortraitA1.5B1"}, -+ {GST_CV_STITCHING_WARP_TYPES_PANINIA2B1, "warp type paniniA2B1", "paniniA2B1"}, -+ {GST_CV_STITCHING_WARP_TYPES_PANINIA1_5B1, "warp type paniniA1.5B1", "paniniA1.5B1"}, -+ {GST_CV_STITCHING_WARP_TYPES_PANINIPORTRAITA2B1, "warp type paniniPortraitA2B1", "paniniPortraitA2B1"}, -+ {GST_CV_STITCHING_WARP_TYPES_PANINIPORTRAITA1_5B1, "warp type paniniPortraitA1.5B1", "paniniPortraitA1.5B1"}, -+ {GST_CV_STITCHING_WARP_TYPES_MERCATOR, "warp type mercator", "mercator"}, -+ {GST_CV_STITCHING_WARP_TYPES_TRANSVERSEMERCATOR, "warp type transverseMercator", "transverseMercator"}, -+ {0, NULL, NULL}, -+ }; -+ -+ if (!cv_stitching_warp_type_type) { -+ cv_stitching_warp_type_type = -+ g_enum_register_static ("GstCvStitchingWarpTypes", cv_stitching_warp_type); -+ } -+ return cv_stitching_warp_type_type; -+} -+ -+enum _GstCvStitchingSeamFindTypes { -+ GST_CV_STITCHING_SEAM_FIND_TYPES_NO = 0, -+ GST_CV_STITCHING_SEAM_FIND_TYPES_VORONOI = 1, -+ GST_CV_STITCHING_SEAM_FIND_TYPES_GC_COLOR = 2, -+ GST_CV_STITCHING_SEAM_FIND_TYPES_GC_COLORGRAD = 3, -+ GST_CV_STITCHING_SEAM_FIND_TYPES_DP_COLOR = 4, -+ GST_CV_STITCHING_SEAM_FIND_TYPES_DP_COLORGRAD = 5 -+}; -+ -+#define GST_TYPE_CV_STITCHING_SEAM_FIND_TYPES (cv_stitching_seam_find_type_get_type ()) -+ -+static GType -+cv_stitching_seam_find_type_get_type (void) -+{ -+ static GType cv_stitching_seam_find_type_type = 0; -+ static const GEnumValue cv_stitching_seam_find_type[] = { -+ {GST_CV_STITCHING_SEAM_FIND_TYPES_NO, "seam_find type no", "no"}, -+ {GST_CV_STITCHING_SEAM_FIND_TYPES_VORONOI, "seam_find type voronoi", "voronoi"}, -+ {GST_CV_STITCHING_SEAM_FIND_TYPES_GC_COLOR, "seam_find type gc_color", "gc_color"}, -+ {GST_CV_STITCHING_SEAM_FIND_TYPES_GC_COLORGRAD, "seam_find type gc_colorgrad", "gc_colorgrad"}, -+ {GST_CV_STITCHING_SEAM_FIND_TYPES_DP_COLOR, "seam_find type dp_color", "dp_color"}, -+ {GST_CV_STITCHING_SEAM_FIND_TYPES_DP_COLORGRAD, "seam_find type dp_colorgrad", "dp_colorgrad"}, -+ {0, NULL, NULL}, -+ }; -+ -+ if (!cv_stitching_seam_find_type_type) { -+ cv_stitching_seam_find_type_type = -+ g_enum_register_static ("GstCvStitchingSeamFindTypes", cv_stitching_seam_find_type); -+ } -+ return cv_stitching_seam_find_type_type; -+} -+ -+enum _GstCvStitchingBACostFuncs { -+ GST_CV_STITCHING_BA_COST_FUNCS_REPROJ = 0, -+ GST_CV_STITCHING_BA_COST_FUNCS_RAY = 1 -+}; -+ -+#define GST_TYPE_CV_STITCHING_BA_COST_FUNCS (cv_stitching_ba_cost_func_get_type ()) -+ -+static GType -+cv_stitching_ba_cost_func_get_type (void) -+{ -+ static GType cv_stitching_ba_cost_func_type = 0; -+ static const GEnumValue cv_stitching_ba_cost_func[] = { -+ {GST_CV_STITCHING_BA_COST_FUNCS_REPROJ, "ba cost func reproj", "reproj"}, -+ {GST_CV_STITCHING_BA_COST_FUNCS_RAY, "ba cost func ray", "ray"}, -+ {0, NULL, NULL}, -+ }; -+ -+ if (!cv_stitching_ba_cost_func_type) { -+ cv_stitching_ba_cost_func_type = -+ g_enum_register_static ("GstCvStitchingBACostFuncs", cv_stitching_ba_cost_func); -+ } -+ return cv_stitching_ba_cost_func_type; -+} -+ -+static void -+gst_cv_stitching_class_init (GstCvStitchingClass * klass) -+{ -+ GObjectClass *gobject_class; -+ GstElementClass *element_class; -+ GstAggregatorClass *agg_class = (GstAggregatorClass *) klass; -+ GstOpencvAggregatorClass *cvagg_class = (GstOpencvAggregatorClass *) klass; -+ -+ gobject_class = (GObjectClass *) klass; -+ element_class = GST_ELEMENT_CLASS (klass); -+ -+ gobject_class->set_property = gst_cv_stitching_set_property; -+ gobject_class->get_property = gst_cv_stitching_get_property; -+ -+ gst_element_class_add_pad_template (element_class, -+ gst_static_pad_template_get (&src_factory)); -+ gst_element_class_add_pad_template (element_class, -+ gst_static_pad_template_get (&sink_factory)); -+ -+ g_object_class_install_property (gobject_class, PROP_FEATURE_TYPE, -+ g_param_spec_enum ("feturetypes", "Featuretypes", "match feature type", -+ GST_TYPE_CV_STITCHING_FEATURE_TYPES, DEFAULT_FEATURE_TYPE, -+ G_PARAM_READWRITE)); -+ g_object_class_install_property (gobject_class, PROP_WARP_TYPE, -+ g_param_spec_enum ("warptypes", "Warptypes", "Warp type", -+ GST_TYPE_CV_STITCHING_WARP_TYPES, DEFAULT_WARP_TYPE, -+ G_PARAM_READWRITE)); -+ g_object_class_install_property (gobject_class, PROP_SEAM_FIND_TYPE, -+ g_param_spec_enum ("seamfindtypes", "Seamfindtypes", "Seam find type", -+ GST_TYPE_CV_STITCHING_SEAM_FIND_TYPES, DEFAULT_SEAM_FIND, -+ G_PARAM_READWRITE)); -+ g_object_class_install_property (gobject_class, PROP_BA_COST_FUNC, -+ g_param_spec_enum ("bacostfuncs", "Bacostfuncs", "Ba cost func", -+ GST_TYPE_CV_STITCHING_BA_COST_FUNCS, DEFAULT_BA_COST_FUNC, -+ G_PARAM_READWRITE)); -+ -+ gst_element_class_set_metadata (element_class, "OpenCV video_stitcher", -+ "Aggregator/VideoAggregator/CvStitching", "OpenCV video_stitcher", -+ "Song Bing "); -+ -+ agg_class->start = gst_cv_stitching_start; -+ agg_class->stop = gst_cv_stitching_stop; -+ -+ cvagg_class->GstOpencvAggregatorProcess = gst_cv_stitching_process; -+ -+ agg_class->sinkpads_type = GST_TYPE_CV_STITCHING_PAD; -+} -+ -+static void -+gst_cv_stitching_init (GstCvStitching * stitcher) -+{ -+ stitcher->features_type = DEFAULT_FEATURE_TYPE; -+ stitcher->warp_type = DEFAULT_WARP_TYPE; -+ stitcher->seam_find_type = DEFAULT_SEAM_FIND; -+ stitcher->ba_cost_func = DEFAULT_BA_COST_FUNC; -+} -+ -+static void -+gst_cv_stitching_set_property (GObject * object, guint prop_id, -+ const GValue * value, GParamSpec * pspec) -+{ -+ GstCvStitching *stitcher = GST_CV_STITCHING (object); -+ -+ switch (prop_id) { -+ case PROP_FEATURE_TYPE: -+ stitcher->features_type = g_value_get_enum (value); -+ break; -+ case PROP_WARP_TYPE: -+ stitcher->warp_type = g_value_get_enum (value); -+ break; -+ case PROP_SEAM_FIND_TYPE: -+ stitcher->seam_find_type = g_value_get_enum (value); -+ break; -+ case PROP_BA_COST_FUNC: -+ stitcher->ba_cost_func = g_value_get_enum (value); -+ break; -+ default: -+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); -+ break; -+ } -+} -+ -+static void -+gst_cv_stitching_get_property (GObject * object, guint prop_id, -+ GValue * value, GParamSpec * pspec) -+{ -+ GstCvStitching *stitcher = GST_CV_STITCHING (object); -+ -+ switch (prop_id) { -+ case PROP_FEATURE_TYPE: -+ g_value_set_enum (value, stitcher->features_type); -+ break; -+ case PROP_WARP_TYPE: -+ g_value_set_enum (value, stitcher->warp_type); -+ break; -+ case PROP_SEAM_FIND_TYPE: -+ g_value_set_enum (value, stitcher->seam_find_type); -+ break; -+ case PROP_BA_COST_FUNC: -+ g_value_set_enum (value, stitcher->ba_cost_func); -+ break; -+ default: -+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); -+ break; -+ } -+} -+ -+static gboolean -+gst_cv_stitching_start (GstAggregator * agg) -+{ -+ GstCvStitching *stitcher = GST_CV_STITCHING (agg); -+ -+ if (!GST_AGGREGATOR_CLASS (parent_class)->start (agg)) -+ return FALSE; -+ -+ if (stitcher->features_type == GST_CV_STITCHING_FEATURE_TYPES_SURF) { -+ stitcher->finder = new SurfFeaturesFinder(); -+ } else if (stitcher->features_type == GST_CV_STITCHING_FEATURE_TYPES_ORB) { -+ stitcher->finder = new OrbFeaturesFinder(); -+ } else { -+ GST_ERROR_OBJECT (stitcher, "Unknown 2D features type: %d", stitcher->features_type); -+ return FALSE; -+ } -+ -+ if (stitcher->warp_type == GST_CV_STITCHING_WARP_TYPES_PLANE) -+ stitcher->warper_creator = new cv::PlaneWarper(); -+ else if (stitcher->warp_type == GST_CV_STITCHING_WARP_TYPES_CYLINDRICAL) -+ stitcher->warper_creator = new cv::CylindricalWarper(); -+ else if (stitcher->warp_type == GST_CV_STITCHING_WARP_TYPES_SPHERICAL) -+ stitcher->warper_creator = new cv::SphericalWarper(); -+ else if (stitcher->warp_type == GST_CV_STITCHING_WARP_TYPES_FISHEYE) -+ stitcher->warper_creator = new cv::FisheyeWarper(); -+ else if (stitcher->warp_type == GST_CV_STITCHING_WARP_TYPES_STEREOGRAPHIC) -+ stitcher->warper_creator = new cv::StereographicWarper(); -+ else if (stitcher->warp_type == GST_CV_STITCHING_WARP_TYPES_COMPRESSEDPLANEA2B1) -+ stitcher->warper_creator = new cv::CompressedRectilinearWarper(2, 1); -+ else if (stitcher->warp_type == GST_CV_STITCHING_WARP_TYPES_COMPRESSEDPLANEA1_5B1) -+ stitcher->warper_creator = new cv::CompressedRectilinearWarper(1.5, 1); -+ else if (stitcher->warp_type == GST_CV_STITCHING_WARP_TYPES_COMPRESSEDPLANEPORTRAITA2B1) -+ stitcher->warper_creator = new cv::CompressedRectilinearPortraitWarper(2, 1); -+ else if (stitcher->warp_type == GST_CV_STITCHING_WARP_TYPES_COMPRESSEDPLANEPORTRAITA1_5B1) -+ stitcher->warper_creator = new cv::CompressedRectilinearPortraitWarper(1.5, 1); -+ else if (stitcher->warp_type == GST_CV_STITCHING_WARP_TYPES_PANINIA2B1) -+ stitcher->warper_creator = new cv::PaniniWarper(2, 1); -+ else if (stitcher->warp_type == GST_CV_STITCHING_WARP_TYPES_PANINIA1_5B1) -+ stitcher->warper_creator = new cv::PaniniWarper(1.5, 1); -+ else if (stitcher->warp_type == GST_CV_STITCHING_WARP_TYPES_PANINIPORTRAITA2B1) -+ stitcher->warper_creator = new cv::PaniniPortraitWarper(2, 1); -+ else if (stitcher->warp_type == GST_CV_STITCHING_WARP_TYPES_PANINIPORTRAITA1_5B1) -+ stitcher->warper_creator = new cv::PaniniPortraitWarper(1.5, 1); -+ else if (stitcher->warp_type == GST_CV_STITCHING_WARP_TYPES_MERCATOR) -+ stitcher->warper_creator = new cv::MercatorWarper(); -+ else if (stitcher->warp_type == GST_CV_STITCHING_WARP_TYPES_TRANSVERSEMERCATOR) -+ stitcher->warper_creator = new cv::TransverseMercatorWarper(); -+ if (stitcher->warper_creator.empty()) { -+ GST_ERROR_OBJECT (stitcher, "Can't create the following warper: %d", -+ stitcher->warp_type); -+ return FALSE; -+ } -+ -+ if (stitcher->seam_find_type == GST_CV_STITCHING_SEAM_FIND_TYPES_NO) -+ stitcher->seam_finder = new detail::NoSeamFinder(); -+ else if (stitcher->seam_find_type == GST_CV_STITCHING_SEAM_FIND_TYPES_VORONOI) -+ stitcher->seam_finder = new detail::VoronoiSeamFinder(); -+ else if (stitcher->seam_find_type == GST_CV_STITCHING_SEAM_FIND_TYPES_GC_COLOR) { -+ stitcher->seam_finder = new detail::GraphCutSeamFinder(GraphCutSeamFinderBase::COST_COLOR); -+ } else if (stitcher->seam_find_type == GST_CV_STITCHING_SEAM_FIND_TYPES_GC_COLORGRAD) { -+ stitcher->seam_finder = new detail::GraphCutSeamFinder(GraphCutSeamFinderBase::COST_COLOR_GRAD); -+ } else if (stitcher->seam_find_type == GST_CV_STITCHING_SEAM_FIND_TYPES_DP_COLOR) -+ stitcher->seam_finder = new detail::DpSeamFinder(DpSeamFinder::COLOR); -+ else if (stitcher->seam_find_type == GST_CV_STITCHING_SEAM_FIND_TYPES_DP_COLORGRAD) -+ stitcher->seam_finder = new detail::DpSeamFinder(DpSeamFinder::COLOR_GRAD); -+ if (stitcher->seam_finder.empty()) { -+ GST_ERROR_OBJECT (stitcher, "Can't create the following seam finder: %d", -+ stitcher->seam_find_type); -+ return FALSE; -+ } -+ -+ if (stitcher->ba_cost_func == GST_CV_STITCHING_BA_COST_FUNCS_REPROJ) -+ stitcher->adjuster = new detail::BundleAdjusterReproj(); -+ else if (stitcher->ba_cost_func == GST_CV_STITCHING_BA_COST_FUNCS_RAY) -+ stitcher->adjuster = new detail::BundleAdjusterRay(); -+ else { -+ GST_ERROR_OBJECT (stitcher, "Unknown bundle adjustment cost function: %d", -+ stitcher->ba_cost_func); -+ return FALSE; -+ } -+ -+ return TRUE; -+} -+ -+static gboolean -+gst_cv_stitching_stop (GstAggregator * agg) -+{ -+ GstCvStitching *stitcher = GST_CV_STITCHING (agg); -+ -+ stitcher->finder.release(); -+ stitcher->warper_creator.release(); -+ stitcher->seam_finder.release(); -+ stitcher->adjuster.release(); -+ -+ return GST_AGGREGATOR_CLASS (parent_class)->stop (agg); -+} -+ -+static gboolean -+gst_cv_stitching_process (GstOpencvAggregator * agg, GPtrArray *imgs, -+ IplImage *outimg) -+{ -+ GstCvStitching *stitcher = GST_CV_STITCHING (agg); -+ int64 app_start_time = getTickCount(); -+ -+ GST_LOG_OBJECT (stitcher, "video stitching process"); -+ int num_images = imgs->len; -+ if (num_images < 2) { -+ GST_ERROR_OBJECT (stitcher, "Need more images"); -+ return FALSE; -+ } -+ -+ double work_scale = 1, seam_scale = 1, compose_scale = 1; -+ bool is_work_scale_set = false, is_seam_scale_set = false, is_compose_scale_set = false; -+ -+ GST_LOG_OBJECT (stitcher, "Finding features..."); -+ int64 t = getTickCount(); -+ -+ Mat full_img, img; -+ vector features(num_images); -+ vector images(num_images); -+ vector full_img_sizes(num_images); -+ double seam_work_aspect = 1; -+ -+ for (int i = 0; i < num_images; ++i) { -+ IplImage *cvImage = (IplImage *) g_ptr_array_index (imgs, i); -+ Mat in_mat(cvImage, false); -+ -+ full_img = in_mat; -+ full_img_sizes[i] = full_img.size(); -+ -+ if (full_img.empty()) { -+ GST_ERROR_OBJECT (stitcher, "No input data"); -+ return FALSE; -+ } -+ if (work_megapix < 0) { -+ img = full_img; -+ work_scale = 1; -+ is_work_scale_set = true; -+ } else { -+ if (!is_work_scale_set) { -+ work_scale = min(1.0, sqrt(work_megapix * 1e6 / full_img.size().area())); -+ is_work_scale_set = true; -+ } -+ resize(full_img, img, Size(), work_scale, work_scale); -+ } -+ if (!is_seam_scale_set) { -+ seam_scale = min(1.0, sqrt(seam_megapix * 1e6 / full_img.size().area())); -+ seam_work_aspect = seam_scale / work_scale; -+ is_seam_scale_set = true; -+ } -+ -+ (*stitcher->finder)(img, features[i]); -+ features[i].img_idx = i; -+ //LOGLN("Features in image #" << i+1 << ": " << features[i].keypoints.size()); -+ -+ resize(full_img, img, Size(), seam_scale, seam_scale); -+ images[i] = img.clone(); -+ } -+ -+ stitcher->finder->collectGarbage(); -+ full_img.release(); -+ img.release(); -+ -+ GST_LOG_OBJECT (stitcher, "Finding features, time: %f sec", -+ ((getTickCount() - t) / getTickFrequency())); -+ -+ GST_LOG_OBJECT (stitcher, "Pairwise matching"); -+ t = getTickCount(); -+ BestOf2NearestMatcher matcher(try_gpu, match_conf); -+ vector pairwise_matches; -+ -+ matcher(features, pairwise_matches); -+ matcher.collectGarbage(); -+ GST_LOG_OBJECT (stitcher, "Pairwise matching, time: %f sec", -+ ((getTickCount() - t) / getTickFrequency())); -+ -+ // Leave only images we are sure are from the same panorama -+ vector indices = leaveBiggestComponent(features, pairwise_matches, conf_thresh); -+ vector img_subset; -+ vector full_img_sizes_subset; -+ for (size_t i = 0; i < indices.size(); ++i) { -+ img_subset.push_back(images[indices[i]]); -+ full_img_sizes_subset.push_back(full_img_sizes[indices[i]]); -+ } -+ -+ images = img_subset; -+ full_img_sizes = full_img_sizes_subset; -+ -+ // Check if we still have enough images -+ num_images = static_cast(images.size()); -+ if (num_images < 2) { -+ GST_WARNING_OBJECT (stitcher, "Can't find overlap images"); -+ return FALSE; -+ } -+ HomographyBasedEstimator estimator; -+ vector cameras; -+ estimator(features, pairwise_matches, cameras); -+ -+ for (size_t i = 0; i < cameras.size(); ++i) { -+ Mat R; -+ cameras[i].R.convertTo(R, CV_32F); -+ cameras[i].R = R; -+ //LOGLN("Initial intrinsics #" << indices[i]+1 << ":\n" << cameras[i].K()); -+ } -+ -+ stitcher->adjuster->setConfThresh(conf_thresh); -+ Mat_ refine_mask = Mat::zeros(3, 3, CV_8U); -+ if (ba_refine_mask[0] == 'x') refine_mask(0,0) = 1; -+ if (ba_refine_mask[1] == 'x') refine_mask(0,1) = 1; -+ if (ba_refine_mask[2] == 'x') refine_mask(0,2) = 1; -+ if (ba_refine_mask[3] == 'x') refine_mask(1,1) = 1; -+ if (ba_refine_mask[4] == 'x') refine_mask(1,2) = 1; -+ stitcher->adjuster->setRefinementMask(refine_mask); -+ (*stitcher->adjuster)(features, pairwise_matches, cameras); -+ -+ // Find median focal length -+ vector focals; -+ for (size_t i = 0; i < cameras.size(); ++i) { -+ //LOGLN("Camera #" << indices[i]+1 << ":\n" << cameras[i].K()); -+ focals.push_back(cameras[i].focal); -+ } -+ -+ sort(focals.begin(), focals.end()); -+ float warped_image_scale; -+ if (focals.size() % 2 == 1) -+ warped_image_scale = static_cast(focals[focals.size() / 2]); -+ else -+ warped_image_scale = static_cast(focals[focals.size() / 2 - 1] -+ + focals[focals.size() / 2]) * 0.5f; -+ -+ if (do_wave_correct) { -+ vector rmats; -+ for (size_t i = 0; i < cameras.size(); ++i) -+ rmats.push_back(cameras[i].R); -+ waveCorrect(rmats, wave_correct); -+ for (size_t i = 0; i < cameras.size(); ++i) -+ cameras[i].R = rmats[i]; -+ } -+ -+ GST_LOG_OBJECT (stitcher, "Warping images (auxiliary)... "); -+ t = getTickCount(); -+ -+ vector corners(num_images); -+ vector masks_warped(num_images); -+ vector images_warped(num_images); -+ vector sizes(num_images); -+ vector masks(num_images); -+ -+ // Preapre images masks -+ for (int i = 0; i < num_images; ++i) { -+ masks[i].create(images[i].size(), CV_8U); -+ masks[i].setTo(Scalar::all(255)); -+ } -+ -+ Ptr warper = stitcher->warper_creator->create( -+ static_cast(warped_image_scale * seam_work_aspect)); -+ -+ for (int i = 0; i < num_images; ++i) { -+ Mat_ K; -+ cameras[i].K().convertTo(K, CV_32F); -+ float swa = (float)seam_work_aspect; -+ K(0,0) *= swa; K(0,2) *= swa; -+ K(1,1) *= swa; K(1,2) *= swa; -+ -+ corners[i] = warper->warp(images[i], K, cameras[i].R, -+ INTER_LINEAR, BORDER_REFLECT, images_warped[i]); -+ sizes[i] = images_warped[i].size(); -+ -+ warper->warp(masks[i], K, cameras[i].R, INTER_NEAREST, -+ BORDER_CONSTANT, masks_warped[i]); -+ } -+ -+ vector images_warped_f(num_images); -+ for (int i = 0; i < num_images; ++i) -+ images_warped[i].convertTo(images_warped_f[i], CV_32F); -+ -+ GST_LOG_OBJECT (stitcher, "Warping images, time: %f sec", -+ ((getTickCount() - t) / getTickFrequency())); -+ -+ GST_LOG_OBJECT (stitcher, "seam finder..."); -+ t = getTickCount(); -+ -+ Ptr compensator = ExposureCompensator::createDefault(expos_comp_type); -+ compensator->feed(corners, images_warped, masks_warped); -+ -+ stitcher->seam_finder->find(images_warped_f, corners, masks_warped); -+ -+ // Release unused memory -+ images.clear(); -+ images_warped.clear(); -+ images_warped_f.clear(); -+ masks.clear(); -+ GST_LOG_OBJECT (stitcher, "seam finder, time: %f sec", -+ ((getTickCount() - t) / getTickFrequency())); -+ -+ GST_LOG_OBJECT (stitcher, "Compositing..."); -+ t = getTickCount(); -+ -+ Mat img_warped, img_warped_s; -+ Mat dilated_mask, seam_mask, mask, mask_warped; -+ //double compose_seam_aspect = 1; -+ double compose_work_aspect = 1; -+ Ptr blender; -+ -+ for (int img_idx = 0; img_idx < num_images; ++img_idx) { -+ //LOGLN("Compositing image #" << indices[img_idx]+1); -+ // Read image and resize it if necessary -+ IplImage *cvImage = (IplImage *) g_ptr_array_index (imgs, img_idx); -+ Mat in_mat(cvImage, false); -+ -+ full_img = in_mat; -+ if (!is_compose_scale_set) { -+ if (compose_megapix > 0) -+ compose_scale = min(1.0, sqrt(compose_megapix * 1e6 / full_img.size().area())); -+ is_compose_scale_set = true; -+ -+ // Compute relative scales -+ //compose_seam_aspect = compose_scale / seam_scale; -+ compose_work_aspect = compose_scale / work_scale; -+ -+ // Update warped image scale -+ warped_image_scale *= static_cast(compose_work_aspect); -+ warper = stitcher->warper_creator->create(warped_image_scale); -+ -+ // Update corners and sizes -+ for (int i = 0; i < num_images; ++i) { -+ // Update intrinsics -+ cameras[i].focal *= compose_work_aspect; -+ cameras[i].ppx *= compose_work_aspect; -+ cameras[i].ppy *= compose_work_aspect; -+ -+ // Update corner and size -+ Size sz = full_img_sizes[i]; -+ if (std::abs(compose_scale - 1) > 1e-1) { -+ sz.width = cvRound(full_img_sizes[i].width * compose_scale); -+ sz.height = cvRound(full_img_sizes[i].height * compose_scale); -+ } -+ -+ Mat K; -+ cameras[i].K().convertTo(K, CV_32F); -+ Rect roi = warper->warpRoi(sz, K, cameras[i].R); -+ corners[i] = roi.tl(); -+ sizes[i] = roi.size(); -+ } -+ } -+ if (abs(compose_scale - 1) > 1e-1) -+ resize(full_img, img, Size(), compose_scale, compose_scale); -+ else -+ img = full_img; -+ full_img.release(); -+ Size img_size = img.size(); -+ -+ Mat K; -+ cameras[img_idx].K().convertTo(K, CV_32F); -+ -+ // Warp the current image -+ warper->warp(img, K, cameras[img_idx].R, INTER_LINEAR, BORDER_REFLECT, img_warped); -+ -+ // Warp the current image mask -+ mask.create(img_size, CV_8U); -+ mask.setTo(Scalar::all(255)); -+ warper->warp(mask, K, cameras[img_idx].R, INTER_NEAREST, BORDER_CONSTANT, mask_warped); -+ -+ // Compensate exposure -+ compensator->apply(img_idx, corners[img_idx], img_warped, mask_warped); -+ -+ img_warped.convertTo(img_warped_s, CV_16S); -+ img_warped.release(); -+ img.release(); -+ mask.release(); -+ -+ dilate(masks_warped[img_idx], dilated_mask, Mat()); -+ resize(dilated_mask, seam_mask, mask_warped.size()); -+ mask_warped = seam_mask & mask_warped; -+ -+ if (blender.empty()) { -+ blender = Blender::createDefault(blend_type, try_gpu); -+ Size dst_sz = resultRoi(corners, sizes).size(); -+ float blend_width = sqrt(static_cast(dst_sz.area())) * blend_strength / 100.f; -+ if (blend_width < 1.f) -+ blender = Blender::createDefault(Blender::NO, try_gpu); -+ else if (blend_type == Blender::MULTI_BAND) { -+ MultiBandBlender* mb = dynamic_cast(static_cast(blender)); -+ mb->setNumBands(static_cast(ceil(log(blend_width)/log(2.)) - 1.)); -+ //LOGLN("Multi-band blender, number of bands: " << mb->numBands()); -+ } else if (blend_type == Blender::FEATHER) { -+ FeatherBlender* fb = dynamic_cast(static_cast(blender)); -+ fb->setSharpness(1.f/blend_width); -+ //LOGLN("Feather blender, sharpness: " << fb->sharpness()); -+ } -+ blender->prepare(corners, sizes); -+ } -+ -+ // Blend the current image -+ blender->feed(img_warped_s, mask_warped, corners[img_idx]); -+ } -+ -+ Mat result, result_mask; -+ blender->blend(result, result_mask); -+ -+ GST_LOG_OBJECT (stitcher, "Compositing, time: %f sec", ((getTickCount() - t) / getTickFrequency())); -+ -+ Mat m1(outimg->height, outimg->width, CV_8UC3), m2; -+ resize(result, m1, m1.size()); -+ m1.convertTo(m2, CV_8UC3); -+ memcpy(outimg->imageData, m2.data, outimg->imageSize); -+ -+ GST_LOG_OBJECT (stitcher, "Finished, total time: %f sec", ( -+ (getTickCount() - app_start_time) / getTickFrequency())); -+ -+ return TRUE; -+} -+ -+gboolean -+gst_cv_stitching_plugin_init (GstPlugin * plugin) -+{ -+ GST_DEBUG_CATEGORY_INIT (gst_cv_stitching_debug, "cvstitching", -+ 0, "Video or image stitching"); -+ -+ return gst_element_register (plugin, "cvstitching", GST_RANK_NONE, -+ GST_TYPE_CV_STITCHING); -+} -diff --git a/ext/opencv/gstcvstitching.h b/ext/opencv/gstcvstitching.h -new file mode 100644 -index 000000000000..ec955d063611 ---- /dev/null -+++ b/ext/opencv/gstcvstitching.h -@@ -0,0 +1,130 @@ -+/* -+ * GStreamer -+ * Copyright (C) 2015 Song Bing -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a -+ * copy of this software and associated documentation files (the "Software"), -+ * to deal in the Software without restriction, including without limitation -+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, -+ * and/or sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following conditions: -+ * -+ * The above copyright notice and this permission notice shall be included in -+ * all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -+ * DEALINGS IN THE SOFTWARE. -+ * -+ * Alternatively, the contents of this file may be used under the -+ * GNU Lesser General Public License Version 2.1 (the "LGPL"), in -+ * which case the following provisions apply instead of the ones -+ * mentioned above: -+ * -+ * 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_CV_STITCHING_H__ -+#define __GST_CV_STITCHING_H__ -+ -+#include -+#include "opencv2/opencv_modules.hpp" -+#include "opencv2/highgui/highgui.hpp" -+#include "opencv2/stitching/detail/autocalib.hpp" -+#include "opencv2/stitching/detail/blenders.hpp" -+#include "opencv2/stitching/detail/camera.hpp" -+#include "opencv2/stitching/detail/exposure_compensate.hpp" -+#include "opencv2/stitching/detail/matchers.hpp" -+#include "opencv2/stitching/detail/motion_estimators.hpp" -+#include "opencv2/stitching/detail/seam_finders.hpp" -+#include "opencv2/stitching/detail/util.hpp" -+#include "opencv2/stitching/detail/warpers.hpp" -+#include "opencv2/stitching/warpers.hpp" -+#include "gstopencvaggregator.h" -+ -+using namespace std; -+using namespace cv; -+using namespace cv::detail; -+ -+G_BEGIN_DECLS -+#define GST_TYPE_CV_STITCHING_PAD (gst_cv_stitching_pad_get_type()) -+#define GST_CV_STITCHING_PAD(obj) \ -+ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_CV_STITCHING_PAD, GstCvStitchingPad)) -+#define GST_CV_STITCHING_PAD_CLASS(klass) \ -+ (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_CV_STITCHING_PAD, GstCvStitchingPadClass)) -+#define GST_IS_CV_STITCHING_PAD(obj) \ -+ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_CV_STITCHING_PAD)) -+#define GST_IS_CV_STITCHING_PAD_CLASS(klass) \ -+ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_CV_STITCHING_PAD)) -+ -+typedef struct _GstCvStitchingPad GstCvStitchingPad; -+typedef struct _GstCvStitchingPadClass GstCvStitchingPadClass; -+ -+struct _GstCvStitchingPad -+{ -+ GstOpencvAggregatorPad parent; -+}; -+ -+struct _GstCvStitchingPadClass -+{ -+ GstOpencvAggregatorPadClass parent_class; -+}; -+ -+GType gst_cv_stitching_pad_get_type (void); -+ -+#define GST_TYPE_CV_STITCHING \ -+ (gst_cv_stitching_get_type()) -+#define GST_CV_STITCHING(obj) \ -+ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_CV_STITCHING,GstCvStitching)) -+#define GST_CV_STITCHING_CLASS(klass) \ -+ (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_CV_STITCHING,GstCvStitchingClass)) -+#define GST_IS_CV_STITCHING(obj) \ -+ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_CV_STITCHING)) -+#define GST_IS_CV_STITCHING_CLASS(klass) \ -+ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_CV_STITCHING)) -+ -+typedef struct _GstCvStitching GstCvStitching; -+typedef struct _GstCvStitchingClass GstCvStitchingClass; -+ -+struct _GstCvStitching -+{ -+ GstOpencvAggregator parent; -+ -+ Ptr finder; -+ Ptr warper_creator; -+ Ptr seam_finder; -+ Ptr adjuster; -+ gint features_type; -+ gint warp_type; -+ gint seam_find_type; -+ gint ba_cost_func; -+}; -+ -+struct _GstCvStitchingClass -+{ -+ GstOpencvAggregatorClass parent_class; -+}; -+ -+GType gst_cv_stitching_get_type (void); -+ -+gboolean gst_cv_stitching_plugin_init (GstPlugin * plugin); -+ -+G_END_DECLS -+#endif /* __GST_CV_STITCHING_H__ */ -diff --git a/ext/opencv/gstopencv.cpp b/ext/opencv/gstopencv.cpp -index 4077ba6e2ca8..6ae73c46ec00 100644 ---- a/ext/opencv/gstopencv.cpp -+++ b/ext/opencv/gstopencv.cpp -@@ -42,6 +42,7 @@ - #include "gstsegmentation.h" - #include "gstgrabcut.h" - #include "gstdisparity.h" -+#include "gstcvstitching.h" - - static gboolean - plugin_init (GstPlugin * plugin) -@@ -103,6 +104,9 @@ plugin_init (GstPlugin * plugin) - if (!gst_disparity_plugin_init (plugin)) - return FALSE; - -+ if (!gst_cv_stitching_plugin_init (plugin)) -+ return FALSE; -+ - return TRUE; - } - -diff --git a/ext/opencv/gstopencvaggregator.c b/ext/opencv/gstopencvaggregator.c -new file mode 100644 -index 000000000000..8a813fc2d9ca ---- /dev/null -+++ b/ext/opencv/gstopencvaggregator.c -@@ -0,0 +1,705 @@ -+/* -+ * GStreamer -+ * Copyright (C) 2015 Song Bing -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a -+ * copy of this software and associated documentation files (the "Software"), -+ * to deal in the Software without restriction, including without limitation -+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, -+ * and/or sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following conditions: -+ * -+ * The above copyright notice and this permission notice shall be included in -+ * all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -+ * DEALINGS IN THE SOFTWARE. -+ * -+ * Alternatively, the contents of this file may be used under the -+ * GNU Lesser General Public License Version 2.1 (the "LGPL"), in -+ * which case the following provisions apply instead of the ones -+ * mentioned above: -+ * -+ * 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 -+#endif -+ -+#include -+#include "gstopencvaggregator.h" -+#include "gstopencvutils.h" -+ -+#define gst_opencv_aggregator_parent_class parent_class -+G_DEFINE_ABSTRACT_TYPE (GstOpencvAggregator, gst_opencv_aggregator, -+ GST_TYPE_VIDEO_AGGREGATOR); -+ -+G_DEFINE_TYPE (GstOpencvAggregatorPad, gst_opencv_aggregator_pad, -+ GST_TYPE_VIDEO_AGGREGATOR_PAD); -+ -+#define GST_CAT_DEFAULT gst_opencv_aggregator_debug -+GST_DEBUG_CATEGORY (gst_opencv_aggregator_debug); -+ -+static void gst_opencv_aggregator_pad_get_property (GObject * object, -+ guint prop_id, GValue * value, GParamSpec * pspec); -+static void gst_opencv_aggregator_pad_set_property (GObject * object, -+ guint prop_id, const GValue * value, GParamSpec * pspec); -+ -+enum -+{ -+ PROP_PAD_0 -+}; -+ -+#define GST_OPENCV_AGGREGATOR_GET_PRIVATE(obj) \ -+ (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_OPENCV_AGGREGATOR, \ -+ GstOpencvAggregatorPrivate)) -+ -+struct _GstOpencvAggregatorPrivate -+{ -+ gboolean set_caps; -+ GstBufferPool *pool; -+ gboolean pool_active; -+ GstAllocator *allocator; -+ GstAllocationParams params; -+ GstQuery *query; -+ -+ GPtrArray *imgs; -+ GPtrArray *in_infos; -+ IplImage *out_cvImage; -+}; -+ -+static void -+gst_opencv_aggregator_pad_class_init (GstOpencvAggregatorPadClass * klass) -+{ -+ GObjectClass *gobject_class = (GObjectClass *) klass; -+ -+ gobject_class->set_property = gst_opencv_aggregator_pad_set_property; -+ gobject_class->get_property = gst_opencv_aggregator_pad_get_property; -+} -+ -+static void -+gst_opencv_aggregator_pad_init (GstOpencvAggregatorPad * aggregatorerpad) -+{ -+} -+ -+static void -+gst_opencv_aggregator_pad_get_property (GObject * object, guint prop_id, -+ GValue * value, GParamSpec * pspec) -+{ -+ switch (prop_id) { -+ default: -+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); -+ break; -+ } -+} -+ -+static void -+gst_opencv_aggregator_pad_set_property (GObject * object, guint prop_id, -+ const GValue * value, GParamSpec * pspec) -+{ -+ switch (prop_id) { -+ default: -+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); -+ break; -+ } -+} -+ -+enum -+{ -+ PROP_0 -+}; -+ -+static void gst_opencv_aggregator_set_property (GObject * object, guint prop_id, -+ const GValue * value, GParamSpec * pspec); -+static void gst_opencv_aggregator_get_property (GObject * object, guint prop_id, -+ GValue * value, GParamSpec * pspec); -+static gboolean gst_opencv_aggregator_start (GstAggregator * agg); -+static gboolean gst_opencv_aggregator_stop (GstAggregator * agg); -+static GstFlowReturn -+gst_opencv_aggregator_get_output_buffer (GstVideoAggregator * videoaggregator, -+ GstBuffer ** outbuf); -+static GstFlowReturn -+gst_opencv_aggregator_aggregate_frames (GstVideoAggregator * vagg, -+ GstBuffer * outbuffer); -+static gboolean -+gst_opencv_aggregator_sink_query (GstAggregator * agg, GstAggregatorPad * bpad, -+ GstQuery * query); -+static gboolean -+gst_opencv_aggregator_negotiated_caps (GstVideoAggregator * vagg, -+ GstCaps * caps); -+static gboolean -+gst_opencv_aggregator_decide_allocation_default (GstOpencvAggregator * -+ aggregator, GstQuery * query); -+static gboolean -+gst_opencv_aggregator_propose_allocation_default (GstOpencvAggregator * -+ aggregator, GstQuery * query); -+ -+static void -+gst_opencv_aggregator_class_init (GstOpencvAggregatorClass * klass) -+{ -+ GObjectClass *gobject_class; -+ -+ GstVideoAggregatorClass *videoaggregator_class = -+ (GstVideoAggregatorClass *) klass; -+ GstAggregatorClass *agg_class = (GstAggregatorClass *) klass; -+ -+ GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, "opencvaggregator", 0, -+ "opencv aggregator"); -+ -+ gobject_class = (GObjectClass *) klass; -+ -+ g_type_class_add_private (klass, sizeof (GstOpencvAggregatorPrivate)); -+ -+ gobject_class->get_property = gst_opencv_aggregator_get_property; -+ gobject_class->set_property = gst_opencv_aggregator_set_property; -+ -+ agg_class->sinkpads_type = GST_TYPE_OPENCV_AGGREGATOR_PAD; -+ agg_class->sink_query = gst_opencv_aggregator_sink_query; -+ agg_class->stop = gst_opencv_aggregator_stop; -+ agg_class->start = gst_opencv_aggregator_start; -+ -+ videoaggregator_class->aggregate_frames = -+ gst_opencv_aggregator_aggregate_frames; -+ videoaggregator_class->get_output_buffer = -+ gst_opencv_aggregator_get_output_buffer; -+ videoaggregator_class->negotiated_caps = -+ gst_opencv_aggregator_negotiated_caps; -+ -+ klass->decide_allocation = gst_opencv_aggregator_decide_allocation_default; -+ klass->propose_allocation = gst_opencv_aggregator_propose_allocation_default; -+} -+ -+static void -+gst_opencv_aggregator_reset (GstOpencvAggregator * aggregator) -+{ -+ aggregator->priv->set_caps = FALSE; -+} -+ -+static void -+gst_opencv_aggregator_init (GstOpencvAggregator * aggregator) -+{ -+ aggregator->priv = GST_OPENCV_AGGREGATOR_GET_PRIVATE (aggregator); -+ -+ gst_opencv_aggregator_reset (aggregator); -+} -+ -+static void -+gst_opencv_aggregator_get_property (GObject * object, -+ guint prop_id, GValue * value, GParamSpec * pspec) -+{ -+ switch (prop_id) { -+ default: -+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); -+ break; -+ } -+} -+ -+static void -+gst_opencv_aggregator_set_property (GObject * object, -+ guint prop_id, const GValue * value, GParamSpec * pspec) -+{ -+ switch (prop_id) { -+ default: -+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); -+ break; -+ } -+} -+ -+static void -+_free_opencv_aggregator_img (IplImage * img) -+{ -+ cvReleaseImage (&img); -+} -+ -+static void -+_free_opencv_aggregator_in_info (GstMapInfo * info) -+{ -+ g_slice_free1 (sizeof (GstMapInfo), info); -+} -+ -+static gboolean -+gst_opencv_aggregator_start (GstAggregator * agg) -+{ -+ GstOpencvAggregator *aggregator = GST_OPENCV_AGGREGATOR (agg); -+ GstElement *element = GST_ELEMENT (agg); -+ -+ if (!GST_AGGREGATOR_CLASS (parent_class)->start (agg)) -+ return FALSE; -+ -+ GST_OBJECT_LOCK (aggregator); -+ aggregator->priv->imgs = g_ptr_array_new_full (element->numsinkpads, -+ (GDestroyNotify) _free_opencv_aggregator_img); -+ g_ptr_array_set_size (aggregator->priv->imgs, element->numsinkpads); -+ -+ aggregator->priv->in_infos = g_ptr_array_new_full (element->numsinkpads, -+ (GDestroyNotify) _free_opencv_aggregator_in_info); -+ g_ptr_array_set_size (aggregator->priv->in_infos, element->numsinkpads); -+ GST_OBJECT_UNLOCK (aggregator); -+ -+ return TRUE; -+} -+ -+static gboolean -+gst_opencv_aggregator_stop (GstAggregator * agg) -+{ -+ GstOpencvAggregator *aggregator = GST_OPENCV_AGGREGATOR (agg); -+ -+ GST_OBJECT_LOCK (agg); -+ g_ptr_array_free (aggregator->priv->imgs, TRUE); -+ aggregator->priv->imgs = NULL; -+ g_ptr_array_free (aggregator->priv->in_infos, TRUE); -+ aggregator->priv->in_infos = NULL; -+ GST_OBJECT_UNLOCK (agg); -+ -+ if (aggregator->priv->pool) { -+ gst_object_unref (aggregator->priv->pool); -+ aggregator->priv->pool = NULL; -+ } -+ -+ if (aggregator->priv->out_cvImage) -+ cvReleaseImage (&aggregator->priv->out_cvImage); -+ -+ gst_opencv_aggregator_reset (aggregator); -+ -+ return GST_AGGREGATOR_CLASS (parent_class)->stop (agg); -+} -+ -+static gboolean -+gst_opencv_aggregator_sink_query (GstAggregator * agg, GstAggregatorPad * bpad, -+ GstQuery * query) -+{ -+ gboolean ret = FALSE; -+ GstOpencvAggregator *aggregator = GST_OPENCV_AGGREGATOR (agg); -+ GstOpencvAggregatorClass *klass = GST_OPENCV_AGGREGATOR_GET_CLASS (agg); -+ -+ GST_TRACE ("QUERY %" GST_PTR_FORMAT, query); -+ -+ switch (GST_QUERY_TYPE (query)) { -+ case GST_QUERY_ALLOCATION:{ -+ if (klass->propose_allocation) -+ ret = klass->propose_allocation (aggregator, query); -+ break; -+ } -+ default: -+ ret = GST_AGGREGATOR_CLASS (parent_class)->sink_query (agg, bpad, query); -+ break; -+ } -+ -+ return ret; -+} -+ -+static gboolean -+gst_opencv_aggregator_decide_allocation_default (GstOpencvAggregator * -+ aggregator, GstQuery * query) -+{ -+ GstCaps *outcaps = NULL; -+ GstBufferPool *pool = NULL; -+ guint size, min, max; -+ GstAllocator *allocator = NULL; -+ GstAllocationParams params; -+ GstStructure *config; -+ gboolean update_pool, update_allocator; -+ GstVideoInfo vinfo; -+ -+ gst_query_parse_allocation (query, &outcaps, NULL); -+ gst_video_info_init (&vinfo); -+ if (outcaps) -+ gst_video_info_from_caps (&vinfo, outcaps); -+ -+ /* we got configuration from our peer or the decide_allocation method, -+ * parse them */ -+ if (gst_query_get_n_allocation_params (query) > 0) { -+ /* try the allocator */ -+ gst_query_parse_nth_allocation_param (query, 0, &allocator, ¶ms); -+ update_allocator = TRUE; -+ } else { -+ allocator = NULL; -+ gst_allocation_params_init (¶ms); -+ update_allocator = FALSE; -+ } -+ -+ if (gst_query_get_n_allocation_pools (query) > 0) { -+ gst_query_parse_nth_allocation_pool (query, 0, &pool, &size, &min, &max); -+ size = MAX (size, vinfo.size); -+ update_pool = TRUE; -+ } else { -+ pool = NULL; -+ size = vinfo.size; -+ min = max = 0; -+ -+ update_pool = FALSE; -+ } -+ -+ if (pool == NULL) { -+ /* no pool, we can make our own */ -+ GST_DEBUG_OBJECT (aggregator, "no pool, making new pool"); -+ pool = gst_video_buffer_pool_new (); -+ } -+ -+ /* now configure */ -+ config = gst_buffer_pool_get_config (pool); -+ gst_buffer_pool_config_set_params (config, outcaps, size, min, max); -+ gst_buffer_pool_config_set_allocator (config, allocator, ¶ms); -+ -+ if (!gst_buffer_pool_set_config (pool, config)) { -+ config = gst_buffer_pool_get_config (pool); -+ -+ /* If change are not acceptable, fallback to generic pool */ -+ if (!gst_buffer_pool_config_validate_params (config, outcaps, size, min, -+ max)) { -+ GST_DEBUG_OBJECT (aggregator, "unsuported pool, making new pool"); -+ -+ gst_object_unref (pool); -+ pool = gst_video_buffer_pool_new (); -+ gst_buffer_pool_config_set_params (config, outcaps, size, min, max); -+ gst_buffer_pool_config_set_allocator (config, allocator, ¶ms); -+ } -+ -+ if (!gst_buffer_pool_set_config (pool, config)) -+ goto config_failed; -+ } -+ -+ if (update_allocator) -+ gst_query_set_nth_allocation_param (query, 0, allocator, ¶ms); -+ else -+ gst_query_add_allocation_param (query, allocator, ¶ms); -+ if (allocator) -+ gst_object_unref (allocator); -+ -+ if (update_pool) -+ gst_query_set_nth_allocation_pool (query, 0, pool, size, min, max); -+ else -+ gst_query_add_allocation_pool (query, pool, size, min, max); -+ -+ if (pool) -+ gst_object_unref (pool); -+ -+ return TRUE; -+ -+config_failed: -+ if (allocator) -+ gst_object_unref (allocator); -+ if (pool) -+ gst_object_unref (pool); -+ GST_ELEMENT_ERROR (aggregator, RESOURCE, SETTINGS, -+ ("Failed to configure the buffer pool"), -+ ("Configuration is most likely invalid, please report this issue.")); -+ return FALSE; -+} -+ -+static gboolean -+gst_opencv_aggregator_propose_allocation_default (GstOpencvAggregator * -+ aggregator, GstQuery * query) -+{ -+ GstCaps *caps; -+ GstVideoInfo info; -+ GstBufferPool *pool; -+ guint size; -+ -+ gst_query_parse_allocation (query, &caps, NULL); -+ -+ if (caps == NULL) -+ return FALSE; -+ -+ if (!gst_video_info_from_caps (&info, caps)) -+ return FALSE; -+ -+ size = GST_VIDEO_INFO_SIZE (&info); -+ -+ if (gst_query_get_n_allocation_pools (query) == 0) { -+ GstStructure *structure; -+ GstAllocator *allocator = NULL; -+ GstAllocationParams params = { 0, 15, 0, 0 }; -+ -+ if (gst_query_get_n_allocation_params (query) > 0) -+ gst_query_parse_nth_allocation_param (query, 0, &allocator, ¶ms); -+ else -+ gst_query_add_allocation_param (query, allocator, ¶ms); -+ -+ pool = gst_video_buffer_pool_new (); -+ -+ structure = gst_buffer_pool_get_config (pool); -+ gst_buffer_pool_config_set_params (structure, caps, size, 0, 0); -+ gst_buffer_pool_config_set_allocator (structure, allocator, ¶ms); -+ -+ if (allocator) -+ gst_object_unref (allocator); -+ -+ if (!gst_buffer_pool_set_config (pool, structure)) -+ goto config_failed; -+ -+ gst_query_add_allocation_pool (query, pool, size, 0, 0); -+ gst_object_unref (pool); -+ gst_query_add_allocation_meta (query, GST_VIDEO_META_API_TYPE, NULL); -+ } -+ -+ return TRUE; -+ -+ /* ERRORS */ -+config_failed: -+ { -+ GST_ERROR_OBJECT (aggregator, "failed to set config"); -+ gst_object_unref (pool); -+ return FALSE; -+ } -+} -+ -+static gboolean -+gst_opencv_aggregator_negotiate_pool (GstOpencvAggregator * aggregator, -+ GstCaps * caps) -+{ -+ GstAggregator *agg = GST_AGGREGATOR (aggregator); -+ GstOpencvAggregatorClass *klass; -+ GstQuery *query = NULL; -+ GstBufferPool *pool = NULL; -+ GstAllocator *allocator; -+ GstAllocationParams params; -+ gboolean ret = TRUE; -+ -+ klass = GST_OPENCV_AGGREGATOR_GET_CLASS (aggregator); -+ -+ query = gst_query_new_allocation (caps, TRUE); -+ -+ if (!gst_pad_peer_query (agg->srcpad, query)) { -+ GST_DEBUG_OBJECT (aggregator, "didn't get downstream ALLOCATION hints"); -+ } -+ -+ g_assert (klass->decide_allocation != NULL); -+ ret = klass->decide_allocation (aggregator, query); -+ -+ GST_DEBUG_OBJECT (aggregator, "ALLOCATION (%d) params: %" GST_PTR_FORMAT, ret, -+ query); -+ -+ if (!ret) -+ goto no_decide_allocation; -+ -+ /* we got configuration from our peer or the decide_allocation method, -+ * parse them */ -+ if (gst_query_get_n_allocation_params (query) > 0) { -+ gst_query_parse_nth_allocation_param (query, 0, &allocator, ¶ms); -+ } else { -+ allocator = NULL; -+ gst_allocation_params_init (¶ms); -+ } -+ -+ if (gst_query_get_n_allocation_pools (query) > 0) -+ gst_query_parse_nth_allocation_pool (query, 0, &pool, NULL, NULL, NULL); -+ if (!pool) { -+ if (allocator) -+ gst_object_unref (allocator); -+ ret = FALSE; -+ goto no_decide_allocation; -+ } -+ -+ if (aggregator->priv->allocator) -+ gst_object_unref (aggregator->priv->allocator); -+ aggregator->priv->allocator = allocator; -+ aggregator->priv->params = params; -+ -+ if (aggregator->priv->pool) { -+ /* do not set the bufferpool to inactive here, it will be done -+ * on its finalize function. As videoaggregator do late renegotiation -+ * it might happen that some element downstream is already using this -+ * same bufferpool and deactivating it will make it fail. -+ * Happens when a downstream element changes from passthrough to -+ * non-passthrough and gets this same bufferpool to use */ -+ gst_object_unref (aggregator->priv->pool); -+ } -+ aggregator->priv->pool = pool; -+ -+ /* and activate */ -+ gst_buffer_pool_set_active (pool, TRUE); -+ -+done: -+ if (query) -+ gst_query_unref (query); -+ -+ return ret; -+ -+ /* Errors */ -+no_decide_allocation: -+ { -+ GST_WARNING_OBJECT (aggregator, "Subclass failed to decide allocation"); -+ goto done; -+ } -+} -+ -+static gboolean -+gst_opencv_aggregator_negotiated_caps (GstVideoAggregator * vagg, -+ GstCaps * caps) -+{ -+ GstOpencvAggregator *aggregator = GST_OPENCV_AGGREGATOR (vagg); -+ gint out_width, out_height; -+ gint out_depth, out_channels; -+ GError *out_err = NULL; -+ -+ if (!gst_opencv_parse_iplimage_params_from_caps (caps, &out_width, -+ &out_height, &out_depth, &out_channels, &out_err)) { -+ GST_WARNING_OBJECT (aggregator, "Failed to parse output caps: %s", -+ out_err->message); -+ g_error_free (out_err); -+ return FALSE; -+ } -+ -+ if (aggregator->priv->out_cvImage) -+ cvReleaseImage (&aggregator->priv->out_cvImage); -+ -+ aggregator->priv->out_cvImage = -+ cvCreateImageHeader (cvSize (out_width, out_height), out_depth, -+ out_channels); -+ -+ return gst_opencv_aggregator_negotiate_pool (aggregator, caps); -+} -+ -+static GstFlowReturn -+gst_opencv_aggregator_get_output_buffer (GstVideoAggregator * videoaggregator, -+ GstBuffer ** outbuf) -+{ -+ GstOpencvAggregator *aggregator = GST_OPENCV_AGGREGATOR (videoaggregator); -+ -+ return gst_buffer_pool_acquire_buffer (aggregator->priv->pool, outbuf, NULL); -+} -+ -+static GstFlowReturn -+gst_opencv_aggregator_aggregate_frames (GstVideoAggregator * vagg, -+ GstBuffer * outbuf) -+{ -+ GstOpencvAggregator *aggregator = GST_OPENCV_AGGREGATOR (vagg); -+ GstOpencvAggregatorClass *aggregator_class = -+ GST_OPENCV_AGGREGATOR_GET_CLASS (vagg); -+ GstElement *element = GST_ELEMENT (aggregator); -+ GstMapInfo out_info; -+ guint array_index = 0; -+ gboolean res = FALSE; -+ GList *walk; -+ guint i; -+ -+ if (!aggregator->priv->set_caps) { -+ gint in_width, in_height; -+ gint in_depth, in_channels; -+ GError *in_err = NULL; -+ -+ GST_OBJECT_LOCK (aggregator); -+ walk = element->sinkpads; -+ while (walk) { -+ GstVideoAggregatorPad *vaggpad = walk->data; -+ GstCaps *caps = gst_video_info_to_caps (&vaggpad->info); -+ -+ walk = g_list_next (walk); -+ -+ GST_WARNING_OBJECT (aggregator, "sink pad caps: %" GST_PTR_FORMAT, caps); -+ if (!gst_opencv_parse_iplimage_params_from_caps (caps, &in_width, -+ &in_height, &in_depth, &in_channels, &in_err)) { -+ GST_WARNING_OBJECT (aggregator, "Failed to parse input caps: %s", -+ in_err->message); -+ g_error_free (in_err); -+ gst_caps_unref (caps); -+ return FALSE; -+ } -+ gst_caps_unref (caps); -+ -+ aggregator->priv->imgs->pdata[array_index] = -+ cvCreateImageHeader (cvSize (in_width, in_height), in_depth, -+ in_channels); -+ aggregator->priv->in_infos->pdata[array_index] = -+ g_slice_new0 (GstMapInfo); -+ array_index++; -+ } -+ GST_OBJECT_UNLOCK (aggregator); -+ aggregator->priv->set_caps = TRUE; -+ } -+ -+ array_index = 0; -+ GST_OBJECT_LOCK (aggregator); -+ walk = GST_ELEMENT (aggregator)->sinkpads; -+ while (walk) { -+ GstVideoAggregatorPad *vaggpad = walk->data; -+ IplImage *cvImage; -+ GstMapInfo *in_info = aggregator->priv->in_infos->pdata[array_index]; -+ -+ walk = g_list_next (walk); -+ -+ if (!gst_buffer_map (vaggpad->buffer, in_info, GST_MAP_READ)) -+ goto inbuf_map_failed; -+ -+ cvImage = aggregator->priv->imgs->pdata[array_index]; -+ cvImage->imageData = (char *) in_info->data; -+ ++array_index; -+ } -+ GST_OBJECT_UNLOCK (aggregator); -+ -+ if (!gst_buffer_map (outbuf, &out_info, GST_MAP_WRITE)) -+ goto outbuf_map_failed; -+ -+ aggregator->priv->out_cvImage->imageData = (char *) out_info.data; -+ -+ res = -+ aggregator_class->GstOpencvAggregatorProcess (aggregator, -+ aggregator->priv->imgs, aggregator->priv->out_cvImage); -+ -+ GST_OBJECT_LOCK (aggregator); -+ walk = GST_ELEMENT (aggregator)->sinkpads; -+ array_index = 0; -+ while (walk) { -+ GstVideoAggregatorPad *vaggpad = walk->data; -+ GstMapInfo *in_info = aggregator->priv->in_infos->pdata[array_index]; -+ walk = g_list_next (walk); -+ gst_buffer_unmap (vaggpad->buffer, in_info); -+ ++array_index; -+ } -+ GST_OBJECT_UNLOCK (aggregator); -+ -+ gst_buffer_unmap (outbuf, &out_info); -+ -+ return res ? GST_FLOW_OK : GST_FLOW_ERROR; -+ -+inbuf_map_failed: -+ GST_ELEMENT_ERROR (aggregator, RESOURCE, READ, -+ ("Failed to map buffer for reading"), (NULL)); -+ walk = GST_ELEMENT (aggregator)->sinkpads; -+ for (i = 0; i < array_index; i++) { -+ GstVideoAggregatorPad *vaggpad = walk->data; -+ GstMapInfo *in_info = aggregator->priv->in_infos->pdata[array_index]; -+ walk = g_list_next (walk); -+ gst_buffer_unmap (vaggpad->buffer, in_info); -+ ++array_index; -+ } -+ GST_OBJECT_UNLOCK (aggregator); -+ return GST_FLOW_ERROR; -+ -+outbuf_map_failed: -+ GST_ELEMENT_ERROR (aggregator, RESOURCE, WRITE, -+ ("Failed to map buffer for writing"), (NULL)); -+ GST_OBJECT_LOCK (aggregator); -+ walk = GST_ELEMENT (aggregator)->sinkpads; -+ array_index = 0; -+ while (walk) { -+ GstVideoAggregatorPad *vaggpad = walk->data; -+ GstMapInfo *in_info = aggregator->priv->in_infos->pdata[array_index]; -+ walk = g_list_next (walk); -+ gst_buffer_unmap (vaggpad->buffer, in_info); -+ ++array_index; -+ } -+ GST_OBJECT_UNLOCK (aggregator); -+ -+ return GST_FLOW_ERROR; -+} -diff --git a/ext/opencv/gstopencvaggregator.h b/ext/opencv/gstopencvaggregator.h -new file mode 100644 -index 000000000000..1fc65a5a1783 ---- /dev/null -+++ b/ext/opencv/gstopencvaggregator.h -@@ -0,0 +1,118 @@ -+/* -+ * GStreamer -+ * Copyright (C) 2015 Song Bing -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a -+ * copy of this software and associated documentation files (the "Software"), -+ * to deal in the Software without restriction, including without limitation -+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, -+ * and/or sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following conditions: -+ * -+ * The above copyright notice and this permission notice shall be included in -+ * all copies or substantial portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -+ * DEALINGS IN THE SOFTWARE. -+ * -+ * Alternatively, the contents of this file may be used under the -+ * GNU Lesser General Public License Version 2.1 (the "LGPL"), in -+ * which case the following provisions apply instead of the ones -+ * mentioned above: -+ * -+ * 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_OPENCV_AGGREGATOR_H__ -+#define __GST_OPENCV_AGGREGATOR_H__ -+ -+#include -+#include -+#include -+ -+G_BEGIN_DECLS -+#define GST_TYPE_OPENCV_AGGREGATOR_PAD (gst_opencv_aggregator_pad_get_type()) -+#define GST_OPENCV_AGGREGATOR_PAD(obj) \ -+ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_OPENCV_AGGREGATOR_PAD, GstOpencvAggregatorPad)) -+#define GST_OPENCV_AGGREGATOR_PAD_CLASS(klass) \ -+ (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_OPENCV_AGGREGATOR_PAD, GstOpencvAggregatorPadClass)) -+#define GST_IS_OPENCV_AGGREGATOR_PAD(obj) \ -+ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_OPENCV_AGGREGATOR_PAD)) -+#define GST_IS_OPENCV_AGGREGATOR_PAD_CLASS(klass) \ -+ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_OPENCV_AGGREGATOR_PAD)) -+#define GST_OPENCV_AGGREGATOR_PAD_GET_CLASS(obj) \ -+ (G_TYPE_INSTANCE_GET_CLASS((obj),GST_TYPE_OPENCV_AGGREGATOR_PAD,GstOpencvAggregatorPadClass)) -+typedef struct _GstOpencvAggregatorPad GstOpencvAggregatorPad; -+typedef struct _GstOpencvAggregatorPadClass GstOpencvAggregatorPadClass; -+ -+struct _GstOpencvAggregatorPad -+{ -+ GstVideoAggregatorPad parent; -+}; -+ -+struct _GstOpencvAggregatorPadClass -+{ -+ GstVideoAggregatorPadClass parent_class; -+}; -+ -+GType gst_opencv_aggregator_pad_get_type (void); -+ -+#define GST_TYPE_OPENCV_AGGREGATOR \ -+ (gst_opencv_aggregator_get_type()) -+#define GST_OPENCV_AGGREGATOR(obj) \ -+ (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_OPENCV_AGGREGATOR,GstOpencvAggregator)) -+#define GST_OPENCV_AGGREGATOR_CLASS(klass) \ -+ (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_OPENCV_AGGREGATOR,GstOpencvAggregatorClass)) -+#define GST_IS_OPENCV_AGGREGATOR(obj) \ -+ (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_OPENCV_AGGREGATOR)) -+#define GST_IS_OPENCV_AGGREGATOR_CLASS(klass) \ -+ (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_OPENCV_AGGREGATOR)) -+#define GST_OPENCV_AGGREGATOR_GET_CLASS(obj) \ -+ (G_TYPE_INSTANCE_GET_CLASS((obj),GST_TYPE_OPENCV_AGGREGATOR,GstOpencvAggregatorClass)) -+#define GST_OPENCV_AGGREGATOR_CAST(obj) ((GstOpencvAggregator *) (obj)) -+ -+typedef struct _GstOpencvAggregator GstOpencvAggregator; -+typedef struct _GstOpencvAggregatorClass GstOpencvAggregatorClass; -+typedef struct _GstOpencvAggregatorPrivate GstOpencvAggregatorPrivate; -+ -+struct _GstOpencvAggregator -+{ -+ GstVideoAggregator parent; -+ -+ GstOpencvAggregatorPrivate *priv; -+}; -+ -+struct _GstOpencvAggregatorClass -+{ -+ GstVideoAggregatorClass parent_class; -+ -+ gboolean (*GstOpencvAggregatorProcess) (GstOpencvAggregator * aggregrator, -+ GPtrArray * imgs, IplImage * outimg); -+ gboolean (*decide_allocation) (GstOpencvAggregator * aggretator, -+ GstQuery * query); -+ gboolean (*propose_allocation) (GstOpencvAggregator * aggretator, -+ GstQuery * query); -+}; -+ -+GType gst_opencv_aggregator_get_type (void); -+ -+G_END_DECLS -+#endif /* __GST_OPENCV_AGGREGATOR_H__ */ diff --git a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0007-camerabin-Add-one-property-to-set-sink-element-for-v.patch b/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0007-camerabin-Add-one-property-to-set-sink-element-for-v.patch deleted file mode 100644 index 46e463085..000000000 --- a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0007-camerabin-Add-one-property-to-set-sink-element-for-v.patch +++ /dev/null @@ -1,180 +0,0 @@ -From b19b98028730e772d7044375b79e4f5508c5a6a3 Mon Sep 17 00:00:00 2001 -From: Song Bing -Date: Fri, 13 Mar 2015 17:31:29 +0800 -Subject: [PATCH] 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] - -Signed-off-by: Lyon Wang ---- - 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 d0876d5ecc59..31c1e7f5668d 100644 ---- a/gst/camerabin2/gstcamerabin2.c -+++ b/gst/camerabin2/gstcamerabin2.c -@@ -220,6 +220,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, -@@ -359,7 +360,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; -@@ -494,10 +495,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 -@@ -552,6 +556,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) -@@ -672,6 +678,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 " -@@ -1536,13 +1548,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) { -@@ -1665,7 +1694,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); - } - -@@ -2031,6 +2062,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), -@@ -2063,6 +2108,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); -@@ -2246,6 +2294,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 ba55a7ea0dff..9e090b62b677 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; diff --git a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0008-Fix-for-gl-plugin-not-built-in-wayland-backend.patch b/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0008-Fix-for-gl-plugin-not-built-in-wayland-backend.patch deleted file mode 100644 index 45676db75..000000000 --- a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0008-Fix-for-gl-plugin-not-built-in-wayland-backend.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 9af5efc2a92bc1ade61eed31a5192ea4bb253549 Mon Sep 17 00:00:00 2001 -From: Jian -Date: Fri, 24 Apr 2015 17:12:02 +0800 -Subject: [PATCH] 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 -Signed-off-by: Lyon Wang ---- - configure.ac | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index 622e5bb16278..63cc7161cec5 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -789,7 +789,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) - ;; - esac - diff --git a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0009-gl-wayland-fix-loop-test-hang-in-glimagesink.patch b/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0009-gl-wayland-fix-loop-test-hang-in-glimagesink.patch deleted file mode 100644 index c3eff5d9b..000000000 --- a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0009-gl-wayland-fix-loop-test-hang-in-glimagesink.patch +++ /dev/null @@ -1,140 +0,0 @@ -From e15e7af522d381cf84f350d1415f1f4571ff9b26 Mon Sep 17 00:00:00 2001 -From: Haihua Hu -Date: Sun, 6 Dec 2015 14:25:44 +0800 -Subject: [PATCH] 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 -Signed-off-by: Lyon Wang ---- - 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 48b37a2e5a22..da35bf06d666 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 e0166dabb7af..d148a449a216 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; diff --git a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0010-Fix-glimagesink-wayland-resize-showed-blurred-screen.patch b/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0010-Fix-glimagesink-wayland-resize-showed-blurred-screen.patch deleted file mode 100644 index 93a6247bf..000000000 --- a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0010-Fix-glimagesink-wayland-resize-showed-blurred-screen.patch +++ /dev/null @@ -1,30 +0,0 @@ -From 057c8d382366f51501a014749f953ce4b702c076 Mon Sep 17 00:00:00 2001 -From: Haihua Hu -Date: Tue, 8 Dec 2015 16:06:34 +0800 -Subject: [PATCH] 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 -Signed-off-by: Lyon Wang ---- - 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 da35bf06d666..b20be22f1fbf 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); - } - } - diff --git a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0011-support-video-crop-for-glimagesink.patch b/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0011-support-video-crop-for-glimagesink.patch deleted file mode 100644 index d06a56658..000000000 --- a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0011-support-video-crop-for-glimagesink.patch +++ /dev/null @@ -1,149 +0,0 @@ -From 226e80315925bb722cfdd5716e078832f3f6b3c4 Mon Sep 17 00:00:00 2001 -From: Haihua Hu -Date: Fri, 13 Nov 2015 10:51:25 +0800 -Subject: [PATCH] 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 -Signed-off-by: Lyon Wang ---- - 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 0bac4fb1c118..196757adfbac 100644 ---- a/ext/gl/gstglimagesink.c -+++ b/ext/gl/gstglimagesink.c -@@ -601,6 +601,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; -@@ -1062,6 +1064,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; -@@ -1546,6 +1554,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; -@@ -2028,6 +2038,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); - else -diff --git a/ext/gl/gstglimagesink.h b/ext/gl/gstglimagesink.h -index 6e9b98e74a88..317055a016ed 100644 ---- a/ext/gl/gstglimagesink.h -+++ b/ext/gl/gstglimagesink.h -@@ -107,6 +107,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 86e8b01e2407..1738c2f81c1d 100644 ---- a/ext/gl/gstgluploadelement.c -+++ b/ext/gl/gstgluploadelement.c -@@ -232,9 +232,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; - } - diff --git a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0012-Add-fps-print-in-glimagesink.patch b/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0012-Add-fps-print-in-glimagesink.patch deleted file mode 100644 index 325ec0710..000000000 --- a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0012-Add-fps-print-in-glimagesink.patch +++ /dev/null @@ -1,81 +0,0 @@ -From f6edb394cc6ada3ce98e2cf9021e6a2ead3b4daf Mon Sep 17 00:00:00 2001 -From: Haihua Hu -Date: Wed, 18 Nov 2015 15:10:22 +0800 -Subject: [PATCH] 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 -Signed-off-by: Lyon Wang ---- - 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 196757adfbac..185577f2a07e 100644 ---- a/ext/gl/gstglimagesink.c -+++ b/ext/gl/gstglimagesink.c -@@ -603,6 +603,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; -@@ -978,7 +980,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]; -@@ -1070,6 +1075,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; -@@ -1568,6 +1581,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 317055a016ed..f9a052a12ed8 100644 ---- a/ext/gl/gstglimagesink.h -+++ b/ext/gl/gstglimagesink.h -@@ -125,6 +125,10 @@ struct _GstGLImageSink - GstGLStereoDownmix mview_downmix_mode; - - GstGLOverlayCompositor *overlay_compositor; -+ -+ /* fps print support */ -+ guint64 frame_showed; -+ GstClockTime run_time; - }; - - struct _GstGLImageSinkClass diff --git a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0013-glimagesink-support-video-rotation-using-transform-m.patch b/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0013-glimagesink-support-video-rotation-using-transform-m.patch deleted file mode 100644 index d85a0506a..000000000 --- a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0013-glimagesink-support-video-rotation-using-transform-m.patch +++ /dev/null @@ -1,570 +0,0 @@ -From 0d53611c59d1c29f1d1cf22f62a50ae1ee21096b Mon Sep 17 00:00:00 2001 -From: Haihua Hu -Date: Mon, 9 May 2016 20:26:51 +0800 -Subject: [PATCH] glimagesink: support video rotation using transform matrix - -Add "rotate-method" to glimagesink and apply transform matrix -to vertex coordinate to control rotation. - -Upstream-Status: Accepted[1.9.1] - -https://bugzilla.gnome.org/show_bug.cgi?id=765795 - -Signed-off-by: Haihua Hu ---- - ext/gl/gstglimagesink.c | 266 ++++++++++++++++++++++++++++++++--- - ext/gl/gstglimagesink.h | 18 +++ - gst-libs/gst/gl/gstglshaderstrings.c | 11 ++ - gst-libs/gst/gl/gstglshaderstrings.h | 1 + - gst-libs/gst/gl/gstglutils.c | 60 ++++++++ - gst-libs/gst/gl/gstglutils.h | 5 + - 6 files changed, 344 insertions(+), 17 deletions(-) - -diff --git a/ext/gl/gstglimagesink.c b/ext/gl/gstglimagesink.c -index 185577f2a07e..fb60468b361e 100644 ---- a/ext/gl/gstglimagesink.c -+++ b/ext/gl/gstglimagesink.c -@@ -120,6 +120,7 @@ G_DEFINE_TYPE (GstGLImageSinkBin, gst_gl_image_sink_bin, GST_TYPE_GL_SINK_BIN); - enum - { - PROP_BIN_0, -+ PROP_BIN_ROTATE_METHOD, - PROP_BIN_FORCE_ASPECT_RATIO, - PROP_BIN_PIXEL_ASPECT_RATIO, - PROP_BIN_HANDLE_EVENTS, -@@ -181,6 +182,39 @@ _on_client_draw (GstGLImageSink * sink, GstGLContext * context, - return ret; - } - -+#define DEFAULT_ROTATE_METHOD GST_GL_ROTATE_METHOD_IDENTITY -+ -+#define GST_TYPE_GL_ROTATE_METHOD (gst_gl_rotate_method_get_type()) -+ -+static const GEnumValue rotate_methods[] = { -+ {GST_GL_ROTATE_METHOD_IDENTITY, "Identity (no rotation)", "none"}, -+ {GST_GL_ROTATE_METHOD_90R, "Rotate clockwise 90 degrees", "clockwise"}, -+ {GST_GL_ROTATE_METHOD_180, "Rotate 180 degrees", "rotate-180"}, -+ {GST_GL_ROTATE_METHOD_90L, "Rotate counter-clockwise 90 degrees", -+ "counterclockwise"}, -+ {GST_GL_ROTATE_METHOD_FLIP_HORIZ, "Flip horizontally", "horizontal-flip"}, -+ {GST_GL_ROTATE_METHOD_FLIP_VERT, "Flip vertically", "vertical-flip"}, -+ {GST_GL_ROTATE_METHOD_FLIP_UL_LR, -+ "Flip across upper left/lower right diagonal", "upper-left-diagonal"}, -+ {GST_GL_ROTATE_METHOD_FLIP_UR_LL, -+ "Flip across upper right/lower left diagonal", "upper-right-diagonal"}, -+ {GST_GL_ROTATE_METHOD_AUTO, -+ "Select rotate method based on image-orientation tag", "automatic"}, -+ {0, NULL, NULL}, -+}; -+ -+static GType -+gst_gl_rotate_method_get_type (void) -+{ -+ static GType rotate_method_type = 0; -+ -+ if (!rotate_method_type) { -+ rotate_method_type = g_enum_register_static ("GstGLRotateMethod", -+ rotate_methods); -+ } -+ return rotate_method_type; -+} -+ - static void - gst_gl_image_sink_bin_init (GstGLImageSinkBin * self) - { -@@ -203,6 +237,12 @@ gst_gl_image_sink_bin_class_init (GstGLImageSinkBinClass * klass) - gobject_class->set_property = gst_gl_image_sink_bin_set_property; - - /* gl sink */ -+ g_object_class_install_property (gobject_class, PROP_BIN_ROTATE_METHOD, -+ g_param_spec_enum ("rotate-method", -+ "rotate method", -+ "rotate method", -+ GST_TYPE_GL_ROTATE_METHOD, DEFAULT_ROTATE_METHOD, -+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - g_object_class_install_property (gobject_class, PROP_BIN_FORCE_ASPECT_RATIO, - g_param_spec_boolean ("force-aspect-ratio", - "Force aspect ratio", -@@ -291,6 +331,7 @@ static void gst_glimage_sink_set_property (GObject * object, guint prop_id, - static void gst_glimage_sink_get_property (GObject * object, guint prop_id, - GValue * value, GParamSpec * param_spec); - -+static gboolean gst_glimage_sink_event (GstBaseSink *sink, GstEvent * event); - static gboolean gst_glimage_sink_query (GstBaseSink * bsink, GstQuery * query); - static void gst_glimage_sink_set_context (GstElement * element, - GstContext * context); -@@ -347,6 +388,7 @@ enum - { - ARG_0, - ARG_DISPLAY, -+ PROP_ROTATE_METHOD, - PROP_FORCE_ASPECT_RATIO, - PROP_PIXEL_ASPECT_RATIO, - PROP_CONTEXT, -@@ -404,6 +446,128 @@ _display_size_to_stream_size (GstGLImageSink * gl_sink, gdouble x, - GST_TRACE ("transform %fx%f into %fx%f", x, y, *stream_x, *stream_y); - } - -+/* rotate 90 */ -+static const gfloat clockwise_matrix[] = { -+ 0.0f, -1.0f, 0.0, 0.0f, -+ 1.0f, 0.0f, 0.0, 0.0f, -+ 0.0f, 0.0f, 1.0, 0.0f, -+ 0.0f, 0.0f, 0.0, 1.0f, -+}; -+ -+/* rotate 180 */ -+static const gfloat clockwise_180_matrix[] = { -+ -1.0f, 0.0f, 0.0, 0.0f, -+ 0.0f, -1.0f, 0.0, 0.0f, -+ 0.0f, 0.0f, 1.0, 0.0f, -+ 0.0f, 0.0f, 0.0, 1.0f, -+}; -+ -+/* rotate 270 */ -+static const gfloat counterclockwise_matrix[] = { -+ 0.0f, 1.0f, 0.0, 0.0f, -+ -1.0f, 0.0f, 0.0, 0.0f, -+ 0.0f, 0.0f, 1.0, 0.0f, -+ 0.0f, 0.0f, 0.0, 1.0f, -+}; -+ -+/* horizontal-flip */ -+static const gfloat horizontal_flip_matrix[] = { -+ 1.0f, 0.0f, 0.0f, 0.0f, -+ 0.0f, -1.0f, 0.0f, 0.0f, -+ 0.0f, 0.0f, 1.0f, 0.0f, -+ 0.0f, 0.0f, 0.0f, 1.0f, -+}; -+ -+/* vertical-flip */ -+static const gfloat vertical_flip_matrix[] = { -+ -1.0f, 0.0f, 0.0f, 0.0f, -+ 0.0f, 1.0f, 0.0f, 0.0f, -+ 0.0f, 0.0f, 1.0f, 0.0f, -+ 0.0f, 0.0f, 0.0f, 1.0f, -+}; -+ -+/* upper-left-diagonal */ -+static const gfloat upper_left_matrix[] = { -+ 0.0f, 1.0f, 0.0f, 0.0f, -+ 1.0f, 0.0f, 0.0f, 0.0f, -+ 0.0f, 0.0f, 1.0f, 0.0f, -+ 0.0f, 0.0f, 0.0f, 1.0f, -+}; -+ -+/* upper-right-diagonal */ -+static const gfloat upper_right_matrix[] = { -+ 0.0f, -1.0f, 0.0f, 0.0f, -+ -1.0f, 0.0f, 0.0f, 0.0f, -+ 0.0f, 0.0f, 1.0f, 0.0f, -+ 0.0f, 0.0f, 0.0f, 1.0f, -+}; -+ -+static void -+gst_glimage_sink_set_rotate_method(GstGLImageSink *gl_sink, -+ GstGLRotateMethod method, gboolean from_tag) -+{ -+ GstGLRotateMethod tag_method; -+ GST_GLIMAGE_SINK_LOCK (gl_sink); -+ if (from_tag) -+ tag_method = method; -+ else -+ gl_sink->rotate_method = method; -+ -+ if (gl_sink->rotate_method == GST_GL_ROTATE_METHOD_AUTO) -+ method = tag_method; -+ else -+ method = gl_sink->rotate_method; -+ -+ if (method != gl_sink->current_rotate_method) -+ { -+ GST_DEBUG_OBJECT (gl_sink, "Changing method from %s to %s", -+ rotate_methods[gl_sink->current_rotate_method].value_nick, -+ rotate_methods[method].value_nick); -+ -+ switch (method) -+ { -+ case GST_GL_ROTATE_METHOD_IDENTITY: -+ gl_sink->transform_matrix = NULL; -+ gl_sink->output_mode_changed = TRUE; -+ break; -+ case GST_GL_ROTATE_METHOD_90R: -+ gl_sink->transform_matrix = clockwise_matrix; -+ gl_sink->output_mode_changed = TRUE; -+ break; -+ case GST_GL_ROTATE_METHOD_180: -+ gl_sink->transform_matrix = clockwise_180_matrix; -+ gl_sink->output_mode_changed = TRUE; -+ break; -+ case GST_GL_ROTATE_METHOD_90L: -+ gl_sink->transform_matrix = counterclockwise_matrix; -+ gl_sink->output_mode_changed = TRUE; -+ break; -+ case GST_GL_ROTATE_METHOD_FLIP_HORIZ: -+ gl_sink->transform_matrix = horizontal_flip_matrix; -+ gl_sink->output_mode_changed = TRUE; -+ break; -+ case GST_GL_ROTATE_METHOD_FLIP_VERT: -+ gl_sink->transform_matrix = vertical_flip_matrix; -+ gl_sink->output_mode_changed = TRUE; -+ break; -+ case GST_GL_ROTATE_METHOD_FLIP_UL_LR: -+ gl_sink->transform_matrix = upper_left_matrix; -+ gl_sink->output_mode_changed = TRUE; -+ break; -+ case GST_GL_ROTATE_METHOD_FLIP_UR_LL: -+ gl_sink->transform_matrix = upper_right_matrix; -+ gl_sink->output_mode_changed = TRUE; -+ break; -+ default: -+ g_assert_not_reached(); -+ break; -+ } -+ -+ gl_sink->current_rotate_method = method; -+ } -+ GST_GLIMAGE_SINK_UNLOCK (gl_sink); -+} -+ - static void - gst_glimage_sink_navigation_send_event (GstNavigation * navigation, GstStructure - * structure) -@@ -485,6 +649,13 @@ gst_glimage_sink_class_init (GstGLImageSinkClass * klass) - gobject_class->set_property = gst_glimage_sink_set_property; - gobject_class->get_property = gst_glimage_sink_get_property; - -+ g_object_class_install_property (gobject_class, PROP_ROTATE_METHOD, -+ g_param_spec_enum ("rotate-method", -+ "rotate method", -+ "rotate method", -+ GST_TYPE_GL_ROTATE_METHOD, DEFAULT_ROTATE_METHOD, -+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); -+ - g_object_class_install_property (gobject_class, PROP_FORCE_ASPECT_RATIO, - g_param_spec_boolean ("force-aspect-ratio", "Force aspect ratio", - "When enabled, scaling will respect original aspect ratio", -@@ -577,6 +748,7 @@ gst_glimage_sink_class_init (GstGLImageSinkClass * klass) - - gstelement_class->change_state = gst_glimage_sink_change_state; - gstelement_class->set_context = gst_glimage_sink_set_context; -+ gstbasesink_class->event = gst_glimage_sink_event; - gstbasesink_class->query = GST_DEBUG_FUNCPTR (gst_glimage_sink_query); - gstbasesink_class->set_caps = gst_glimage_sink_set_caps; - gstbasesink_class->get_caps = gst_glimage_sink_get_caps; -@@ -610,6 +782,9 @@ gst_glimage_sink_init (GstGLImageSink * glimage_sink) - glimage_sink->mview_output_flags = DEFAULT_MULTIVIEW_FLAGS; - glimage_sink->mview_downmix_mode = DEFAULT_MULTIVIEW_DOWNMIX; - -+ glimage_sink->current_rotate_method = DEFAULT_ROTATE_METHOD; -+ glimage_sink->transform_matrix = NULL; -+ - g_mutex_init (&glimage_sink->drawing_lock); - } - -@@ -624,6 +799,9 @@ gst_glimage_sink_set_property (GObject * object, guint prop_id, - glimage_sink = GST_GLIMAGE_SINK (object); - - switch (prop_id) { -+ case PROP_ROTATE_METHOD: -+ gst_glimage_sink_set_rotate_method (glimage_sink, g_value_get_enum (value), FALSE); -+ break; - case PROP_FORCE_ASPECT_RATIO: - { - glimage_sink->keep_aspect_ratio = g_value_get_boolean (value); -@@ -691,6 +869,9 @@ gst_glimage_sink_get_property (GObject * object, guint prop_id, - glimage_sink = GST_GLIMAGE_SINK (object); - - switch (prop_id) { -+ case PROP_ROTATE_METHOD: -+ g_value_set_enum (value, glimage_sink->current_rotate_method); -+ break; - case PROP_FORCE_ASPECT_RATIO: - g_value_set_boolean (value, glimage_sink->keep_aspect_ratio); - break; -@@ -848,6 +1029,50 @@ context_error: - } - - static gboolean -+gst_glimage_sink_event (GstBaseSink *sink, GstEvent * event) -+{ -+ GstGLImageSink *gl_sink = GST_GLIMAGE_SINK (sink); -+ GstTagList *taglist; -+ gchar *orientation; -+ gboolean ret; -+ -+ GST_DEBUG_OBJECT (gl_sink, "handling %s event", GST_EVENT_TYPE_NAME (event)); -+ -+ switch (GST_EVENT_TYPE (event)) { -+ case GST_EVENT_TAG: -+ gst_event_parse_tag (event, &taglist); -+ -+ if (gst_tag_list_get_string (taglist, "image-orientation", &orientation)) { -+ if (!g_strcmp0 ("rotate-0", orientation)) -+ gst_glimage_sink_set_rotate_method (gl_sink, GST_GL_ROTATE_METHOD_IDENTITY, TRUE); -+ else if (!g_strcmp0 ("rotate-90", orientation)) -+ gst_glimage_sink_set_rotate_method (gl_sink, GST_GL_ROTATE_METHOD_90R, TRUE); -+ else if (!g_strcmp0 ("rotate-180", orientation)) -+ gst_glimage_sink_set_rotate_method (gl_sink, GST_GL_ROTATE_METHOD_180, TRUE); -+ else if (!g_strcmp0 ("rotate-270", orientation)) -+ gst_glimage_sink_set_rotate_method (gl_sink, GST_GL_ROTATE_METHOD_90L, TRUE); -+ else if (!g_strcmp0 ("flip-rotate-0", orientation)) -+ gst_glimage_sink_set_rotate_method (gl_sink, GST_GL_ROTATE_METHOD_FLIP_HORIZ, TRUE); -+ else if (!g_strcmp0 ("flip-rotate-90", orientation)) -+ gst_glimage_sink_set_rotate_method (gl_sink, GST_GL_ROTATE_METHOD_FLIP_UR_LL, TRUE); -+ else if (!g_strcmp0 ("flip-rotate-180", orientation)) -+ gst_glimage_sink_set_rotate_method (gl_sink, GST_GL_ROTATE_METHOD_FLIP_VERT, TRUE); -+ else if (!g_strcmp0 ("flip-rotate-270", orientation)) -+ gst_glimage_sink_set_rotate_method (gl_sink, GST_GL_ROTATE_METHOD_FLIP_UL_LR, TRUE); -+ -+ g_free (orientation); -+ } -+ break; -+ default: -+ break; -+ } -+ -+ ret = GST_BASE_SINK_CLASS (parent_class)->event (sink, event); -+ -+ return ret; -+} -+ -+static gboolean - gst_glimage_sink_query (GstBaseSink * bsink, GstQuery * query) - { - GstGLImageSink *glimage_sink = GST_GLIMAGE_SINK (bsink); -@@ -1817,7 +2042,10 @@ gst_glimage_sink_thread_init_redisplay (GstGLImageSink * gl_sink) - GST_GLSL_PROFILE_ES | GST_GLSL_PROFILE_COMPATIBILITY, - gst_gl_shader_string_fragment_external_oes_default); - } else { -- vert_stage = gst_glsl_stage_new_default_vertex (gl_sink->context); -+ vert_stage = gst_glsl_stage_new_with_string (gl_sink->context, -+ GL_VERTEX_SHADER, GST_GLSL_VERSION_NONE, -+ GST_GLSL_PROFILE_ES | GST_GLSL_PROFILE_COMPATIBILITY, -+ gst_gl_shader_string_vertex_mat4_vertex_transform); - frag_stage = gst_glsl_stage_new_default_fragment (gl_sink->context); - } - if (!vert_stage || !frag_stage) { -@@ -1943,8 +2171,16 @@ gst_glimage_sink_on_resize (GstGLImageSink * gl_sink, gint width, gint height) - - src.x = 0; - src.y = 0; -- src.w = GST_VIDEO_SINK_WIDTH (gl_sink); -- src.h = GST_VIDEO_SINK_HEIGHT (gl_sink); -+ if (gl_sink->current_rotate_method == GST_GL_ROTATE_METHOD_90R -+ || gl_sink->current_rotate_method == GST_GL_ROTATE_METHOD_90L -+ || gl_sink->current_rotate_method == GST_GL_ROTATE_METHOD_FLIP_UL_LR -+ || gl_sink->current_rotate_method == GST_GL_ROTATE_METHOD_FLIP_UR_LL) { -+ src.h = GST_VIDEO_SINK_WIDTH (gl_sink); -+ src.w = GST_VIDEO_SINK_HEIGHT (gl_sink); -+ } else { -+ src.w = GST_VIDEO_SINK_WIDTH (gl_sink); -+ src.h = GST_VIDEO_SINK_HEIGHT (gl_sink); -+ } - - dst.x = 0; - dst.y = 0; -@@ -1974,13 +2210,6 @@ gst_glimage_sink_on_resize (GstGLImageSink * gl_sink, gint width, gint height) - GST_GLIMAGE_SINK_UNLOCK (gl_sink); - } - --static const gfloat identity_matrix[] = { -- 1.0f, 0.0f, 0.0, 0.0f, -- 0.0f, 1.0f, 0.0, 0.0f, -- 0.0f, 0.0f, 1.0, 0.0f, -- 0.0f, 0.0f, 0.0, 1.0f, --}; -- - static void - gst_glimage_sink_on_draw (GstGLImageSink * gl_sink) - { -@@ -2109,18 +2338,21 @@ gst_glimage_sink_on_draw (GstGLImageSink * gl_sink) - gl->ActiveTexture (GL_TEXTURE0); - gl->BindTexture (gl_target, gl_sink->redisplay_texture); - gst_gl_shader_set_uniform_1i (gl_sink->redisplay_shader, "tex", 0); -- if (gl_sink->texture_target == GST_GL_TEXTURE_TARGET_EXTERNAL_OES) { -+ { - GstVideoAffineTransformationMeta *af_meta; -+ gfloat matrix[16]; - - af_meta = - gst_buffer_get_video_affine_transformation_meta - (gl_sink->stored_buffer[0]); -- if (af_meta) -- gst_gl_shader_set_uniform_matrix_4fv (gl_sink->redisplay_shader, -- "u_transformation", 1, FALSE, af_meta->matrix); -- else -- gst_gl_shader_set_uniform_matrix_4fv (gl_sink->redisplay_shader, -- "u_transformation", 1, FALSE, identity_matrix); -+ -+ gst_gl_get_affine_transformation_meta_as_ndc (af_meta, matrix); -+ -+ if (gl_sink->transform_matrix) -+ gst_gl_multiply_matrix4 (gl_sink->transform_matrix, matrix, matrix); -+ -+ gst_gl_shader_set_uniform_matrix_4fv (gl_sink->redisplay_shader, -+ "u_transformation", 1, FALSE, matrix); - } - - gl->DrawElements (GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, 0); -diff --git a/ext/gl/gstglimagesink.h b/ext/gl/gstglimagesink.h -index f9a052a12ed8..c0ab3ffb3b47 100644 ---- a/ext/gl/gstglimagesink.h -+++ b/ext/gl/gstglimagesink.h -@@ -44,6 +44,19 @@ GST_DEBUG_CATEGORY_EXTERN (gst_debug_glimage_sink); - #define GST_IS_GLIMAGE_SINK_CLASS(klass) \ - (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_GLIMAGE_SINK)) - -+typedef enum -+{ -+ GST_GL_ROTATE_METHOD_IDENTITY, -+ GST_GL_ROTATE_METHOD_90R, -+ GST_GL_ROTATE_METHOD_180, -+ GST_GL_ROTATE_METHOD_90L, -+ GST_GL_ROTATE_METHOD_FLIP_HORIZ, -+ GST_GL_ROTATE_METHOD_FLIP_VERT, -+ GST_GL_ROTATE_METHOD_FLIP_UL_LR, -+ GST_GL_ROTATE_METHOD_FLIP_UR_LL, -+ GST_GL_ROTATE_METHOD_AUTO -+}GstGLRotateMethod; -+ - typedef struct _GstGLImageSink GstGLImageSink; - typedef struct _GstGLImageSinkClass GstGLImageSinkClass; - -@@ -126,6 +139,11 @@ struct _GstGLImageSink - - GstGLOverlayCompositor *overlay_compositor; - -+ /* current video flip method */ -+ GstGLRotateMethod current_rotate_method; -+ GstGLRotateMethod rotate_method; -+ const gfloat *transform_matrix; -+ - /* fps print support */ - guint64 frame_showed; - GstClockTime run_time; -diff --git a/gst-libs/gst/gl/gstglshaderstrings.c b/gst-libs/gst/gl/gstglshaderstrings.c -index 729be6f75100..10186f1b86ec 100644 ---- a/gst-libs/gst/gl/gstglshaderstrings.c -+++ b/gst-libs/gst/gl/gstglshaderstrings.c -@@ -35,6 +35,17 @@ const gchar *gst_gl_shader_string_vertex_default = - " v_texcoord = a_texcoord;\n" - "}\n"; - -+const gchar *gst_gl_shader_string_vertex_mat4_vertex_transform = -+ "uniform mat4 u_transformation;\n" -+ "attribute vec4 a_position;\n" -+ "attribute vec2 a_texcoord;\n" -+ "varying vec2 v_texcoord;\n" -+ "void main()\n" -+ "{\n" -+ " gl_Position = u_transformation * a_position;\n" -+ " v_texcoord = a_texcoord;\n" -+ "}\n"; -+ - const gchar *gst_gl_shader_string_vertex_mat4_texture_transform = - "uniform mat4 u_transformation;\n" - "attribute vec4 a_position;\n" -diff --git a/gst-libs/gst/gl/gstglshaderstrings.h b/gst-libs/gst/gl/gstglshaderstrings.h -index 49ea8de427c5..f9a13c8b3d92 100644 ---- a/gst-libs/gst/gl/gstglshaderstrings.h -+++ b/gst-libs/gst/gl/gstglshaderstrings.h -@@ -28,6 +28,7 @@ G_BEGIN_DECLS - extern const gchar *gst_gl_shader_string_vertex_default; - extern const gchar *gst_gl_shader_string_fragment_default; - -+extern const gchar *gst_gl_shader_string_vertex_mat4_vertex_transform; - extern const gchar *gst_gl_shader_string_vertex_mat4_texture_transform; - extern const gchar *gst_gl_shader_string_fragment_external_oes_default; - -diff --git a/gst-libs/gst/gl/gstglutils.c b/gst-libs/gst/gl/gstglutils.c -index e2e04e407ed7..a38772f10be3 100644 ---- a/gst-libs/gst/gl/gstglutils.c -+++ b/gst-libs/gst/gl/gstglutils.c -@@ -1067,3 +1067,63 @@ gst_gl_value_set_texture_target_from_mask (GValue * value, - return ret; - } - } -+ -+static const gfloat identity_matrix[] = { -+ 1.0f, 0.0f, 0.0, 0.0f, -+ 0.0f, 1.0f, 0.0, 0.0f, -+ 0.0f, 0.0f, 1.0, 0.0f, -+ 0.0f, 0.0f, 0.0, 1.0f, -+}; -+ -+static const gfloat from_ndc_matrix[] = { -+ 0.5f, 0.0f, 0.0, 0.5f, -+ 0.0f, 0.5f, 0.0, 0.5f, -+ 0.0f, 0.0f, 0.5, 0.5f, -+ 0.0f, 0.0f, 0.0, 1.0f, -+}; -+ -+static const gfloat to_ndc_matrix[] = { -+ 2.0f, 0.0f, 0.0, -1.0f, -+ 0.0f, 2.0f, 0.0, -1.0f, -+ 0.0f, 0.0f, 2.0, -1.0f, -+ 0.0f, 0.0f, 0.0, 1.0f, -+}; -+ -+void -+gst_gl_multiply_matrix4 (const gfloat * a, const gfloat * b, gfloat * result) -+{ -+ int i, j, k; -+ gfloat tmp[16] = { 0.0f }; -+ -+ if (!a || !b || !result) -+ return; -+ -+ for (i = 0; i < 4; i++) { -+ for (j = 0; j < 4; j++) { -+ for (k = 0; k < 4; k++) { -+ tmp[i + (j * 4)] += a[i + (k * 4)] * b[k + (j * 4)]; -+ } -+ } -+ } -+ -+ for (i = 0; i < 16; i++) -+ result[i] = tmp[i]; -+} -+ -+void -+gst_gl_get_affine_transformation_meta_as_ndc (GstVideoAffineTransformationMeta * -+ meta, gfloat * matrix) -+{ -+ if (!meta) { -+ int i; -+ -+ for (i = 0; i < 16; i++) { -+ matrix[i] = identity_matrix[i]; -+ } -+ } else { -+ gfloat tmp[16] = { 0.0f }; -+ -+ gst_gl_multiply_matrix4 (from_ndc_matrix, meta->matrix, tmp); -+ gst_gl_multiply_matrix4 (tmp, to_ndc_matrix, matrix); -+ } -+} -diff --git a/gst-libs/gst/gl/gstglutils.h b/gst-libs/gst/gl/gstglutils.h -index 1c5ab12344fe..fc12801978e9 100644 ---- a/gst-libs/gst/gl/gstglutils.h -+++ b/gst-libs/gst/gl/gstglutils.h -@@ -24,6 +24,7 @@ - #include - - #include -+#include - - G_BEGIN_DECLS - -@@ -116,6 +117,10 @@ gboolean gst_gl_value_set_texture_target_from_mask (GValue * value, - gboolean gst_gl_value_set_texture_target (GValue * value, GstGLTextureTarget target); - GstGLTextureTarget gst_gl_value_get_texture_target_mask (const GValue * value); - -+void gst_gl_multiply_matrix4 (const gfloat * a, const gfloat * b, gfloat * result); -+void gst_gl_get_affine_transformation_meta_as_ndc (GstVideoAffineTransformationMeta * -+ meta, gfloat * matrix); -+ - G_END_DECLS - - #endif /* __GST_GL_UTILS_H__ */ diff --git a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0014-ion-DMA-Buf-allocator-based-on-ion.patch b/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0014-ion-DMA-Buf-allocator-based-on-ion.patch deleted file mode 100644 index 0b63913bc..000000000 --- a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0014-ion-DMA-Buf-allocator-based-on-ion.patch +++ /dev/null @@ -1,481 +0,0 @@ -From 145ef8665f68fd716fc9def3d765973fd2c2fdd8 Mon Sep 17 00:00:00 2001 -From: Song Bing -Date: Mon, 20 Jun 2016 10:28:34 +0800 -Subject: [PATCH] ion: DMA Buf allocator based on ion. - -DMA Buf allocator based on ion. - -Upstream-Status: Pending - -https://bugzilla.gnome.org/show_bug.cgi?id=768794 ---- - configure.ac | 7 + - gst-libs/gst/Makefile.am | 10 +- - gst-libs/gst/ion/Makefile.am | 16 +++ - gst-libs/gst/ion/gstionmemory.c | 297 ++++++++++++++++++++++++++++++++++++++++ - gst-libs/gst/ion/gstionmemory.h | 72 ++++++++++ - 5 files changed, 399 insertions(+), 3 deletions(-) - create mode 100644 gst-libs/gst/ion/Makefile.am - create mode 100755 gst-libs/gst/ion/gstionmemory.c - create mode 100755 gst-libs/gst/ion/gstionmemory.h - -diff --git a/configure.ac b/configure.ac -index 63cc7161cec5..c0145ae19c76 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -2003,6 +2003,12 @@ AG_GST_CHECK_FEATURE(TINYALSA, [tinyalsa], tinyalsa, [ - AC_CHECK_HEADER(tinyalsa/asoundlib.h, HAVE_TINYALSA="yes", HAVE_TINYALSA="no") - ]) - -+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 *** ext plug-ins *** - dnl keep this list sorted alphabetically ! - -@@ -3656,6 +3662,7 @@ gst-libs/gst/uridownloader/Makefile - gst-libs/gst/wayland/Makefile - gst-libs/gst/base/Makefile - gst-libs/gst/player/Makefile -+gst-libs/gst/ion/Makefile - gst-libs/gst/video/Makefile - gst-libs/gst/audio/Makefile - sys/Makefile -diff --git a/gst-libs/gst/Makefile.am b/gst-libs/gst/Makefile.am -index 7d0b30925744..eb2031cf65b4 100644 ---- a/gst-libs/gst/Makefile.am -+++ b/gst-libs/gst/Makefile.am -@@ -10,12 +10,16 @@ if USE_WAYLAND - WAYLAND_DIR=wayland - endif - -+if USE_ION -+ION_DIR=ion -+endif -+ - SUBDIRS = uridownloader adaptivedemux interfaces basecamerabinsrc codecparsers \ -- insertbin mpegts base video audio player $(GL_DIR) $(WAYLAND_DIR) -+ insertbin mpegts base video audio player $(ION_DIR) $(GL_DIR) $(WAYLAND_DIR) - - noinst_HEADERS = gst-i18n-plugin.h gettext.h glib-compat-private.h - DIST_SUBDIRS = uridownloader adaptivedemux interfaces gl basecamerabinsrc \ -- codecparsers insertbin mpegts wayland base video audio player -+ codecparsers insertbin mpegts wayland base video audio player ion - - #dependencies - video, audio: base -@@ -24,7 +28,7 @@ adaptivedemux: uridownloader - - INDEPENDENT_SUBDIRS = \ - interfaces basecamerabinsrc codecparsers insertbin uridownloader \ -- mpegts base player $(GL_DIR) $(WAYLAND_DIR) -+ mpegts base player $(ION_DIR) $(GL_DIR) $(WAYLAND_DIR) - - .PHONY: independent-subdirs $(INDEPENDENT_SUBDIRS) - -diff --git a/gst-libs/gst/ion/Makefile.am b/gst-libs/gst/ion/Makefile.am -new file mode 100644 -index 000000000000..0a9f9f3a8e48 ---- /dev/null -+++ b/gst-libs/gst/ion/Makefile.am -@@ -0,0 +1,16 @@ -+lib_LTLIBRARIES = libgstbadion-@GST_API_VERSION@.la -+ -+libgstbadion_@GST_API_VERSION@_la_SOURCES = \ -+ gstionmemory.c -+ -+libgstbadion_@GST_API_VERSION@_la_CFLAGS = $(GST_CFLAGS) \ -+ -DGST_USE_UNSTABLE_API -+ -+libgstbadion_@GST_API_VERSION@_la_LIBADD = $(GST_LIBS) -+libgstbadion_@GST_API_VERSION@_la_LDFLAGS = $(GST_LIB_LDFLAGS) $(GST_ALL_LDFLAGS) $(GST_LT_LDFLAGS) -+ -+libgstion_@GST_API_VERSION@includedir = $(includedir)/gstreamer-@GST_API_VERSION@/gst/ion -+libgstion_@GST_API_VERSION@include_HEADERS = gstionmemory.h -+ -+EXTRA_DIST = -+ -diff --git a/gst-libs/gst/ion/gstionmemory.c b/gst-libs/gst/ion/gstionmemory.c -new file mode 100755 -index 000000000000..ea62ac4926c1 ---- /dev/null -+++ b/gst-libs/gst/ion/gstionmemory.c -@@ -0,0 +1,297 @@ -+/* -+ * Copyright (c) 2016, 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 -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include "gstionmemory.h" -+ -+GST_DEBUG_CATEGORY_STATIC(ion_allocator_debug); -+#define GST_CAT_DEFAULT ion_allocator_debug -+ -+#define gst_ion_allocator_parent_class parent_class -+ -+#define PAGE_ALIGN(x) (((x) + 4095) & ~4095) -+ -+G_DEFINE_TYPE(GstIONAllocator, gst_ion_allocator, GST_TYPE_ALLOCATOR) -+ -+static int -+gst_ion_open() -+{ -+ int fd = open("/dev/ion", O_RDWR); -+ if (fd < 0) -+ GST_ERROR ("open /dev/ion failed!\n"); -+ return fd; -+} -+ -+static int -+gst_ion_close(int fd) -+{ -+ int ret = close(fd); -+ if (ret < 0) -+ return -errno; -+ return ret; -+} -+ -+static int -+gst_ion_ioctl(int fd, int req, void *arg) -+{ -+ int ret = ioctl(fd, req, arg); -+ if (ret < 0) { -+ GST_ERROR ("ioctl %x failed with code %d: %s\n", req, -+ ret, strerror(errno)); -+ return -errno; -+ } -+ return ret; -+} -+ -+static int -+gst_ion_alloc(int fd, size_t len, size_t align, unsigned int heap_mask, -+ unsigned int flags, ion_user_handle_t *handle) -+{ -+ int ret; -+ struct ion_allocation_data data = { -+ .len = len, -+ .align = align, -+ .heap_id_mask = heap_mask, -+ .flags = flags, -+ }; -+ -+ if (handle == NULL) -+ return -EINVAL; -+ -+ ret = gst_ion_ioctl(fd, ION_IOC_ALLOC, &data); -+ if (ret < 0) -+ return ret; -+ *handle = data.handle; -+ return ret; -+} -+ -+static int -+gst_ion_free(int fd, ion_user_handle_t handle) -+{ -+ struct ion_handle_data data = { -+ .handle = handle, -+ }; -+ return gst_ion_ioctl(fd, ION_IOC_FREE, &data); -+} -+ -+static int -+gst_ion_map(int fd, ion_user_handle_t handle, size_t length, int prot, -+ int flags, off_t offset, unsigned char **ptr, int *map_fd) -+{ -+ int ret; -+ unsigned char *tmp_ptr; -+ struct ion_fd_data data = { -+ .handle = handle, -+ }; -+ -+ if (map_fd == NULL) -+ return -EINVAL; -+ if (ptr == NULL) -+ return -EINVAL; -+ -+ ret = gst_ion_ioctl(fd, ION_IOC_MAP, &data); -+ if (ret < 0) -+ return ret; -+ if (data.fd < 0) { -+ GST_ERROR ("map ioctl returned negative fd\n"); -+ return -EINVAL; -+ } -+ tmp_ptr = mmap(NULL, length, prot, flags, data.fd, offset); -+ if (tmp_ptr == MAP_FAILED) { -+ GST_ERROR ("mmap failed: %s\n", strerror(errno)); -+ return -errno; -+ } -+ *map_fd = data.fd; -+ *ptr = tmp_ptr; -+ return ret; -+} -+ -+static void -+gst_ion_mem_init(void) -+{ -+ GstAllocator *allocator = g_object_new(gst_ion_allocator_get_type(), NULL); -+ GstIONAllocator *self = GST_ION_ALLOCATOR (allocator); -+ gint fd; -+ -+ fd = gst_ion_open(); -+ if (fd < 0) { -+ GST_ERROR ("Could not open ion driver"); -+ g_object_unref (self); -+ return; -+ } -+ -+ self->fd = fd; -+ self->dma_allocator = gst_dmabuf_allocator_new(); -+ -+ gst_allocator_register(GST_TYPE_ION_ALLOCATOR, allocator); -+} -+ -+GstAllocator* -+gst_ion_allocator_obtain(void) -+{ -+ static GOnce ion_allocator_once = G_ONCE_INIT; -+ GstAllocator *allocator; -+ -+ g_once(&ion_allocator_once, (GThreadFunc)gst_ion_mem_init, NULL); -+ -+ allocator = gst_allocator_find(GST_TYPE_ION_ALLOCATOR); -+ if (allocator == NULL) -+ GST_WARNING("No allocator named %s found", GST_TYPE_ION_ALLOCATOR); -+ -+ return allocator; -+} -+ -+GQuark -+gst_ion_memory_quark (void) -+{ -+ static GQuark quark = 0; -+ -+ if (quark == 0) -+ quark = g_quark_from_string ("GstIONPrivate"); -+ -+ return quark; -+} -+ -+static GstMemory * -+gst_ion_alloc_alloc (GstAllocator * allocator, gint size, -+ GstAllocationParams * params) -+{ -+ GstIONAllocator *self = GST_ION_ALLOCATOR (allocator); -+ gint dmafd = -1; -+ guint8 *ptr = NULL; -+ ion_user_handle_t ionHandle; -+ gint ionSize = PAGE_ALIGN (size + params->prefix + params->padding); -+ gint err; -+ -+ if (self->fd < 0) -+ return NULL; -+ -+ err = gst_ion_alloc(self->fd, ionSize, 8, 1, 0, &ionHandle); -+ if (err) { -+ GST_ERROR ("gst_ion_alloc failed."); -+ return NULL; -+ } -+ -+ err = gst_ion_map(self->fd, ionHandle, ionSize, PROT_READ | PROT_WRITE, -+ MAP_SHARED, 0, &ptr, &dmafd); -+ if (err) { -+ GST_ERROR ("gst_ion_map failed."); -+ goto bail; -+ } -+ GST_DEBUG ("phyalloc ptr:0x%x, ionSize:%d dmafd: %d", (int32_t)ptr, -+ ionSize, dmafd); -+ -+ GstIONMemory *ion_mem = g_slice_new0 (GstIONMemory); -+ gst_memory_init (GST_MEMORY_CAST (ion_mem), GST_MEMORY_FLAG_NO_SHARE, -+ allocator, 0, size, 0, 0, size); -+ -+ ion_mem->vaddr = ptr; -+ ion_mem->size = ionSize; -+ ion_mem->handle = ionHandle; -+ ion_mem->fd = dmafd; -+ -+ GstMemory * mem = -+ gst_dmabuf_allocator_alloc(self->dma_allocator, dmafd, ionSize); -+ -+ gst_mini_object_set_qdata (GST_MINI_OBJECT (mem), GST_ION_MEMORY_QUARK, -+ ion_mem, gst_memory_unref); -+ -+ GST_LOG ("allocated memory %p by allocator %p with qdata %p\n", -+ mem, allocator, ion_mem); -+ -+ return mem; -+ -+bail: -+ gst_ion_free(self->fd, ionHandle); -+ if (ptr != MAP_FAILED) { -+ munmap(ptr, ionSize); -+ } -+ if (dmafd > 0) { -+ close(dmafd); -+ } -+ return NULL; -+} -+ -+static void -+gst_ion_alloc_free (GstAllocator * allocator, GstMemory * memory) -+{ -+ GstIONAllocator *self = GST_ION_ALLOCATOR (allocator); -+ GstIONMemory *ion_mem = (GstIONMemory *) memory; -+ -+ if (!ion_mem || self->fd < 0) -+ return; -+ -+ ion_user_handle_t ionHandle = -+ (ion_user_handle_t)ion_mem->handle; -+ munmap(ion_mem->vaddr, ion_mem->size); -+ close(ion_mem->fd); -+ gst_ion_free(self->fd, ionHandle); -+ -+ g_slice_free (GstIONMemory, ion_mem); -+} -+ -+static void -+gst_ion_allocator_dispose (GObject * object) -+{ -+ GstIONAllocator *self = GST_ION_ALLOCATOR (object); -+ -+ if (self->fd > 0) { -+ close(self->fd); -+ self->fd = -1; -+ } -+ -+ if (self->dma_allocator) -+ gst_object_unref(self->dma_allocator); -+ self->dma_allocator = NULL; -+ -+ G_OBJECT_CLASS (parent_class)->dispose (object); -+} -+ -+static void -+gst_ion_allocator_class_init (GstIONAllocatorClass * klass) -+{ -+ GObjectClass *gobject_class = G_OBJECT_CLASS (klass); -+ GstAllocatorClass *allocator_class = GST_ALLOCATOR_CLASS (klass); -+ -+ allocator_class->alloc = GST_DEBUG_FUNCPTR (gst_ion_alloc_alloc); -+ allocator_class->free = GST_DEBUG_FUNCPTR (gst_ion_alloc_free); -+ gobject_class->dispose = GST_DEBUG_FUNCPTR (gst_ion_allocator_dispose); -+ -+ GST_DEBUG_CATEGORY_INIT(ion_allocator_debug, "ionmemory", 0, "DMA FD memory allocator based on ion"); -+} -+ -+static void -+gst_ion_allocator_init (GstIONAllocator * self) -+{ -+ GstAllocator *allocator = GST_ALLOCATOR (self); -+ -+ allocator->mem_type = GST_ALLOCATOR_ION; -+ allocator->mem_map = NULL; -+ allocator->mem_unmap = NULL; -+} -+ -diff --git a/gst-libs/gst/ion/gstionmemory.h b/gst-libs/gst/ion/gstionmemory.h -new file mode 100755 -index 000000000000..b6dca5fb9bfe ---- /dev/null -+++ b/gst-libs/gst/ion/gstionmemory.h -@@ -0,0 +1,72 @@ -+/* -+ * Copyright (c) 2016, 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 __GST_IONMEMORY_H__ -+#define __GST_IONMEMORY_H__ -+ -+#include -+#include -+ -+G_BEGIN_DECLS -+ -+typedef struct _GstIONAllocator GstIONAllocator; -+typedef struct _GstIONAllocatorClass GstIONAllocatorClass; -+typedef struct _GstIONMemory GstIONMemory; -+ -+#define GST_ALLOCATOR_ION "ionmem" -+ -+#define GST_TYPE_ION_ALLOCATOR gst_ion_allocator_get_type () -+#define GST_IS_ION_ALLOCATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ -+ GST_TYPE_ION_ALLOCATOR)) -+#define GST_ION_ALLOCATOR(obj) \ -+ (G_TYPE_CHECK_INSTANCE_CAST((obj), GST_TYPE_ION_ALLOCATOR, GstIONAllocator)) -+#define GST_ION_ALLOCATOR_CLASS(klass) \ -+ (G_TYPE_CHECK_CLASS_CAST((klass), GST_TYPE_ION_ALLOCATOR, GstIONAllocatorClass)) -+#define GST_ION_ALLOCATOR_CAST(obj) ((GstIONAllocator *)(obj)) -+ -+#define GST_ION_MEMORY_QUARK gst_ion_memory_quark () -+ -+struct _GstIONAllocator -+{ -+ GstAllocator parent; -+ -+ gint fd; -+ GstAllocator *dma_allocator; -+}; -+ -+struct _GstIONAllocatorClass -+{ -+ GstAllocatorClass parent; -+}; -+ -+struct _GstIONMemory { -+ GstMemory mem; -+ -+ gint fd; -+ guint8 *vaddr; -+ gsize size; -+ gint handle; -+}; -+ -+GType gst_ion_allocator_get_type (void); -+GstAllocator* gst_ion_allocator_obtain (void); -+ -+G_END_DECLS -+ -+#endif /* __GST_IONMEMORY_H__ */ diff --git a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0015-EGL_DMA_Buf-Wrong-attribute-list-type-for-EGL-1.5.patch b/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0015-EGL_DMA_Buf-Wrong-attribute-list-type-for-EGL-1.5.patch deleted file mode 100644 index 505fdcd34..000000000 --- a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0015-EGL_DMA_Buf-Wrong-attribute-list-type-for-EGL-1.5.patch +++ /dev/null @@ -1,191 +0,0 @@ -From a81404f3e2ceb89f54d1b2345c7606b3863e5c71 Mon Sep 17 00:00:00 2001 -From: Song Bing -Date: Wed, 13 Jul 2016 17:15:44 +0800 -Subject: [PATCH] EGL_DMA_Buf: Wrong attribute list type for EGL 1.5 - -For EGL 1.5 spec, the attribute list type should be EGLAttrib. - -Upstream-Status: Pending -https://bugzilla.gnome.org/show_bug.cgi?id=768602 ---- - gst-libs/gst/gl/egl/gsteglimagememory.c | 78 ++++++++++++++++++++++----------- - gst-libs/gst/gl/egl/gstglcontext_egl.c | 20 +++++---- - gst-libs/gst/gl/egl/gstglcontext_egl.h | 3 ++ - 3 files changed, 66 insertions(+), 35 deletions(-) - -diff --git a/gst-libs/gst/gl/egl/gsteglimagememory.c b/gst-libs/gst/gl/egl/gsteglimagememory.c -index 46098b507c45..6c5ae47055df 100644 ---- a/gst-libs/gst/gl/egl/gsteglimagememory.c -+++ b/gst-libs/gst/gl/egl/gsteglimagememory.c -@@ -432,6 +432,9 @@ gst_egl_image_memory_from_dmabuf (GstGLContext * context, - gint fourcc; - gint atti = 0; - EGLint attribs[13]; -+#ifdef EGL_VERSION_1_5 -+ EGLAttrib attribs_1_5[13]; -+#endif - EGLImageKHR img = EGL_NO_IMAGE_KHR; - - allocator = gst_egl_image_allocator_obtain (); -@@ -442,32 +445,55 @@ gst_egl_image_memory_from_dmabuf (GstGLContext * context, - GST_VIDEO_INFO_COMP_WIDTH (in_info, plane), - GST_VIDEO_INFO_COMP_HEIGHT (in_info, plane)); - -- attribs[atti++] = EGL_WIDTH; -- attribs[atti++] = GST_VIDEO_INFO_COMP_WIDTH (in_info, plane); -- attribs[atti++] = EGL_HEIGHT; -- attribs[atti++] = GST_VIDEO_INFO_COMP_HEIGHT (in_info, plane); -- -- attribs[atti++] = EGL_LINUX_DRM_FOURCC_EXT; -- attribs[atti++] = fourcc; -- -- attribs[atti++] = EGL_DMA_BUF_PLANE0_FD_EXT; -- attribs[atti++] = dmabuf; -- -- attribs[atti++] = EGL_DMA_BUF_PLANE0_OFFSET_EXT; -- attribs[atti++] = offset; -- attribs[atti++] = EGL_DMA_BUF_PLANE0_PITCH_EXT; -- attribs[atti++] = GST_VIDEO_INFO_PLANE_STRIDE (in_info, plane); -- -- attribs[atti] = EGL_NONE; -- -- for (int i = 0; i < atti; i++) -- GST_LOG ("attr %i: %08X", i, attribs[i]); -- -- g_assert (atti == 12); -- -- img = ctx_egl->eglCreateImage (ctx_egl->egl_display, EGL_NO_CONTEXT, -- EGL_LINUX_DMA_BUF_EXT, NULL, attribs); -- -+#ifdef EGL_VERSION_1_5 -+ if (GST_GL_CHECK_GL_VERSION (ctx_egl->egl_major, ctx_egl->egl_minor, 1, 5)) { -+ attribs_1_5[atti++] = EGL_WIDTH; -+ attribs_1_5[atti++] = GST_VIDEO_INFO_COMP_WIDTH (in_info, plane); -+ attribs_1_5[atti++] = EGL_HEIGHT; -+ attribs_1_5[atti++] = GST_VIDEO_INFO_COMP_HEIGHT (in_info, plane); -+ attribs_1_5[atti++] = EGL_LINUX_DRM_FOURCC_EXT; -+ attribs_1_5[atti++] = fourcc; -+ attribs_1_5[atti++] = EGL_DMA_BUF_PLANE0_FD_EXT; -+ attribs_1_5[atti++] = dmabuf; -+ attribs_1_5[atti++] = EGL_DMA_BUF_PLANE0_OFFSET_EXT; -+ attribs_1_5[atti++] = offset; -+ attribs_1_5[atti++] = EGL_DMA_BUF_PLANE0_PITCH_EXT; -+ attribs_1_5[atti++] = GST_VIDEO_INFO_PLANE_STRIDE (in_info, plane); -+ attribs_1_5[atti] = EGL_NONE; -+ -+ for (int i = 0; i < atti; i++) -+ GST_LOG ("attr %i: %" G_GINTPTR_FORMAT, i, attribs_1_5[i]); -+ -+ g_assert (atti == 12); -+ -+ img = ctx_egl->eglCreateImage (ctx_egl->egl_display, EGL_NO_CONTEXT, -+ EGL_LINUX_DMA_BUF_EXT, NULL, attribs_1_5); -+ -+ } else -+#endif -+ { -+ attribs[atti++] = EGL_WIDTH; -+ attribs[atti++] = GST_VIDEO_INFO_COMP_WIDTH (in_info, plane); -+ attribs[atti++] = EGL_HEIGHT; -+ attribs[atti++] = GST_VIDEO_INFO_COMP_HEIGHT (in_info, plane); -+ attribs[atti++] = EGL_LINUX_DRM_FOURCC_EXT; -+ attribs[atti++] = fourcc; -+ attribs[atti++] = EGL_DMA_BUF_PLANE0_FD_EXT; -+ attribs[atti++] = dmabuf; -+ attribs[atti++] = EGL_DMA_BUF_PLANE0_OFFSET_EXT; -+ attribs[atti++] = offset; -+ attribs[atti++] = EGL_DMA_BUF_PLANE0_PITCH_EXT; -+ attribs[atti++] = GST_VIDEO_INFO_PLANE_STRIDE (in_info, plane); -+ attribs[atti] = EGL_NONE; -+ -+ for (int i = 0; i < atti; i++) -+ GST_LOG ("attr %i: %08X", i, attribs[i]); -+ -+ g_assert (atti == 12); -+ -+ img = ctx_egl->eglCreateImage (ctx_egl->egl_display, EGL_NO_CONTEXT, -+ EGL_LINUX_DMA_BUF_EXT, NULL, attribs); -+ } - if (!img) { - GST_WARNING_OBJECT (allocator, "eglCreateImage failed: %s", - gst_gl_context_egl_get_error_string (eglGetError ())); -diff --git a/gst-libs/gst/gl/egl/gstglcontext_egl.c b/gst-libs/gst/gl/egl/gstglcontext_egl.c -index ceafdf344db8..df6ba3ffd66f 100644 ---- a/gst-libs/gst/gl/egl/gstglcontext_egl.c -+++ b/gst-libs/gst/gl/egl/gstglcontext_egl.c -@@ -309,8 +309,8 @@ gst_gl_context_egl_create_context (GstGLContext * context, - GstGLContextEGL *egl; - GstGLWindow *window = NULL; - EGLNativeWindowType window_handle = (EGLNativeWindowType) 0; -- EGLint majorVersion; -- EGLint minorVersion; -+ EGLint egl_major; -+ EGLint egl_minor; - gboolean need_surface = TRUE; - guintptr external_gl_context = 0; - GstGLDisplay *display; -@@ -363,8 +363,8 @@ gst_gl_context_egl_create_context (GstGLContext * context, - } - gst_object_unref (display); - -- if (eglInitialize (egl->egl_display, &majorVersion, &minorVersion)) { -- GST_INFO ("egl initialized, version: %d.%d", majorVersion, minorVersion); -+ if (eglInitialize (egl->egl_display, &egl_major, &egl_minor)) { -+ GST_INFO ("egl initialized, version: %d.%d", egl_major, egl_minor); - } else { - g_set_error (error, GST_GL_CONTEXT_ERROR, - GST_GL_CONTEXT_ERROR_RESOURCE_UNAVAILABLE, -@@ -380,16 +380,16 @@ gst_gl_context_egl_create_context (GstGLContext * context, - gint i; - - /* egl + opengl only available with EGL 1.4+ */ -- if (majorVersion == 1 && minorVersion <= 3) { -+ if (egl_major == 1 && egl_minor <= 3) { - if ((gl_api & ~GST_GL_API_OPENGL) == GST_GL_API_NONE) { - g_set_error (error, GST_GL_CONTEXT_ERROR, GST_GL_CONTEXT_ERROR_OLD_LIBS, - "EGL version (%i.%i) too old for OpenGL support, (needed at least 1.4)", -- majorVersion, minorVersion); -+ egl_major, egl_minor); - goto failure; - } else { - GST_WARNING - ("EGL version (%i.%i) too old for OpenGL support, (needed at least 1.4)", -- majorVersion, minorVersion); -+ egl_major, egl_minor); - if (gl_api & GST_GL_API_GLES2) { - goto try_gles2; - } else { -@@ -599,7 +599,7 @@ gst_gl_context_egl_create_context (GstGLContext * context, - } - - /* EGLImage functions */ -- if (GST_GL_CHECK_GL_VERSION (majorVersion, minorVersion, 1, 5)) { -+ if (GST_GL_CHECK_GL_VERSION (egl_major, egl_minor, 1, 5)) { - egl->eglCreateImage = gst_gl_context_get_proc_address (context, - "eglCreateImage"); - egl->eglDestroyImage = gst_gl_context_get_proc_address (context, -@@ -614,7 +614,9 @@ gst_gl_context_egl_create_context (GstGLContext * context, - egl->eglCreateImage = NULL; - egl->eglDestroyImage = NULL; - } -- -+ egl->egl_major = egl_major; -+ egl->egl_minor = egl_minor; -+ - if (window) - gst_object_unref (window); - -diff --git a/gst-libs/gst/gl/egl/gstglcontext_egl.h b/gst-libs/gst/gl/egl/gstglcontext_egl.h -index 90abb03f8d8e..4a72ddf225c2 100644 ---- a/gst-libs/gst/gl/egl/gstglcontext_egl.h -+++ b/gst-libs/gst/gl/egl/gstglcontext_egl.h -@@ -46,6 +46,9 @@ struct _GstGLContextEGL { - EGLSurface egl_surface; - EGLConfig egl_config; - -+ gint egl_major; -+ gint egl_minor; -+ - GstGLAPI gl_api; - - const gchar *egl_exts; diff --git a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0016-glimagesink-Fix-horizontal-vertical-flip-matrizes.patch b/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0016-glimagesink-Fix-horizontal-vertical-flip-matrizes.patch deleted file mode 100644 index 95b5fe146..000000000 --- a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0016-glimagesink-Fix-horizontal-vertical-flip-matrizes.patch +++ /dev/null @@ -1,41 +0,0 @@ -From b451128bcb719d042fe37b5cbab4efe14d92ddf1 Mon Sep 17 00:00:00 2001 -From: Haihua Hu -Date: Mon, 1 Aug 2016 14:12:35 +0800 -Subject: [PATCH] glimagesink: Fix horizontal/vertical flip matrizes - -They were swapped. - -Upstream-Status: Backport [1.9.2] - -https://bugzilla.gnome.org/show_bug.cgi?id=769371 - -Signed-off-by: Haihua Hu ---- - ext/gl/gstglimagesink.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/ext/gl/gstglimagesink.c b/ext/gl/gstglimagesink.c -index fb60468b361e..cd3147d3fcd4 100644 ---- a/ext/gl/gstglimagesink.c -+++ b/ext/gl/gstglimagesink.c -@@ -472,16 +472,16 @@ static const gfloat counterclockwise_matrix[] = { - - /* horizontal-flip */ - static const gfloat horizontal_flip_matrix[] = { -- 1.0f, 0.0f, 0.0f, 0.0f, -- 0.0f, -1.0f, 0.0f, 0.0f, -+ -1.0f, 0.0f, 0.0f, 0.0f, -+ 0.0f, 1.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 1.0f, 0.0f, - 0.0f, 0.0f, 0.0f, 1.0f, - }; - - /* vertical-flip */ - static const gfloat vertical_flip_matrix[] = { -- -1.0f, 0.0f, 0.0f, 0.0f, -- 0.0f, 1.0f, 0.0f, 0.0f, -+ 1.0f, 0.0f, 0.0f, 0.0f, -+ 0.0f, -1.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 1.0f, 0.0f, - 0.0f, 0.0f, 0.0f, 1.0f, - }; diff --git a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0017-glwindow-Fix-glimagesink-cannot-show-frame-when-conn.patch b/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0017-glwindow-Fix-glimagesink-cannot-show-frame-when-conn.patch deleted file mode 100644 index 71de57068..000000000 --- a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0017-glwindow-Fix-glimagesink-cannot-show-frame-when-conn.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 76477c4516556b9cc8ba95c6402e7b45f4868937 Mon Sep 17 00:00:00 2001 -From: Haihua Hu -Date: Wed, 27 Jul 2016 10:55:01 +0800 -Subject: [PATCH] glwindow: Fix glimagesink cannot show frame when connect to - qmlglsrc - -1.When connect to qmlglsrc, x11 event loop will be replace by qt event loop - which will cause the window cannot receive event from xserver, such as resize -2.Also advertise support for the affine transformation meta in the allocation - query. - -Upstream-Status: Backport [1.9.2] - -https://bugzilla.gnome.org/show_bug.cgi?id=768160 - -Signed-off-by: Haihua Hu ---- - ext/gl/gstglimagesink.c | 2 ++ - gst-libs/gst/gl/x11/gstglwindow_x11.c | 14 +++++++++----- - 2 files changed, 11 insertions(+), 5 deletions(-) - -diff --git a/ext/gl/gstglimagesink.c b/ext/gl/gstglimagesink.c -index cd3147d3fcd4..d81fcfb42330 100644 ---- a/ext/gl/gstglimagesink.c -+++ b/ext/gl/gstglimagesink.c -@@ -1957,6 +1957,8 @@ gst_glimage_sink_propose_allocation (GstBaseSink * bsink, GstQuery * query) - - gst_query_add_allocation_meta (query, - GST_VIDEO_OVERLAY_COMPOSITION_META_API_TYPE, allocation_meta); -+ gst_query_add_allocation_meta (query, -+ GST_VIDEO_AFFINE_TRANSFORMATION_META_API_TYPE, 0); - - if (allocation_meta) - gst_structure_free (allocation_meta); -diff --git a/gst-libs/gst/gl/x11/gstglwindow_x11.c b/gst-libs/gst/gl/x11/gstglwindow_x11.c -index 67160f6d700d..bc7b9c09cf5f 100644 ---- a/gst-libs/gst/gl/x11/gstglwindow_x11.c -+++ b/gst-libs/gst/gl/x11/gstglwindow_x11.c -@@ -399,6 +399,7 @@ draw_cb (gpointer data) - GstGLWindow *window = GST_GL_WINDOW (window_x11); - - if (gst_gl_window_is_running (window)) { -+ guint width, height; - XWindowAttributes attr; - - XGetWindowAttributes (window_x11->device, window_x11->internal_win_id, -@@ -422,13 +423,16 @@ draw_cb (gpointer data) - } - } - -- if (window_x11->allow_extra_expose_events) { -- if (window->queue_resize) { -- guint width, height; -+ gst_gl_window_get_surface_dimensions (window, &width, &height); -+ if (attr.width != width || attr.height != height) { -+ width = attr.width; -+ height = attr.height; -+ gst_gl_window_queue_resize (window); -+ } - -- gst_gl_window_get_surface_dimensions (window, &width, &height); -+ if (window_x11->allow_extra_expose_events) { -+ if (window->queue_resize) - gst_gl_window_resize (window, width, height); -- } - - if (window->draw) { - GstGLContext *context = gst_gl_window_get_context (window); diff --git a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0018-ion_allocator-refine-ion-allocator-code.patch b/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0018-ion_allocator-refine-ion-allocator-code.patch deleted file mode 100644 index 81daa9943..000000000 --- a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0018-ion_allocator-refine-ion-allocator-code.patch +++ /dev/null @@ -1,369 +0,0 @@ -From 8df54492568e25a91febd36190cb386be369195b Mon Sep 17 00:00:00 2001 -From: Song Bing -Date: Fri, 12 Aug 2016 09:33:00 +0800 -Subject: [PATCH] ion_allocator: refine ion allocator code. - -Refine ion allocator code and remove all compile warning. -Changed ion allocated heap to DMA. - -Upstream-Status: Pending - -https://bugzilla.gnome.org/show_bug.cgi?id=768794 ---- - gst-libs/gst/ion/gstionmemory.c | 232 ++++++++++++++-------------------------- - gst-libs/gst/ion/gstionmemory.h | 1 - - 2 files changed, 82 insertions(+), 151 deletions(-) - -diff --git a/gst-libs/gst/ion/gstionmemory.c b/gst-libs/gst/ion/gstionmemory.c -index ea62ac4926c1..4c160c94176a 100755 ---- a/gst-libs/gst/ion/gstionmemory.c -+++ b/gst-libs/gst/ion/gstionmemory.c -@@ -21,6 +21,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -29,116 +30,34 @@ - #include - #include "gstionmemory.h" - --GST_DEBUG_CATEGORY_STATIC(ion_allocator_debug); -+GST_DEBUG_CATEGORY_STATIC (ion_allocator_debug); - #define GST_CAT_DEFAULT ion_allocator_debug - - #define gst_ion_allocator_parent_class parent_class - - #define PAGE_ALIGN(x) (((x) + 4095) & ~4095) - --G_DEFINE_TYPE(GstIONAllocator, gst_ion_allocator, GST_TYPE_ALLOCATOR) -+G_DEFINE_TYPE (GstIONAllocator, gst_ion_allocator, GST_TYPE_ALLOCATOR) - --static int --gst_ion_open() -+static gint -+gst_ion_ioctl (gint fd, gint req, void *arg) - { -- int fd = open("/dev/ion", O_RDWR); -- if (fd < 0) -- GST_ERROR ("open /dev/ion failed!\n"); -- return fd; --} -- --static int --gst_ion_close(int fd) --{ -- int ret = close(fd); -- if (ret < 0) -- return -errno; -- return ret; --} -- --static int --gst_ion_ioctl(int fd, int req, void *arg) --{ -- int ret = ioctl(fd, req, arg); -+ gint ret = ioctl (fd, req, arg); - if (ret < 0) { -- GST_ERROR ("ioctl %x failed with code %d: %s\n", req, -- ret, strerror(errno)); -- return -errno; -- } -- return ret; --} -- --static int --gst_ion_alloc(int fd, size_t len, size_t align, unsigned int heap_mask, -- unsigned int flags, ion_user_handle_t *handle) --{ -- int ret; -- struct ion_allocation_data data = { -- .len = len, -- .align = align, -- .heap_id_mask = heap_mask, -- .flags = flags, -- }; -- -- if (handle == NULL) -- return -EINVAL; -- -- ret = gst_ion_ioctl(fd, ION_IOC_ALLOC, &data); -- if (ret < 0) -- return ret; -- *handle = data.handle; -- return ret; --} -- --static int --gst_ion_free(int fd, ion_user_handle_t handle) --{ -- struct ion_handle_data data = { -- .handle = handle, -- }; -- return gst_ion_ioctl(fd, ION_IOC_FREE, &data); --} -- --static int --gst_ion_map(int fd, ion_user_handle_t handle, size_t length, int prot, -- int flags, off_t offset, unsigned char **ptr, int *map_fd) --{ -- int ret; -- unsigned char *tmp_ptr; -- struct ion_fd_data data = { -- .handle = handle, -- }; -- -- if (map_fd == NULL) -- return -EINVAL; -- if (ptr == NULL) -- return -EINVAL; -- -- ret = gst_ion_ioctl(fd, ION_IOC_MAP, &data); -- if (ret < 0) -- return ret; -- if (data.fd < 0) { -- GST_ERROR ("map ioctl returned negative fd\n"); -- return -EINVAL; -- } -- tmp_ptr = mmap(NULL, length, prot, flags, data.fd, offset); -- if (tmp_ptr == MAP_FAILED) { -- GST_ERROR ("mmap failed: %s\n", strerror(errno)); -- return -errno; -+ GST_ERROR ("ioctl %x failed with code %d: %s\n", req, ret, -+ strerror (errno)); - } -- *map_fd = data.fd; -- *ptr = tmp_ptr; - return ret; - } - --static void --gst_ion_mem_init(void) -+static void -+gst_ion_mem_init (void) - { -- GstAllocator *allocator = g_object_new(gst_ion_allocator_get_type(), NULL); -+ GstAllocator *allocator = g_object_new (gst_ion_allocator_get_type (), NULL); - GstIONAllocator *self = GST_ION_ALLOCATOR (allocator); - gint fd; - -- fd = gst_ion_open(); -+ fd = open ("/dev/ion", O_RDWR); - if (fd < 0) { - GST_ERROR ("Could not open ion driver"); - g_object_unref (self); -@@ -146,24 +65,24 @@ gst_ion_mem_init(void) - } - - self->fd = fd; -- self->dma_allocator = gst_dmabuf_allocator_new(); -+ self->dma_allocator = gst_dmabuf_allocator_new (); - -- gst_allocator_register(GST_TYPE_ION_ALLOCATOR, allocator); -+ gst_allocator_register (GST_ALLOCATOR_ION, allocator); - } - --GstAllocator* --gst_ion_allocator_obtain(void) -+GstAllocator * -+gst_ion_allocator_obtain (void) - { -- static GOnce ion_allocator_once = G_ONCE_INIT; -- GstAllocator *allocator; -+ static GOnce ion_allocator_once = G_ONCE_INIT; -+ GstAllocator *allocator; - -- g_once(&ion_allocator_once, (GThreadFunc)gst_ion_mem_init, NULL); -+ g_once (&ion_allocator_once, (GThreadFunc) gst_ion_mem_init, NULL); - -- allocator = gst_allocator_find(GST_TYPE_ION_ALLOCATOR); -- if (allocator == NULL) -- GST_WARNING("No allocator named %s found", GST_TYPE_ION_ALLOCATOR); -+ allocator = gst_allocator_find (GST_ALLOCATOR_ION); -+ if (allocator == NULL) -+ GST_WARNING ("No allocator named %s found", GST_ALLOCATOR_ION); - -- return allocator; -+ return allocator; - } - - GQuark -@@ -178,62 +97,69 @@ gst_ion_memory_quark (void) - } - - static GstMemory * --gst_ion_alloc_alloc (GstAllocator * allocator, gint size, -+gst_ion_alloc_alloc (GstAllocator * allocator, gsize size, - GstAllocationParams * params) - { - GstIONAllocator *self = GST_ION_ALLOCATOR (allocator); -- gint dmafd = -1; -- guint8 *ptr = NULL; -- ion_user_handle_t ionHandle; -- gint ionSize = PAGE_ALIGN (size + params->prefix + params->padding); -- gint err; -- -- if (self->fd < 0) -+ struct ion_allocation_data allocation_data = { 0 }; -+ struct ion_fd_data fd_data = { 0 }; -+ struct ion_handle_data handle_data = { 0 }; -+ ion_user_handle_t ion_handle; -+ GstIONMemory *ion_mem; -+ GstMemory *mem; -+ gsize ion_size; -+ gint dma_fd = -1; -+ gint ret; -+ -+ if (self->fd < 0) { -+ GST_ERROR ("ion allocate param wrong"); - return NULL; -+ } - -- err = gst_ion_alloc(self->fd, ionSize, 8, 1, 0, &ionHandle); -- if (err) { -- GST_ERROR ("gst_ion_alloc failed."); -+ ion_size = PAGE_ALIGN (size + params->prefix + params->padding); -+ allocation_data.len = ion_size; -+ allocation_data.align = params->align; -+ allocation_data.heap_id_mask = ION_HEAP_TYPE_DMA_MASK; -+ allocation_data.flags = 0; -+ if (gst_ion_ioctl (self->fd, ION_IOC_ALLOC, &allocation_data) < 0) { -+ GST_ERROR ("ion allocate failed."); - return NULL; - } -+ ion_handle = allocation_data.handle; - -- err = gst_ion_map(self->fd, ionHandle, ionSize, PROT_READ | PROT_WRITE, -- MAP_SHARED, 0, &ptr, &dmafd); -- if (err) { -- GST_ERROR ("gst_ion_map failed."); -+ fd_data.handle = ion_handle; -+ ret = gst_ion_ioctl (self->fd, ION_IOC_MAP, &fd_data); -+ if (ret < 0 || fd_data.fd < 0) { -+ GST_ERROR ("map ioctl failed or returned negative fd"); - goto bail; - } -- GST_DEBUG ("phyalloc ptr:0x%x, ionSize:%d dmafd: %d", (int32_t)ptr, -- ionSize, dmafd); -+ dma_fd = fd_data.fd; - -- GstIONMemory *ion_mem = g_slice_new0 (GstIONMemory); -+ ion_mem = g_slice_new0 (GstIONMemory); - gst_memory_init (GST_MEMORY_CAST (ion_mem), GST_MEMORY_FLAG_NO_SHARE, -- allocator, 0, size, 0, 0, size); -+ allocator, NULL, ion_size, params->align, params->prefix, size); - -- ion_mem->vaddr = ptr; -- ion_mem->size = ionSize; -- ion_mem->handle = ionHandle; -- ion_mem->fd = dmafd; -+ ion_mem->size = ion_size; -+ ion_mem->handle = ion_handle; -+ ion_mem->fd = dma_fd; - -- GstMemory * mem = -- gst_dmabuf_allocator_alloc(self->dma_allocator, dmafd, ionSize); -+ mem = gst_dmabuf_allocator_alloc (self->dma_allocator, dma_fd, size); - - gst_mini_object_set_qdata (GST_MINI_OBJECT (mem), GST_ION_MEMORY_QUARK, -- ion_mem, gst_memory_unref); -+ ion_mem, (GDestroyNotify) gst_memory_unref); - -- GST_LOG ("allocated memory %p by allocator %p with qdata %p\n", -- mem, allocator, ion_mem); -+ GST_LOG ("ion allocated size: %" G_GSIZE_FORMAT "DMA FD: %d", ion_size, -+ dma_fd); - - return mem; - - bail: -- gst_ion_free(self->fd, ionHandle); -- if (ptr != MAP_FAILED) { -- munmap(ptr, ionSize); -- } -- if (dmafd > 0) { -- close(dmafd); -+ if (dma_fd >= 0) { -+ close (dma_fd); - } -+ handle_data.handle = ion_handle; -+ gst_ion_ioctl (self->fd, ION_IOC_FREE, &handle_data); -+ - return NULL; - } - -@@ -242,15 +168,20 @@ gst_ion_alloc_free (GstAllocator * allocator, GstMemory * memory) - { - GstIONAllocator *self = GST_ION_ALLOCATOR (allocator); - GstIONMemory *ion_mem = (GstIONMemory *) memory; -+ struct ion_handle_data handle_data = { 0 }; -+ ion_user_handle_t ion_handle; - -- if (!ion_mem || self->fd < 0) -+ if (self->fd < 0 || !ion_mem || ion_mem->fd < 0) { -+ GST_ERROR ("ion free param wrong"); - return; -+ } - -- ion_user_handle_t ionHandle = -- (ion_user_handle_t)ion_mem->handle; -- munmap(ion_mem->vaddr, ion_mem->size); -- close(ion_mem->fd); -- gst_ion_free(self->fd, ionHandle); -+ GST_LOG ("ion free size: %" G_GSIZE_FORMAT "DMA FD: %d", ion_mem->size, -+ ion_mem->fd); -+ close (ion_mem->fd); -+ ion_handle = (ion_user_handle_t) ion_mem->handle; -+ handle_data.handle = ion_handle; -+ gst_ion_ioctl (self->fd, ION_IOC_FREE, &handle_data); - - g_slice_free (GstIONMemory, ion_mem); - } -@@ -261,13 +192,14 @@ gst_ion_allocator_dispose (GObject * object) - GstIONAllocator *self = GST_ION_ALLOCATOR (object); - - if (self->fd > 0) { -- close(self->fd); -+ close (self->fd); - self->fd = -1; - } - -- if (self->dma_allocator) -- gst_object_unref(self->dma_allocator); -- self->dma_allocator = NULL; -+ if (self->dma_allocator) { -+ gst_object_unref (self->dma_allocator); -+ self->dma_allocator = NULL; -+ } - - G_OBJECT_CLASS (parent_class)->dispose (object); - } -@@ -282,7 +214,8 @@ gst_ion_allocator_class_init (GstIONAllocatorClass * klass) - allocator_class->free = GST_DEBUG_FUNCPTR (gst_ion_alloc_free); - gobject_class->dispose = GST_DEBUG_FUNCPTR (gst_ion_allocator_dispose); - -- GST_DEBUG_CATEGORY_INIT(ion_allocator_debug, "ionmemory", 0, "DMA FD memory allocator based on ion"); -+ GST_DEBUG_CATEGORY_INIT (ion_allocator_debug, "ionmemory", 0, -+ "DMA FD memory allocator based on ion"); - } - - static void -@@ -294,4 +227,3 @@ gst_ion_allocator_init (GstIONAllocator * self) - allocator->mem_map = NULL; - allocator->mem_unmap = NULL; - } -- -diff --git a/gst-libs/gst/ion/gstionmemory.h b/gst-libs/gst/ion/gstionmemory.h -index b6dca5fb9bfe..406806d8d7cb 100755 ---- a/gst-libs/gst/ion/gstionmemory.h -+++ b/gst-libs/gst/ion/gstionmemory.h -@@ -59,7 +59,6 @@ struct _GstIONMemory { - GstMemory mem; - - gint fd; -- guint8 *vaddr; - gsize size; - gint handle; - }; diff --git a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0019-videocompositor-Remove-output-format-alpha-check.patch b/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0019-videocompositor-Remove-output-format-alpha-check.patch deleted file mode 100644 index cd0a0f6fa..000000000 --- a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad-1.8.3/0019-videocompositor-Remove-output-format-alpha-check.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 1ae4df222f7c0e141e61e22228c9d69b7966f84c Mon Sep 17 00:00:00 2001 -From: Song Bing -Date: Tue, 16 Aug 2016 13:11:57 +0800 -Subject: [PATCH] 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 1254e2e53560..4bd57b482b5e 100644 ---- a/gst-libs/gst/video/gstvideoaggregator.c -+++ b/gst-libs/gst/video/gstvideoaggregator.c -@@ -777,11 +777,9 @@ gst_videoaggregator_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; - } - } - diff --git a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.8.3.bbappend b/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.8.3.bbappend deleted file mode 100644 index 0bb9d4c0b..000000000 --- a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.8.3.bbappend +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright 2015-2017, Digi International Inc. - -FILESEXTRAPATHS_prepend := "${THISDIR}/${BP}:" - -SRC_URI_append_imxgpu2d = " \ - file://0001-mpegtsmux-Need-get-pid-when-create-streams.patch \ - file://0002-mpeg4videoparse-Need-detect-picture-coding-type-when.patch \ - file://0003-mpegvideoparse-Need-detect-picture-coding-type-when-.patch \ - file://0004-modifiy-the-videoparse-rank.patch \ - file://0005-glfilter-Lost-frame-rate-info-when-fixate-caps.patch \ - file://0006-opencv-Add-video-stitching-support-based-on-Open-CV.patch \ - file://0007-camerabin-Add-one-property-to-set-sink-element-for-v.patch \ - file://0008-Fix-for-gl-plugin-not-built-in-wayland-backend.patch \ - file://0009-gl-wayland-fix-loop-test-hang-in-glimagesink.patch \ - file://0010-Fix-glimagesink-wayland-resize-showed-blurred-screen.patch \ - file://0011-support-video-crop-for-glimagesink.patch \ - file://0012-Add-fps-print-in-glimagesink.patch \ - file://0013-glimagesink-support-video-rotation-using-transform-m.patch \ - file://0014-ion-DMA-Buf-allocator-based-on-ion.patch \ - file://0015-EGL_DMA_Buf-Wrong-attribute-list-type-for-EGL-1.5.patch \ - file://0016-glimagesink-Fix-horizontal-vertical-flip-matrizes.patch \ - file://0017-glwindow-Fix-glimagesink-cannot-show-frame-when-conn.patch \ - file://0018-ion_allocator-refine-ion-allocator-code.patch \ - file://0019-videocompositor-Remove-output-format-alpha-check.patch \ -" - - -# Enable 'egl' packageconfig so 'glimagesink' is compiled -PACKAGECONFIG_GL_append_imxgpu3d = " ${@bb.utils.contains('DISTRO_FEATURES', 'opengl', 'egl', '', d)}" - -# include fragment shaders -FILES_${PN}-opengl += "/usr/share/*.fs" diff --git a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base-1.8.3/0001-basetextoverlay-make-memory-copy-when-video-buffer-s.patch b/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base-1.8.3/0001-basetextoverlay-make-memory-copy-when-video-buffer-s.patch deleted file mode 100644 index ace9590b1..000000000 --- a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base-1.8.3/0001-basetextoverlay-make-memory-copy-when-video-buffer-s.patch +++ /dev/null @@ -1,75 +0,0 @@ -From: Mingke Wang -Date: Fri, 16 Oct 2015 19:31:32 +0800 -Subject: [PATCH] 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 -Signed-off-by: Lyon Wang ---- - 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 e3de7c1eaa1d..50981a77c0c9 ---- a/ext/pango/gstbasetextoverlay.c -+++ b/ext/pango/gstbasetextoverlay.c -@@ -2220,16 +2220,44 @@ gst_base_text_overlay_push_frame (GstBaseTextOverlay * overlay, - if (gst_pad_check_reconfigure (overlay->srcpad)) - gst_base_text_overlay_negotiate (overlay, NULL); - -- 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; diff --git a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base-1.8.3/0002-gstplaysink-don-t-set-async-of-custom-text-sink-to-f.patch b/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base-1.8.3/0002-gstplaysink-don-t-set-async-of-custom-text-sink-to-f.patch deleted file mode 100644 index 75b0c7153..000000000 --- a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base-1.8.3/0002-gstplaysink-don-t-set-async-of-custom-text-sink-to-f.patch +++ /dev/null @@ -1,31 +0,0 @@ -From: Mingke Wang -Date: Thu, 19 Mar 2015 14:15:25 +0800 -Subject: [PATCH] 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 -Signed-off-by: Lyon Wang ---- - 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 e17c4392af4e..d12a11a7bcd7 ---- a/gst/playback/gstplaysink.c -+++ b/gst/playback/gstplaysink.c -@@ -2433,7 +2433,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 */ diff --git a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base-1.8.3/0003-taglist-not-send-to-down-stream-if-all-the-frame-cor.patch b/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base-1.8.3/0003-taglist-not-send-to-down-stream-if-all-the-frame-cor.patch deleted file mode 100644 index 3e01380e7..000000000 --- a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base-1.8.3/0003-taglist-not-send-to-down-stream-if-all-the-frame-cor.patch +++ /dev/null @@ -1,54 +0,0 @@ -From: Lyon Wang -Date: Wed, 21 Oct 2015 16:35:43 +0800 -Subject: [PATCH] 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 -Signed-off-by: Lyon Wang ---- - 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 8c43cbb74e33..cf73691c0d46 100644 ---- a/gst-libs/gst/audio/gstaudiodecoder.c -+++ b/gst-libs/gst/audio/gstaudiodecoder.c -@@ -2279,6 +2279,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 068b25a681b3..5ba6238555f9 100644 ---- a/gst-libs/gst/video/gstvideodecoder.c -+++ b/gst-libs/gst/video/gstvideodecoder.c -@@ -1176,6 +1176,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: diff --git a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base-1.8.3/0004-handle-audio-video-decoder-error.patch b/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base-1.8.3/0004-handle-audio-video-decoder-error.patch deleted file mode 100644 index 40a6a56db..000000000 --- a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base-1.8.3/0004-handle-audio-video-decoder-error.patch +++ /dev/null @@ -1,62 +0,0 @@ -From: Lyon Wang -Date: Mon, 15 Dec 2014 16:52:07 +0800 -Subject: [PATCH] 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 ---- - 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 cf73691c0d46..0a64c99d3fda ---- a/gst-libs/gst/audio/gstaudiodecoder.c -+++ b/gst-libs/gst/audio/gstaudiodecoder.c -@@ -2274,9 +2274,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 5ba6238555f9..4c90af800b9f ---- a/gst-libs/gst/video/gstvideodecoder.c -+++ b/gst-libs/gst/video/gstvideodecoder.c -@@ -1162,9 +1162,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 diff --git a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base-1.8.3/0005-gstaudiobasesink-print-warning-istead-of-return-ERRO.patch b/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base-1.8.3/0005-gstaudiobasesink-print-warning-istead-of-return-ERRO.patch deleted file mode 100644 index ea6c5bc9d..000000000 --- a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base-1.8.3/0005-gstaudiobasesink-print-warning-istead-of-return-ERRO.patch +++ /dev/null @@ -1,43 +0,0 @@ -From: Lyon Wang -Date: Tue, 17 Nov 2015 14:56:47 +0800 -Subject: [PATCH] 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 ---- - 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 62fab35eec10..2f6e6f09b3a5 ---- a/gst-libs/gst/audio/gstaudiobasesink.c -+++ b/gst-libs/gst/audio/gstaudiobasesink.c -@@ -1137,10 +1137,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); diff --git a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base-1.8.3/0006-Disable-orc-optimization-for-lib-video-in-plugins-ba.patch b/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base-1.8.3/0006-Disable-orc-optimization-for-lib-video-in-plugins-ba.patch deleted file mode 100644 index 6bdf3c50a..000000000 --- a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base-1.8.3/0006-Disable-orc-optimization-for-lib-video-in-plugins-ba.patch +++ /dev/null @@ -1,30 +0,0 @@ -From: Lyon Wang -Date: Thu, 10 Dec 2015 14:32:43 +0800 -Subject: [PATCH] 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 -Community ticket: https://bugzilla.gnome.org/show_bug.cgi?id=759286 -Upstream status: pending - -Signed-off-by: Lyon Wang ---- - 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 44c590a7b88b..b2b5617f693e 100644 ---- a/gst-libs/gst/video/Makefile.am -+++ b/gst-libs/gst/video/Makefile.am -@@ -86,7 +86,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) - diff --git a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.8.3.bbappend b/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.8.3.bbappend deleted file mode 100644 index dd06c5845..000000000 --- a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_1.8.3.bbappend +++ /dev/null @@ -1,12 +0,0 @@ -# Copyright 2015-2017, Digi International Inc. - -FILESEXTRAPATHS_prepend := "${THISDIR}/${BP}:" - -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://0003-taglist-not-send-to-down-stream-if-all-the-frame-cor.patch \ - file://0004-handle-audio-video-decoder-error.patch \ - file://0005-gstaudiobasesink-print-warning-istead-of-return-ERRO.patch \ - file://0006-Disable-orc-optimization-for-lib-video-in-plugins-ba.patch \ -" diff --git a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good-1.8.3/0001-Need-to-check-if-pa-stream-is-still-valid.patch b/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good-1.8.3/0001-Need-to-check-if-pa-stream-is-still-valid.patch deleted file mode 100644 index 1b4bece73..000000000 --- a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good-1.8.3/0001-Need-to-check-if-pa-stream-is-still-valid.patch +++ /dev/null @@ -1,36 +0,0 @@ -From: Jian -Date: Tue, 3 Feb 2015 17:08:40 +0800 -Subject: [PATCH] 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 -Signed-off-by: Lyon Wang ---- - ext/pulse/pulsesink.c | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/ext/pulse/pulsesink.c b/ext/pulse/pulsesink.c -index c88fa965b0ee..2f3bc603f447 100644 ---- a/ext/pulse/pulsesink.c -+++ b/ext/pulse/pulsesink.c -@@ -2023,6 +2023,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; - diff --git a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good-1.8.3/0002-Fix-aacpase-error-tolerance-issue.patch b/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good-1.8.3/0002-Fix-aacpase-error-tolerance-issue.patch deleted file mode 100644 index 93be9e47e..000000000 --- a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good-1.8.3/0002-Fix-aacpase-error-tolerance-issue.patch +++ /dev/null @@ -1,30 +0,0 @@ -From: Lyon Wang -Date: Fri, 6 Feb 2015 11:27:47 +0800 -Subject: [PATCH] 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 ---- - 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 514e4f489c1e..8e106635211d 100644 ---- a/gst/audioparsers/gstaacparse.c -+++ b/gst/audioparsers/gstaacparse.c -@@ -861,7 +861,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; - } diff --git a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good-1.8.3/0003-ximageutil-shouldn-t-implement-transform-if-don-t-su.patch b/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good-1.8.3/0003-ximageutil-shouldn-t-implement-transform-if-don-t-su.patch deleted file mode 100644 index 4d794a671..000000000 --- a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good-1.8.3/0003-ximageutil-shouldn-t-implement-transform-if-don-t-su.patch +++ /dev/null @@ -1,44 +0,0 @@ -From: Song Bing -Date: Tue, 26 Apr 2016 16:49:33 +0800 -Subject: [PATCH] ximageutil: shouldn't implement transform if don't support - it. - -shouldn't implement transform if don't support it. Or -gst_buffer_copy_into() will print ERROR log. - -Upstream-Status: Backport [1.9.1] - -https://bugzilla.gnome.org/show_bug.cgi?id=765583 ---- - sys/ximage/ximageutil.c | 11 +---------- - 1 file changed, 1 insertion(+), 10 deletions(-) - -diff --git a/sys/ximage/ximageutil.c b/sys/ximage/ximageutil.c -index ac2fd49f0c34..add04225b823 100644 ---- a/sys/ximage/ximageutil.c -+++ b/sys/ximage/ximageutil.c -@@ -36,15 +36,6 @@ gst_meta_ximage_api_get_type (void) - return type; - } - --static gboolean --gst_meta_ximage_transform (GstBuffer * dest, GstMeta * meta, -- GstBuffer * buffer, GQuark type, gpointer data) --{ -- /* ximage metadata can't be transformed or copied */ -- -- return FALSE; --} -- - const GstMetaInfo * - gst_meta_ximage_get_info (void) - { -@@ -54,7 +45,7 @@ gst_meta_ximage_get_info (void) - const GstMetaInfo *meta = - gst_meta_register (gst_meta_ximage_api_get_type (), "GstMetaXImageSrc", - sizeof (GstMetaXImage), (GstMetaInitFunction) NULL, -- (GstMetaFreeFunction) NULL, gst_meta_ximage_transform); -+ (GstMetaFreeFunction) NULL, (GstMetaTransformFunction) NULL); - g_once_init_leave (&meta_ximage_info, meta); - } - return meta_ximage_info; diff --git a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.8.3.bbappend b/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.8.3.bbappend deleted file mode 100644 index 343b50ad5..000000000 --- a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.8.3.bbappend +++ /dev/null @@ -1,11 +0,0 @@ -# Copyright 2015-2017, Digi International Inc. - -FILESEXTRAPATHS_prepend := "${THISDIR}/${BP}:" - -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-ximageutil-shouldn-t-implement-transform-if-don-t-su.patch \ -" - -PACKAGECONFIG_append = " vpx" diff --git a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server_1.8.3.bbappend b/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server_1.8.3.bbappend deleted file mode 100644 index f093a473b..000000000 --- a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0-rtsp-server_1.8.3.bbappend +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright 2015-2017, Digi International Inc. - -GST_RTSP_EXAMPLES ?= " \ - test-appsrc \ - test-auth \ - test-cgroups \ - test-launch \ - test-mp4 \ - test-multicast \ - test-multicast2 \ - test-netclock \ - test-netclock-client \ - test-ogg \ - test-readme \ - test-record \ - test-record-auth \ - test-sdp \ - test-uri \ - test-video \ - test-video-rtx \ -" - -PACKAGECONFIG_append = " examples" -PACKAGECONFIG[examples] = "--enable-examples,--disable-examples" - -do_install_append() { - # Install examples - install -d ${D}${datadir}/${BP} - for f in ${GST_RTSP_EXAMPLES}; do - install -m 0755 ${B}/examples/.libs/${f} ${D}${datadir}/${BP} - done -} - -PACKAGES =+ "${PN}-examples-dbg ${PN}-examples" - -FILES_${PN}-examples-dbg += "${datadir}/${BP}/.debug" -FILES_${PN}-examples += "${datadir}" diff --git a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0_1.8.3.bbappend b/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0_1.8.3.bbappend deleted file mode 100644 index 6126a80f7..000000000 --- a/meta-digi-dey/recipes-multimedia/gstreamer/gstreamer1.0_1.8.3.bbappend +++ /dev/null @@ -1,11 +0,0 @@ -# Copyright 2015-2017, Digi International Inc. - -FILESEXTRAPATHS_prepend := "${THISDIR}/${BP}:" - -SRC_URI_append = " \ - file://0001-handle-base-parse-error.patch \ - file://0002-Fix-crash-with-gst-inspect-Chris-Lord-chris-openedha.patch \ - file://0003-unset-FLAG_DISCONT-when-push-to-adapter.patch \ - file://0004-Need-push-adapter-remainning-data-in-pass-through-mo.patch \ - file://0005-inputselector-should-proceed-non-active-pad-buffer-e.patch \ -" diff --git a/meta-digi-dey/recipes-multimedia/imx-codec/imx-codec_4.2.1.bb b/meta-digi-dey/recipes-multimedia/imx-codec/imx-codec_4.2.1.bb deleted file mode 100644 index 6076ee964..000000000 --- a/meta-digi-dey/recipes-multimedia/imx-codec/imx-codec_4.2.1.bb +++ /dev/null @@ -1,11 +0,0 @@ -# Copyright (C) 2013-2016 Freescale Semiconductor -# Copyright 2017 NXP -# Released under the MIT license (see COPYING.MIT for the terms) - -require recipes-multimedia/imx-codec/imx-codec.inc -LIC_FILES_CHKSUM = "file://COPYING;md5=6b552f505eedab4a11ab538cf3db743a" - -SRC_URI[md5sum] = "3db67e3f602e65fe0ac00ae4f9ea6109" -SRC_URI[sha256sum] = "20d3f9b4187fcd9e7007c94558a00bab1191513eee74b6f0d8c7b43f874e06ed" - -COMPATIBLE_MACHINE = "(ccimx6qpsbc)" diff --git a/meta-digi-dey/recipes-multimedia/imx-parser/imx-parser_4.2.1.bb b/meta-digi-dey/recipes-multimedia/imx-parser/imx-parser_4.2.1.bb deleted file mode 100644 index dcac23417..000000000 --- a/meta-digi-dey/recipes-multimedia/imx-parser/imx-parser_4.2.1.bb +++ /dev/null @@ -1,11 +0,0 @@ -# Copyright (C) 2013-2016 Freescale Semiconductor -# Copyright 2017 NXP -# Released under the MIT license (see COPYING.MIT for the terms) - -include recipes-multimedia/imx-parser/imx-parser.inc -LIC_FILES_CHKSUM = "file://COPYING;md5=6b552f505eedab4a11ab538cf3db743a" - -SRC_URI[md5sum] = "6717799abce0dc5918db8d3fd0e39184" -SRC_URI[sha256sum] = "36d3ae7285f3a83a87abf680b8a52b3c07df869d2443de844fb5f0ff528ca862" - -COMPATIBLE_MACHINE = "(ccimx6qpsbc)"