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 <Jose.DiazdeGrenu@digi.com>
This commit is contained in:
parent
edb44f9948
commit
52a10ff88d
|
|
@ -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)"
|
|
||||||
|
|
@ -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)"
|
|
||||||
|
|
@ -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)"
|
|
||||||
|
|
@ -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"
|
|
||||||
|
|
@ -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)"
|
|
||||||
|
|
@ -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
|
|
||||||
}
|
|
||||||
|
|
@ -1,87 +0,0 @@
|
||||||
From 69a92f4576a1e789ba2fcf957164d2c4013020c5 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Otavio Salvador <otavio@ossystems.com.br>
|
|
||||||
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 <otavio@ossystems.com.br>
|
|
||||||
---
|
|
||||||
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
|
|
||||||
|
|
||||||
|
|
@ -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
|
|
||||||
|
|
@ -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)"
|
|
||||||
|
|
@ -1,32 +0,0 @@
|
||||||
From: Lyon Wang <lyon.wang@freescale.com>
|
|
||||||
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 <lyon.wang@freescale.com>
|
|
||||||
---
|
|
||||||
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
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
From: Carlos Rafael Giani <dv@pseudoterminal.org>
|
|
||||||
Date: Sat, 6 Apr 2013 23:52:11 +0200
|
|
||||||
Subject: [PATCH] Fix crash with gst-inspect Chris Lord <chris@openedhand.com>
|
|
||||||
|
|
||||||
Upstream-Status: Pending
|
|
||||||
|
|
||||||
Signed-off-by: Carlos Rafael Giani <dv@pseudoterminal.org>
|
|
||||||
|
|
||||||
Conflicts:
|
|
||||||
tools/gst-inspect.c
|
|
||||||
|
|
||||||
Signed-off-by: Lyon Wang <lyon.wang@freescale.com>
|
|
||||||
---
|
|
||||||
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;
|
|
||||||
|
|
@ -1,30 +0,0 @@
|
||||||
From: Lyon Wang <lyon.wang@freescale.com>
|
|
||||||
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 <lyon.wang@freescale.com>
|
|
||||||
---
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,50 +0,0 @@
|
||||||
From: Lyon Wang <lyon.wang@nxp.com>
|
|
||||||
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 <lyon.wang@nxp.com>
|
|
||||||
Signed-off-by: Lyon Wang <lyon.wang@freescale.com>
|
|
||||||
---
|
|
||||||
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);
|
|
||||||
|
|
@ -1,48 +0,0 @@
|
||||||
From: Song Bing <bing.song@nxp.com>
|
|
||||||
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;
|
|
||||||
|
|
@ -1,44 +0,0 @@
|
||||||
From a3118c47585d98891454731f66e62d79fff153d9 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Song Bing <b06498@freescale.com>
|
|
||||||
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 <lyon.wang@freescale.com>
|
|
||||||
---
|
|
||||||
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 =
|
|
||||||
|
|
@ -1,45 +0,0 @@
|
||||||
From ede36691cbd17db3f8a65d7ed61402111dea6140 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Song Bing <b06498@freescale.com>
|
|
||||||
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 <lyon.wang@freescale.com>
|
|
||||||
---
|
|
||||||
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 {
|
|
||||||
|
|
@ -1,45 +0,0 @@
|
||||||
From cd3bd818c9bfd28bd5eef99181d6343a6a6f2c91 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Song Bing <b06498@freescale.com>
|
|
||||||
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 <lyon.wang@freescale.com>
|
|
||||||
---
|
|
||||||
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");
|
|
||||||
|
|
@ -1,72 +0,0 @@
|
||||||
From 6d38b354a7b6496b208d03fdb45e49b70d825080 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Lyon Wang <lyon.wang@freescale.com>
|
|
||||||
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 <lyon.wang@freescale.com>
|
|
||||||
|
|
||||||
[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 <lyon.wang@freescale.com>
|
|
||||||
---
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,50 +0,0 @@
|
||||||
From a4f0b87d5c4bbe1de5e7cf223d107afbae126110 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Song Bing <b06498@freescale.com>
|
|
||||||
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 <lyon.wang@freescale.com>
|
|
||||||
---
|
|
||||||
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");
|
|
||||||
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,180 +0,0 @@
|
||||||
From b19b98028730e772d7044375b79e4f5508c5a6a3 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Song Bing <b06498@freescale.com>
|
|
||||||
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 <lyon.wang@freescale.com>
|
|
||||||
---
|
|
||||||
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;
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
From 9af5efc2a92bc1ade61eed31a5192ea4bb253549 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Jian <Jian.Li@freescale.com>
|
|
||||||
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 <Jian.Li@freescale.com>
|
|
||||||
Signed-off-by: Lyon Wang <lyon.wang@freescale.com>
|
|
||||||
---
|
|
||||||
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
|
|
||||||
|
|
||||||
|
|
@ -1,140 +0,0 @@
|
||||||
From e15e7af522d381cf84f350d1415f1f4571ff9b26 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Haihua Hu <b55597@freescale.com>
|
|
||||||
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 <b55597@freescale.com>
|
|
||||||
Signed-off-by: Lyon Wang <lyon.wang@freescale.com>
|
|
||||||
---
|
|
||||||
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;
|
|
||||||
|
|
@ -1,30 +0,0 @@
|
||||||
From 057c8d382366f51501a014749f953ce4b702c076 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Haihua Hu <b55597@freescale.com>
|
|
||||||
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 <b55597@freescale.com>
|
|
||||||
Signed-off-by: Lyon Wang <lyon.wang@freescale.com>
|
|
||||||
---
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,149 +0,0 @@
|
||||||
From 226e80315925bb722cfdd5716e078832f3f6b3c4 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Haihua Hu <b55597@freescale.com>
|
|
||||||
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 <b55597@freescale.com>
|
|
||||||
Signed-off-by: Lyon Wang <lyon.wang@freescale.com>
|
|
||||||
---
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,81 +0,0 @@
|
||||||
From f6edb394cc6ada3ce98e2cf9021e6a2ead3b4daf Mon Sep 17 00:00:00 2001
|
|
||||||
From: Haihua Hu <b55597@freescale.com>
|
|
||||||
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 <b55597@freescale.com>
|
|
||||||
Signed-off-by: Lyon Wang <lyon.wang@freescale.com>
|
|
||||||
---
|
|
||||||
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
|
|
||||||
|
|
@ -1,570 +0,0 @@
|
||||||
From 0d53611c59d1c29f1d1cf22f62a50ae1ee21096b Mon Sep 17 00:00:00 2001
|
|
||||||
From: Haihua Hu <jared.hu@nxp.com>
|
|
||||||
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 <jared.hu@nxp.com>
|
|
||||||
---
|
|
||||||
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 <gst/video/video.h>
|
|
||||||
|
|
||||||
#include <gst/gl/gstgl_fwd.h>
|
|
||||||
+#include <gst/video/gstvideoaffinetransformationmeta.h>
|
|
||||||
|
|
||||||
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__ */
|
|
||||||
|
|
@ -1,481 +0,0 @@
|
||||||
From 145ef8665f68fd716fc9def3d765973fd2c2fdd8 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Song Bing <bing.song@nxp.com>
|
|
||||||
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 <errno.h>
|
|
||||||
+#include <fcntl.h>
|
|
||||||
+#include <stdio.h>
|
|
||||||
+#include <string.h>
|
|
||||||
+#include <sys/ioctl.h>
|
|
||||||
+#include <sys/mman.h>
|
|
||||||
+#include <sys/types.h>
|
|
||||||
+#include <linux/ion.h>
|
|
||||||
+
|
|
||||||
+#include <gst/allocators/gstdmabuf.h>
|
|
||||||
+#include "gstionmemory.h"
|
|
||||||
+
|
|
||||||
+GST_DEBUG_CATEGORY_STATIC(ion_allocator_debug);
|
|
||||||
+#define GST_CAT_DEFAULT ion_allocator_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 <gst/gst.h>
|
|
||||||
+#include <gst/gstallocator.h>
|
|
||||||
+
|
|
||||||
+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__ */
|
|
||||||
|
|
@ -1,191 +0,0 @@
|
||||||
From a81404f3e2ceb89f54d1b2345c7606b3863e5c71 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Song Bing <bing.song@nxp.com>
|
|
||||||
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;
|
|
||||||
|
|
@ -1,41 +0,0 @@
|
||||||
From b451128bcb719d042fe37b5cbab4efe14d92ddf1 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Haihua Hu <jared.hu@nxp.com>
|
|
||||||
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 <jared.hu@nxp.com>
|
|
||||||
---
|
|
||||||
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,
|
|
||||||
};
|
|
||||||
|
|
@ -1,68 +0,0 @@
|
||||||
From 76477c4516556b9cc8ba95c6402e7b45f4868937 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Haihua Hu <jared.hu@nxp.com>
|
|
||||||
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 <jared.hu@nxp.com>
|
|
||||||
---
|
|
||||||
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);
|
|
||||||
|
|
@ -1,369 +0,0 @@
|
||||||
From 8df54492568e25a91febd36190cb386be369195b Mon Sep 17 00:00:00 2001
|
|
||||||
From: Song Bing <bing.song@nxp.com>
|
|
||||||
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 <fcntl.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <string.h>
|
|
||||||
+#include <unistd.h>
|
|
||||||
#include <sys/ioctl.h>
|
|
||||||
#include <sys/mman.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
@@ -29,116 +30,34 @@
|
|
||||||
#include <gst/allocators/gstdmabuf.h>
|
|
||||||
#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;
|
|
||||||
};
|
|
||||||
|
|
@ -1,32 +0,0 @@
|
||||||
From 1ae4df222f7c0e141e61e22228c9d69b7966f84c Mon Sep 17 00:00:00 2001
|
|
||||||
From: Song Bing <bing.song@nxp.com>
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -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"
|
|
||||||
|
|
@ -1,75 +0,0 @@
|
||||||
From: Mingke Wang <mingke.wang@freescale.com>
|
|
||||||
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 <mingke.wang@freescale.com>
|
|
||||||
Signed-off-by: Lyon Wang <lyon.wang@freescale.com>
|
|
||||||
---
|
|
||||||
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;
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
||||||
From: Mingke Wang <mingke.wang@freescale.com>
|
|
||||||
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 <mingke.wang@freescale.com>
|
|
||||||
Signed-off-by: Lyon Wang <lyon.wang@freescale.com>
|
|
||||||
---
|
|
||||||
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 */
|
|
||||||
|
|
@ -1,54 +0,0 @@
|
||||||
From: Lyon Wang <lyon.wang@freescale.com>
|
|
||||||
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 <lj.qfy.sh@gmail.com>
|
|
||||||
Signed-off-by: Lyon Wang <lyon.wang@freescale.com>
|
|
||||||
---
|
|
||||||
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:
|
|
||||||
|
|
@ -1,62 +0,0 @@
|
||||||
From: Lyon Wang <lyon.wang@freescale.com>
|
|
||||||
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 <lyon.wang@freescale.com>
|
|
||||||
---
|
|
||||||
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
|
|
||||||
|
|
@ -1,43 +0,0 @@
|
||||||
From: Lyon Wang <lyon.wang@freescale.com>
|
|
||||||
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 <lyon.wang@freescale.com>
|
|
||||||
---
|
|
||||||
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);
|
|
||||||
|
|
@ -1,30 +0,0 @@
|
||||||
From: Lyon Wang <lyon.wang@freescale.com>
|
|
||||||
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 <lyon.wang@freescale.com>
|
|
||||||
---
|
|
||||||
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)
|
|
||||||
|
|
||||||
|
|
@ -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 \
|
|
||||||
"
|
|
||||||
|
|
@ -1,36 +0,0 @@
|
||||||
From: Jian <Jian.Li@freescale.com>
|
|
||||||
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 <Jian.Li@freescale.com>
|
|
||||||
Signed-off-by: Lyon Wang <lyon.wang@freescale.com>
|
|
||||||
---
|
|
||||||
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;
|
|
||||||
|
|
||||||
|
|
@ -1,30 +0,0 @@
|
||||||
From: Lyon Wang <lyon.wang@freescale.com>
|
|
||||||
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 <lyon.wang@freescale.com>
|
|
||||||
---
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
@ -1,44 +0,0 @@
|
||||||
From: Song Bing <bing.song@nxp.com>
|
|
||||||
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;
|
|
||||||
|
|
@ -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"
|
|
||||||
|
|
@ -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}"
|
|
||||||
|
|
@ -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 \
|
|
||||||
"
|
|
||||||
|
|
@ -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)"
|
|
||||||
|
|
@ -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)"
|
|
||||||
Loading…
Reference in New Issue