From: Taruntej Kanakamalla Date: Thu, 23 Jul 2026 17:23:26 +0000 (+0530) Subject: gstreamer1.0-plugins-rs: add new package X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=3a2b032f0fccc9dd636db82a63f67d644ad8bf51;p=thirdparty%2Fopenembedded%2Fopenembedded-core.git gstreamer1.0-plugins-rs: add new package Adapted from an existing patch: https://patchwork.yoctoproject.org/project/oe-core/patch/20220606132653.60232-5-brgl@bgdev.pl Update the recipe to track the latest upstream release of the official GStreamer Rust plugins. Remove the `flavors` and `ffv1` plugins from local manifest file because they depend on packages that are not published on crates.io and also they are not actively maintained in the gst-plugins-rs upstream anyway. Skip the recipe if building for x86 without SSE support. Unlike the other GStreamer submodules, the Rust plugins follow a separate release cycle and versioning scheme. These plugins are fully stable and required for a fully-featured GStreamer installation, as most new features and plugins are being written in Rust. They are also shipped by multiple Linux distributions such as Fedora. Based on patch by: Bartosz Golaszewski Signed-off-by: Taruntej Kanakamalla Signed-off-by: Mathieu Dubois-Briand Signed-off-by: Richard Purdie --- diff --git a/meta/conf/distro/include/maintainers.inc b/meta/conf/distro/include/maintainers.inc index b49386a27d..e0edfdef7e 100644 --- a/meta/conf/distro/include/maintainers.inc +++ b/meta/conf/distro/include/maintainers.inc @@ -258,6 +258,7 @@ RECIPE_MAINTAINER:pn-gstreamer1.0-meta-base = "Unassigned ${PN}-file instead of ${PN}-rsfile) +python split_gstreamer10_packages () { + gst_libdir = d.expand('${libdir}/gstreamer-1.0') + postinst = d.getVar('plugin_postinst') + + do_split_packages(d, gst_libdir, r'libgst(?:rs)?(.*)\.so$', d.expand('${PN}-%s'), 'GStreamer 1.0 Rust plugin for %s', postinst=postinst, extra_depends='') + + # GstValidate plugins are installed in a separate subdirectory + # i.e., 'gstreamer-1.0/validate' + do_split_packages(d, gst_libdir + '/validate', r'libgst(?:rs)?(.*)\.so$', d.expand('${PN}-%s'), 'GStreamer 1.0 Rust validate plugin for %s', postinst=postinst, extra_depends='') +} + +DEPENDS = " \ + glib-2.0 \ + gstreamer1.0 \ + gstreamer1.0-plugins-good \ + gstreamer1.0-plugins-bad \ + gstreamer1.0-plugins-base \ + gst-devtools \ + gtk4 \ +" + +S = "${UNPACKDIR}" + +# Remove the `flavors` and `ffv1` plugins that are not actively maintained in the +# gst-plugins-rs upstream +CARGO_MANIFEST_PATH = "${S}/${CARGO_SRC_DIR}/${BPN}-${PV}/Cargo.toml" +do_configure:prepend() { + sed -i '/"mux\/flavors"/d' ${CARGO_MANIFEST_PATH} + sed -i '/"video\/ffv1"/d' ${CARGO_MANIFEST_PATH} +} + +# For the purpose of reproducibility, modification of Cargo.lock is disabled +# by default by the cargo_common class using the --frozen flag. +# +# However, the `flavors` and `ffv1` plugins depend on the packages that are not +# published on crates.io and can only be fetched from the git. Also, as mentioned above, +# these plugins are not actively maintained in the gst-plugins-rs upstream, and it is not +# recommended to use them. +# +# So we remove them from the workspace members in the manifest file locally and this will trigger +# a change in the Cargo.lock file. +# +# To allow this exception, disable the --frozen flag so Cargo.lock can be modified, +# but still prevent network access by using the --offline flag in CARGO_BUILD_FLAGS. +CARGO_BUILD_FLAGS:remove = "--frozen" +CARGO_BUILD_FLAGS:append = " --offline" + +# cargo_c.bbclass does not pass PACKAGECONFIG_CONFARGS to build and install +# command so without this the whole workspace gets built by default instead of +# specific packages(plugins) +CARGO_BUILD_FLAGS:append = " ${PACKAGECONFIG_CONFARGS}" + +# Analytics +PACKAGECONFIG[analytics] = "-p gst-plugin-analytics" +PACKAGECONFIG[burn] = "-p gst-plugin-burn" + +# Audio +PACKAGECONFIG[audioparsers] = "-p gst-plugin-audioparsers" +PACKAGECONFIG[audiofx] = "-p gst-plugin-audiofx" +PACKAGECONFIG[claxon] = "-p gst-plugin-claxon" +# FIXME build errors +# PACKAGECONFIG[csound] = "-p gst-plugin-csound" +PACKAGECONFIG[demucs] = "-p gst-plugin-demucs" +PACKAGECONFIG[elevenlabs] = "-p gst-plugin-elevenlabs" +PACKAGECONFIG[lewton] = "-p gst-plugin-lewton" +PACKAGECONFIG[spotify] = "-p gst-plugin-spotify" +PACKAGECONFIG[speechmatics] = "-p gst-plugin-speechmatics" +# FIXME build errors +# PACKAGECONFIG[whisper] = "-p gst-plugin-whisper" + +# Generic +PACKAGECONFIG[file] = "-p gst-plugin-file" +PACKAGECONFIG[originalbuffer] = "-p gst-plugin-originalbuffer" +PACKAGECONFIG[gopbuffer] = "-p gst-plugin-gopbuffer" +PACKAGECONFIG[sodium] = "-p gst-plugin-sodium" +PACKAGECONFIG[threadshare] = "-p gst-plugin-threadshare" +PACKAGECONFIG[inter] = "-p gst-plugin-inter" +PACKAGECONFIG[streamgrouper] = "-p gst-plugin-streamgrouper" + +# Mux +# PACKAGECONFIG[flavors] = "-p gst-plugin-flavors" +PACKAGECONFIG[isobmff] = "-p gst-plugin-isobmff" + +# Net +PACKAGECONFIG[aws] = "-p gst-plugin-aws" +PACKAGECONFIG[deepgram] = "-p gst-plugin-deepgram" +PACKAGECONFIG[hlsmultivariantsink] = "-p gst-plugin-hlsmultivariantsink" +PACKAGECONFIG[hlssink3] = "-p gst-plugin-hlssink3" +PACKAGECONFIG[icecast] = "-p gst-plugin-icecast" +PACKAGECONFIG[mpegtslive] = "-p gst-plugin-mpegtslive" +PACKAGECONFIG[ndi] = "-p gst-plugin-ndi" +PACKAGECONFIG[onvif] = "-p gst-plugin-onvif" +PACKAGECONFIG[raptorq] = "-p gst-plugin-raptorq" +PACKAGECONFIG[reqwest] = "-p gst-plugin-reqwest" +PACKAGECONFIG[rtsp] = "-p gst-plugin-rtsp" +PACKAGECONFIG[rtp] = "-p gst-plugin-rtp" +PACKAGECONFIG[webrtc] = "-p gst-plugin-webrtc" +PACKAGECONFIG[webrtc-signalling] = "-p gst-plugin-webrtc-signalling" +PACKAGECONFIG[webrtc-signalling-protocol] = "-p gst-plugin-webrtc-signalling-protocol" +PACKAGECONFIG[webrtchttp] = "-p gst-plugin-webrtchttp" +PACKAGECONFIG[quinn] = "-p gst-plugin-quinn" + +# Text +PACKAGECONFIG[textaccumulate] = "-p gst-plugin-textaccumulate" +PACKAGECONFIG[textahead] = "-p gst-plugin-textahead" +PACKAGECONFIG[json] = "-p gst-plugin-json" +PACKAGECONFIG[regex] = "-p gst-plugin-regex" +PACKAGECONFIG[textwrap] = "-p gst-plugin-textwrap" + +# Utils +PACKAGECONFIG[fallbackswitch] = "-p gst-plugin-fallbackswitch" +PACKAGECONFIG[livesync] = "-p gst-plugin-livesync" +PACKAGECONFIG[debugseimetainserter] = "-p gst-plugin-debugseimetainserter" +PACKAGECONFIG[togglerecord] = "-p gst-plugin-togglerecord" +PACKAGECONFIG[tracers] = "-p gst-plugin-tracers" +PACKAGECONFIG[uriplaylistbin] = "-p gst-plugin-uriplaylistbin" +PACKAGECONFIG[validate] = "-p gst-plugin-validate" + +# Video +PACKAGECONFIG[cdg] = "-p gst-plugin-cdg" +PACKAGECONFIG[closedcaption] = "-p gst-plugin-closedcaption" +# need dav1d recipe meta-openembedded/meta-multimedia +PACKAGECONFIG[dav1d] = "-p gst-plugin-dav1d,,dav1d, dav1d" +PACKAGECONFIG[ffv1] = "-p gst-plugin-ffv1" +PACKAGECONFIG[gif] = "-p gst-plugin-gif" +PACKAGECONFIG[gtk4] = "-p gst-plugin-gtk4" +PACKAGECONFIG[hsv] = "-p gst-plugin-hsv" +PACKAGECONFIG[png] = "-p gst-plugin-png" +PACKAGECONFIG[rav1e] = "-p gst-plugin-rav1e" +# FIXME failing to download skia from +# https://codeload.github.com/rust-skia/skia/tar.gz/m145-0.92.0 +# PACKAGECONFIG[skia] = "-p gst-plugin-skia" +PACKAGECONFIG[videofx] = "-p gst-plugin-videofx" +# TODO no vvdec recipe +# PACKAGECONFIG[vvdec] = "-p gst-plugin-vvdec" +PACKAGECONFIG[webp] = "-p gst-plugin-webp" + +# Default members +PACKAGECONFIG ??= " \ + audiofx \ + closedcaption \ + file \ + fallbackswitch \ + tracers \ + threadshare \ + rtp \ + inter \ + isobmff \ + hlssink3 \ + mpegtslive \ + reqwest \ + rtsp \ + webrtc \ + webrtc-signalling \ + videofx \ + webp \ +" + +# The 'ring' crate (pulled in transitively by plugins such as reqwest, +# webrtc, quinn, etc.) requires SSE2 on 32-bit x86. +# +# rust-target-config.bbclass only enables sse2 (or a superset) in the +# generated rust target if TARGET_CC_ARCH carries an explicit -msse* +# flag; -march= values are not parsed. +# +# Skip the recipe for 32-bit x86 tunes that do not guarantee SSE2 +# (x86, i586, i586-nlp, i686, c3). SSE2-capable tunes (core2-32, +# corei7-32, all x86-64 variants) are unaffected. +python () { + if (d.getVar('TRANSLATED_TARGET_ARCH') or '') not in ('i386', 'i486', 'i586', 'i686'): + return + cc_flags = (d.getVar('TARGET_CC_ARCH') or '').split() + sse2_flags = ('-msse2', '-msse3', '-mssse3', '-msse4.1', '-msse4.2', '-msse4a') + if not any(f in cc_flags for f in sse2_flags): + raise bb.parse.SkipRecipe( + "Depends transitively on the 'ring' crate which requires SSE2, " + "not guaranteed by this tune (TUNE_FEATURES='%s'). Use an " + "SSE2-capable x86 tune such as core2-32 or corei7-32." + % (d.getVar('TUNE_FEATURES') or '')) +}