From d486bbf75ef95f3bf854a5490dbda164f03c39c3 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sat, 11 Mar 2023 10:13:44 -0800 Subject: gstreamer1.0-vaapi: Add 1.20.3.imx recipe Signed-off-by: Khem Raj --- .../gstreamer/gstreamer1.0-vaapi_1.20.3.imx.bb | 57 ++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-vaapi_1.20.3.imx.bb (limited to 'recipes-multimedia') diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-vaapi_1.20.3.imx.bb b/recipes-multimedia/gstreamer/gstreamer1.0-vaapi_1.20.3.imx.bb new file mode 100644 index 00000000..1fbe3462 --- /dev/null +++ b/recipes-multimedia/gstreamer/gstreamer1.0-vaapi_1.20.3.imx.bb @@ -0,0 +1,57 @@ +SUMMARY = "VA-API support to GStreamer" +HOMEPAGE = "https://gstreamer.freedesktop.org/" +DESCRIPTION = "gstreamer-vaapi consists of a collection of VA-API \ +based plugins for GStreamer and helper libraries: `vaapidecode', \ +`vaapiconvert', and `vaapisink'." + +REALPN = "gstreamer-vaapi" + +LICENSE = "LGPL-2.1-or-later" +LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c" + +SRC_URI = "https://gstreamer.freedesktop.org/src/${REALPN}/${REALPN}-${@get_gst_ver('${PV}')}.tar.xz" + +SRC_URI[sha256sum] = "6ee99eb316abdde9ad37002915bd8c3867918f6fdc74b7cf2ac4c1ae0d690b45" + +S = "${WORKDIR}/${REALPN}-${@get_gst_ver('${PV}')}" +DEPENDS = "libva gstreamer1.0 gstreamer1.0-plugins-base gstreamer1.0-plugins-bad" + +inherit meson pkgconfig features_check upstream-version-is-even + +REQUIRED_DISTRO_FEATURES ?= "opengl" + +EXTRA_OEMESON += " \ + -Ddoc=disabled \ + -Dexamples=disabled \ + -Dtests=enabled \ +" + +# Drop .imx from PV +def get_gst_ver(v): + return oe.utils.trim_version(v, 3) + +PACKAGES =+ "${PN}-tests" + +# OpenGL packageconfig factored out to make it easy for distros +# and BSP layers to pick either glx, egl, or no GL. By default, +# try detecting X11 first, and if found (with OpenGL), use GLX, +# otherwise try to check if EGL can be used. +PACKAGECONFIG_GL ?= "${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'glx', \ + bb.utils.contains('DISTRO_FEATURES', 'opengl', 'egl', \ + '', d), d)}" + +PACKAGECONFIG ??= "drm encoders \ + ${PACKAGECONFIG_GL} \ + ${@bb.utils.filter('DISTRO_FEATURES', 'wayland x11', d)}" + +PACKAGECONFIG[drm] = "-Dwith_drm=yes,-Dwith_drm=no,udev libdrm" +PACKAGECONFIG[egl] = "-Dwith_egl=yes,-Dwith_egl=no,virtual/egl" +PACKAGECONFIG[encoders] = "-Dwith_encoders=yes,-Dwith_encoders=no" +PACKAGECONFIG[glx] = "-Dwith_glx=yes,-Dwith_glx=no,virtual/libgl" +PACKAGECONFIG[wayland] = "-Dwith_wayland=yes,-Dwith_wayland=no,wayland-native wayland wayland-protocols" +PACKAGECONFIG[x11] = "-Dwith_x11=yes,-Dwith_x11=no,virtual/libx11 libxrandr libxrender" + +FILES:${PN} += "${libdir}/gstreamer-*/*.so" +FILES:${PN}-dbg += "${libdir}/gstreamer-*/.debug" +FILES:${PN}-dev += "${libdir}/gstreamer-*/*.a" +FILES:${PN}-tests = "${bindir}/*" -- cgit v1.2.3-54-g00ecf From f0ca145c90637c2c89027f5a00e36662b9e23e1b Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sat, 11 Mar 2023 10:27:46 -0800 Subject: gstreamer1.0-omx: Add 1.20.3.imx recipe Signed-off-by: Khem Raj --- conf/machine/include/imx-base.inc | 1 + .../gstreamer/gstreamer1.0-omx_1.20.3.imx.bb | 52 ++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-omx_1.20.3.imx.bb (limited to 'recipes-multimedia') diff --git a/conf/machine/include/imx-base.inc b/conf/machine/include/imx-base.inc index eeef28be..10f74c5d 100644 --- a/conf/machine/include/imx-base.inc +++ b/conf/machine/include/imx-base.inc @@ -481,6 +481,7 @@ PREFERRED_VERSION_gstreamer1.0-libav:mx8-nxp-bsp ??= "1.20.3.imx" PREFERRED_VERSION_gstreamer1.0-rtsp-server:mx8-nxp-bsp ??= "1.20.3.imx" PREFERRED_VERSION_gstreamer1.0-python:mx8-nxp-bsp ??= "1.20.3.imx" PREFERRED_VERSION_gstreamer1.0-vaapi:mx8-nxp-bsp ??= "1.20.3.imx" +PREFERRED_VERSION_gstreamer1.0-omx:mx8-nxp-bsp ??= "1.20.3.imx" PREFERRED_VERSION_ffmpeg:mx8-nxp-bsp ??= "4.4.1" # Determines if the SoC has support for Vivante kernel driver diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-omx_1.20.3.imx.bb b/recipes-multimedia/gstreamer/gstreamer1.0-omx_1.20.3.imx.bb new file mode 100644 index 00000000..dc1c8ba0 --- /dev/null +++ b/recipes-multimedia/gstreamer/gstreamer1.0-omx_1.20.3.imx.bb @@ -0,0 +1,52 @@ +SUMMARY = "OpenMAX IL plugins for GStreamer" +DESCRIPTION = "Wraps available OpenMAX IL components and makes them available as standard GStreamer elements." +HOMEPAGE = "http://gstreamer.freedesktop.org/" +SECTION = "multimedia" + +LICENSE = "LGPL-2.1-or-later" +LICENSE_FLAGS = "commercial" +LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c \ + file://omx/gstomx.h;beginline=1;endline=21;md5=5c8e1fca32704488e76d2ba9ddfa935f" + +SRC_URI = "https://gstreamer.freedesktop.org/src/gst-omx/gst-omx-${@get_gst_ver('${PV}')}.tar.xz" + +SRC_URI[sha256sum] = "8db48040bb41f09edf8d17ff6d16c54888d7777ba4501c2c69f0083350ea9a15" + +S = "${WORKDIR}/gst-omx-${@get_gst_ver('${PV}')}" + +DEPENDS = "gstreamer1.0 gstreamer1.0-plugins-base gstreamer1.0-plugins-bad virtual/libomxil" + +inherit meson pkgconfig upstream-version-is-even + +GSTREAMER_1_0_OMX_TARGET ?= "bellagio" +GSTREAMER_1_0_OMX_CORE_NAME ?= "${libdir}/libomxil-bellagio.so.0" + +EXTRA_OEMESON += "-Dtarget=${GSTREAMER_1_0_OMX_TARGET}" + +python __anonymous () { + omx_target = d.getVar("GSTREAMER_1_0_OMX_TARGET") + if omx_target in ['generic', 'bellagio']: + # Bellagio headers are incomplete (they are missing the OMX_VERSION_MAJOR,# + # OMX_VERSION_MINOR, OMX_VERSION_REVISION, and OMX_VERSION_STEP macros); + # appending a directory path to gst-omx' internal OpenMAX IL headers fixes this + d.appendVar("CFLAGS", " -I${S}/omx/openmax") + elif omx_target == "rpi": + # Dedicated Raspberry Pi OpenMAX IL support makes this package machine specific + d.setVar("PACKAGE_ARCH", d.getVar("MACHINE_ARCH")) +} + +set_omx_core_name() { + sed -i -e "s;^core-name=.*;core-name=${GSTREAMER_1_0_OMX_CORE_NAME};" "${D}${sysconfdir}/xdg/gstomx.conf" +} + +# Drop .imx from PV +def get_gst_ver(v): + return oe.utils.trim_version(v, 3) + +do_install[postfuncs] += " set_omx_core_name " + +FILES:${PN} += "${libdir}/gstreamer-1.0/*.so" +FILES:${PN}-staticdev += "${libdir}/gstreamer-1.0/*.a" + +VIRTUAL-RUNTIME_libomxil ?= "libomxil" +RDEPENDS:${PN} = "${VIRTUAL-RUNTIME_libomxil}" -- cgit v1.2.3-54-g00ecf From b9939c5bfbfbbe8b28afca3527ec24c1f7f5df18 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sat, 11 Mar 2023 10:34:48 -0800 Subject: gstreamer1.0-vaapi: Do not use glx backend on imx vivante does not implement glx Signed-off-by: Khem Raj --- recipes-multimedia/gstreamer/gstreamer1.0-vaapi_1.20.3.imx.bb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'recipes-multimedia') diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-vaapi_1.20.3.imx.bb b/recipes-multimedia/gstreamer/gstreamer1.0-vaapi_1.20.3.imx.bb index 1fbe3462..503f828f 100644 --- a/recipes-multimedia/gstreamer/gstreamer1.0-vaapi_1.20.3.imx.bb +++ b/recipes-multimedia/gstreamer/gstreamer1.0-vaapi_1.20.3.imx.bb @@ -36,9 +36,7 @@ PACKAGES =+ "${PN}-tests" # and BSP layers to pick either glx, egl, or no GL. By default, # try detecting X11 first, and if found (with OpenGL), use GLX, # otherwise try to check if EGL can be used. -PACKAGECONFIG_GL ?= "${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'glx', \ - bb.utils.contains('DISTRO_FEATURES', 'opengl', 'egl', \ - '', d), d)}" +PACKAGECONFIG_GL ?= "egl" PACKAGECONFIG ??= "drm encoders \ ${PACKAGECONFIG_GL} \ -- cgit v1.2.3-54-g00ecf From 7fd2ea865f954300d31fdfef3a5564f797cbe617 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sat, 11 Mar 2023 10:47:30 -0800 Subject: gst-devtools: Add recipe for 1.20.3.imx Signed-off-by: Khem Raj --- conf/machine/include/imx-base.inc | 1 + ...connect-has-a-different-signature-on-musl.patch | 38 +++++++++++++++ .../gstreamer/gst-devtools_1.20.3.imx.bb | 56 ++++++++++++++++++++++ 3 files changed, 95 insertions(+) create mode 100644 recipes-multimedia/gstreamer/gst-devtools/0001-connect-has-a-different-signature-on-musl.patch create mode 100644 recipes-multimedia/gstreamer/gst-devtools_1.20.3.imx.bb (limited to 'recipes-multimedia') diff --git a/conf/machine/include/imx-base.inc b/conf/machine/include/imx-base.inc index 10f74c5d..277ce450 100644 --- a/conf/machine/include/imx-base.inc +++ b/conf/machine/include/imx-base.inc @@ -482,6 +482,7 @@ PREFERRED_VERSION_gstreamer1.0-rtsp-server:mx8-nxp-bsp ??= "1.20.3.imx" PREFERRED_VERSION_gstreamer1.0-python:mx8-nxp-bsp ??= "1.20.3.imx" PREFERRED_VERSION_gstreamer1.0-vaapi:mx8-nxp-bsp ??= "1.20.3.imx" PREFERRED_VERSION_gstreamer1.0-omx:mx8-nxp-bsp ??= "1.20.3.imx" +PREFERRED_VERSION_gst-devtools:mx8-nxp-bsp ??= "1.20.3.imx" PREFERRED_VERSION_ffmpeg:mx8-nxp-bsp ??= "4.4.1" # Determines if the SoC has support for Vivante kernel driver diff --git a/recipes-multimedia/gstreamer/gst-devtools/0001-connect-has-a-different-signature-on-musl.patch b/recipes-multimedia/gstreamer/gst-devtools/0001-connect-has-a-different-signature-on-musl.patch new file mode 100644 index 00000000..c0e45813 --- /dev/null +++ b/recipes-multimedia/gstreamer/gst-devtools/0001-connect-has-a-different-signature-on-musl.patch @@ -0,0 +1,38 @@ +From 73b1002eda17451db1f58431b42c25203f1d3097 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sun, 9 Sep 2018 17:38:10 -0700 +Subject: [PATCH] connect has a different signature on musl + +On linux when not using glibc and using musl for C library, connect +API has a different signature, this patch fixes this so it can compile +on musl, the functionality should remain same as it is immediately +typcasted to struct sockaddr_in* type inside the function before use + +Upstream-Status: Pending + +Signed-off-by: Khem Raj +--- + validate/plugins/fault_injection/socket_interposer.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/validate/plugins/fault_injection/socket_interposer.c b/validate/plugins/fault_injection/socket_interposer.c +index 53c1ebb..ad7adf8 100644 +--- a/validate/plugins/fault_injection/socket_interposer.c ++++ b/validate/plugins/fault_injection/socket_interposer.c +@@ -100,10 +100,15 @@ socket_interposer_set_callback (struct sockaddr_in *addrin, + } + + int +-connect (int socket, const struct sockaddr_in *addrin, socklen_t address_len) ++#if defined(__linux__) && !defined(__GLIBC__) ++connect (int socket, const struct sockaddr *addr, socklen_t address_len) ++#else ++connect (int socket, const struct sockaddr_in *addr, socklen_t address_len) ++#endif + { + size_t i; + int override_errno = 0; ++ struct sockaddr_in* addrin = (struct sockaddr_in*)addr; + typedef ssize_t (*real_connect_fn) (int, const struct sockaddr_in *, + socklen_t); + static real_connect_fn real_connect = 0; diff --git a/recipes-multimedia/gstreamer/gst-devtools_1.20.3.imx.bb b/recipes-multimedia/gstreamer/gst-devtools_1.20.3.imx.bb new file mode 100644 index 00000000..5daba9d7 --- /dev/null +++ b/recipes-multimedia/gstreamer/gst-devtools_1.20.3.imx.bb @@ -0,0 +1,56 @@ +SUMMARY = "Gstreamer validation tool" +DESCRIPTION = "A Tool to test GStreamer components" +HOMEPAGE = "https://gstreamer.freedesktop.org/documentation/gst-devtools/index.html" +SECTION = "multimedia" + +LICENSE = "LGPL-2.1-or-later" +LIC_FILES_CHKSUM = "file://validate/COPYING;md5=a6f89e2100d9b6cdffcea4f398e37343" + +S = "${WORKDIR}/gst-devtools-${@get_gst_ver('${PV}')}" + +SRC_URI = "https://gstreamer.freedesktop.org/src/gst-devtools/gst-devtools-${@get_gst_ver('${PV}')}.tar.xz \ + file://0001-connect-has-a-different-signature-on-musl.patch \ + " + +SRC_URI[sha256sum] = "bbbd45ead703367ea8f4be9b3c082d7b62bef47b240a39083f27844e28758c47" + +DEPENDS = "json-glib glib-2.0 glib-2.0-native gstreamer1.0 gstreamer1.0-plugins-base" +RRECOMMENDS:${PN} = "git" + +FILES:${PN} += "${datadir}/gstreamer-1.0/* ${libdir}/gst-validate-launcher/* ${libdir}/gstreamer-1.0/*" + +inherit meson pkgconfig gettext upstream-version-is-even gobject-introspection + +# Drop .imx from PV +def get_gst_ver(v): + return oe.utils.trim_version(v, 3) + +# TODO: put this in a gettext.bbclass patch +def gettext_oemeson(d): + if d.getVar('USE_NLS') == 'no': + return '-Dnls=disabled' + # Remove the NLS bits if USE_NLS is no or INHIBIT_DEFAULT_DEPS is set + if d.getVar('INHIBIT_DEFAULT_DEPS') and not oe.utils.inherits(d, 'cross-canadian'): + return '-Dnls=disabled' + return '-Dnls=enabled' + +# Build GstValidateVideo +PACKAGECONFIG[cairo] = "-Dcairo=enabled,-Dcairo=disabled,cairo" + +EXTRA_OEMESON += " \ + -Ddoc=disabled \ + -Ddebug_viewer=disabled \ + -Dtests=disabled \ + -Dvalidate=enabled \ + ${@gettext_oemeson(d)} \ +" + +do_install:append () { + for fn in ${bindir}/gst-validate-launcher \ + ${libdir}/gst-validate-launcher/python/launcher/config.py; do + sed -i -e 's,${B},/usr/src/debug/${PN},g' -e 's,${S},/usr/src/debug/${PN},g' ${D}$fn + done +} + +GIR_MESON_ENABLE_FLAG = "enabled" +GIR_MESON_DISABLE_FLAG = "disabled" -- cgit v1.2.3-54-g00ecf From e7b24f8aefda47f95863154aa75cae2c81bd9dbe Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sun, 12 Mar 2023 19:45:04 -0700 Subject: gstreamer1.0-plugins-good: Fix build with clang Signed-off-by: Khem Raj --- ...pe-declaration-for-gst_v4l2_object_stream.patch | 32 ++++++++++++++++++++++ .../gstreamer1.0-plugins-good_1.20.3.imx.bb | 1 + 2 files changed, 33 insertions(+) create mode 100644 recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0001-Add-prototype-declaration-for-gst_v4l2_object_stream.patch (limited to 'recipes-multimedia') diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0001-Add-prototype-declaration-for-gst_v4l2_object_stream.patch b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0001-Add-prototype-declaration-for-gst_v4l2_object_stream.patch new file mode 100644 index 00000000..0a6637de --- /dev/null +++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good/0001-Add-prototype-declaration-for-gst_v4l2_object_stream.patch @@ -0,0 +1,32 @@ +From 50c821e3578e3e0892574d88ef7edb25d60ae50a Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sun, 12 Mar 2023 19:39:46 -0700 +Subject: [PATCH] Add prototype declaration for gst_v4l2_object_streamoff + +Fixes build with latest compilers e.g. clang-16 + +../git/sys/v4l2/gstv4l2videodec.c:354:10: error: call to undeclared function 'gst_v4l2_object_streamoff'; ISO C99 and later do not support implicit function declarations [ -Wimplicit-function-declaration] + if (!gst_v4l2_object_streamoff (self->v4l2capture)) + ^ + +Upstream-Status: Submitted [https://github.com/nxp-imx/gst-plugins-good/pull/1] +Signed-off-by: Khem Raj +--- + sys/v4l2/gstv4l2object.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/sys/v4l2/gstv4l2object.h b/sys/v4l2/gstv4l2object.h +index 685086902..c84dc1724 100644 +--- a/sys/v4l2/gstv4l2object.h ++++ b/sys/v4l2/gstv4l2object.h +@@ -323,6 +323,7 @@ GstStructure * gst_v4l2_object_v4l2fourcc_to_structure (guint32 fourcc); + + /* crop / compose */ + gboolean gst_v4l2_object_set_crop (GstV4l2Object * obj, struct v4l2_rect *result); ++gboolean gst_v4l2_object_streamoff (GstV4l2Object * v4l2object); + + /* TODO Move to proper namespace */ + /* open/close the device */ +-- +2.39.2 + diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.20.3.imx.bb b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.20.3.imx.bb index 8cbbd2d1..ccbf0196 100644 --- a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.20.3.imx.bb +++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-good_1.20.3.imx.bb @@ -13,6 +13,7 @@ BUGTRACKER = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues SRC_URI = "https://gstreamer.freedesktop.org/src/gst-plugins-good/gst-plugins-good-${PV}.tar.xz \ file://0001-qt-include-ext-qt-gstqtgl.h-instead-of-gst-gl-gstglf.patch \ + file://0001-Add-prototype-declaration-for-gst_v4l2_object_stream.patch \ " SRC_URI[sha256sum] = "f8f3c206bf5cdabc00953920b47b3575af0ef15e9f871c0b6966f6d0aa5868b7" -- cgit v1.2.3-54-g00ecf