Skip to content

Commit d99e029

Browse files
gst-plugins-imsdk: refactor recipes into base, OSS, and proprietary packages (#1866)
Restructure gst-plugins-imsdk recipes to enable clean separation between open-source and proprietary plugins, avoiding unintended coupling during OSS-only builds. This refactoring enables: - Building base libraries once, reused by both OSS and proprietary recipes - Clean image composition (qcom-multimedia-image vs qcom-multimedia-proprietary-image) - Clear separation of OSS vs proprietary dependencies
2 parents c0f9f12 + 60171bc commit d99e029

10 files changed

Lines changed: 38 additions & 976 deletions
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
PACKAGECONFIG:append = " ml messaging redissink"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
PACKAGECONFIG:append = " camera-base qmmfsrc sample-apps"

dynamic-layers/openembedded-layer/recipes-multimedia/imsdk/gst-plugins-imsdk_%.bbappend

Lines changed: 0 additions & 1 deletion
This file was deleted.

dynamic-layers/qcom-distro/recipes-multimedia/imsdk/gst-plugins-imsdk_%.bbappend renamed to dynamic-layers/qcom-distro/recipes-multimedia/imsdk/gst-plugins-imsdk-oss_%.bbappend

File renamed without changes.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
require gst-plugins-imsdk-common.inc
2+
require gst-plugins-imsdk-packaging.inc
3+
4+
SUMMARY = "Qualcomm IMSDK GStreamer Base Libraries"
5+
DESCRIPTION = "Common base libraries for IMSDK GStreamer plugins."
6+
7+
PACKAGECONFIG = "base"

recipes-multimedia/imsdk/gst-plugins-imsdk_0.1.0.bb renamed to recipes-multimedia/imsdk/gst-plugins-imsdk-common.inc

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
require gst-plugins-imsdk-packaging.inc
1+
# Common configuration for IMSDK GStreamer plugins recipes
2+
# This file contains shared settings used by base, OSS, and proprietary recipes
23

3-
SUMMARY = "Qualcomm IMSDK GStreamer Plugins (QTI OSS)"
4-
DESCRIPTION = "Open-source Qualcomm IMSDK GStreamer multimedia, CV, ML, and messaging plugins"
54
SECTION = "multimedia"
65
LICENSE = "BSD-3-Clause-Clear"
76
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=2998c54c288b081076c9af987bdf4838"
@@ -10,36 +9,30 @@ inherit cmake features_check pkgconfig
109

1110
REQUIRED_DISTRO_FEATURES = "opengl"
1211

13-
SRC_URI = " \
14-
git://github.com/qualcomm/gst-plugins-imsdk;protocol=https;nobranch=1;tag=${PV} \
15-
file://0001-gst-plugins-drop-using-imported-include-dirs.patch \
16-
"
12+
SRC_URI = "git://github.com/qualcomm/gst-plugins-imsdk;protocol=https;nobranch=1;tag=${PV}"
1713

18-
SRCREV = "538ab4e1ab048e619b08f82f8a737621f60d6d32"
14+
SRCREV = "fd9af6b8377da7039ba23423f774287977fa60bc"
1915

2016
DEPENDS += "\
2117
gstreamer1.0 \
2218
gstreamer1.0-plugins-base \
23-
json-glib \
24-
virtual/egl \
25-
virtual/libgbm \
26-
virtual/libgles2 \
27-
virtual/libgles3 \
2819
"
2920

3021
# This package is currently only used and tested on ARMv8 (aarch64) machines.
3122
# Therefore, builds for other architectures are not necessary and are explicitly excluded.
3223
COMPATIBLE_MACHINE = "^$"
3324
COMPATIBLE_MACHINE:aarch64 = "(.*)"
3425

35-
PACKAGECONFIG ??= "sw tools videoproc"
36-
26+
PACKAGECONFIG[base] = "-DENABLE_GST_PLUGIN_BASE=ON, -DENABLE_GST_PLUGIN_BASE=OFF, json-glib virtual/egl virtual/libgbm virtual/libgles2 virtual/libgles3"
27+
PACKAGECONFIG[camera-base] = "-DENABLE_GST_PLUGIN_CAMERA_BASE=ON, -DENABLE_GST_PLUGIN_CAMERA_BASE=OFF, camera-service"
3728
PACKAGECONFIG[messaging] = "-DENABLE_GST_MESSAGING_PLUGINS=1, -DENABLE_GST_MESSAGING_PLUGINS=0, librdkafka mosquitto"
38-
PACKAGECONFIG[ml] = "-DENABLE_GST_ML_PLUGINS=1, -DENABLE_GST_ML_PLUGINS=0, cairo json-glib opencv qairt-sdk, qairt-sdk"
29+
PACKAGECONFIG[ml] = "-DENABLE_GST_ML_PLUGINS=1, -DENABLE_GST_ML_PLUGINS=0, cairo json-glib opencv"
30+
PACKAGECONFIG[qairt] = "-DENABLE_GST_QAIRT_PLUGINS=1 -DENABLE_GST_PLUGIN_MLTOOLS=1, -DENABLE_GST_QAIRT_PLUGINS=0 -DENABLE_GST_PLUGIN_MLTOOLS=0, qairt-sdk, qairt-sdk"
3931
PACKAGECONFIG[qmmfsrc] = "-DENABLE_GST_PLUGIN_QMMFSRC=1 -DVHDR_MODES_ENABLE=ON -DEIS_MODES_ENABLE=ON -DFEATURE_OFFLINE_IFE_SUPPORT=ON, -DENABLE_GST_PLUGIN_QMMFSRC=0 -DVHDR_MODES_ENABLE=OFF -DEIS_MODES_ENABLE=OFF -DFEATURE_OFFLINE_IFE_SUPPORT=OFF, camera-service"
4032
PACKAGECONFIG[redissink] = "-DENABLE_GST_PLUGIN_REDISSINK=1, -DENABLE_GST_PLUGIN_REDISSINK=0, hiredis"
4133
PACKAGECONFIG[sample-apps] = "-DENABLE_GST_SAMPLE_APPS=1, -DENABLE_GST_SAMPLE_APPS=0, opencv cairo json-glib camera-service"
42-
PACKAGECONFIG[sw] = "-DENABLE_GST_SOFTWARE_PLUGINS=1, -DENABLE_GST_SOFTWARE_PLUGINS=0, gstreamer1.0-rtsp-server smart-venc-ctrl-algo"
34+
PACKAGECONFIG[smartvencbin] = "-DENABLE_GST_PLUGIN_SMARTVENCBIN=1, -DENABLE_GST_PLUGIN_SMARTVENCBIN=0, smart-venc-ctrl-algo"
35+
PACKAGECONFIG[sw] = "-DENABLE_GST_SOFTWARE_PLUGINS=1, -DENABLE_GST_SOFTWARE_PLUGINS=0, gstreamer1.0-rtsp-server"
4336
PACKAGECONFIG[tflite] = "-DENABLE_GST_PLUGIN_MLTFLITE=1, -DENABLE_GST_PLUGIN_MLTFLITE=0, tensorflow-lite"
4437
PACKAGECONFIG[tools] = "-DENABLE_GST_PLUGIN_TOOLS=1, -DENABLE_GST_PLUGIN_TOOLS=0, gstreamer1.0-rtsp-server"
4538
PACKAGECONFIG[videoproc] = "-DENABLE_GST_VIDEOPROC_PLUGINS=1, -DENABLE_GST_VIDEOPROC_PLUGINS=0, cairo"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
require gst-plugins-imsdk-common.inc
2+
require gst-plugins-imsdk-packaging.inc
3+
4+
SUMMARY = "Qualcomm IMSDK GStreamer Plugins (OSS)"
5+
DESCRIPTION = "Open-source Qualcomm IMSDK GStreamer multimedia plugins"
6+
7+
DEPENDS += "gst-plugins-imsdk-base"
8+
9+
PACKAGECONFIG ??= "sw tools videoproc"

recipes-multimedia/imsdk/gst-plugins-imsdk-packaging.inc

Lines changed: 1 addition & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
require recipes-multimedia/gstreamer/gstreamer1.0-plugins-packaging.inc
66

77
PACKAGESPLITFUNCS =+ "split_imsdk_module_packages"
8-
PACKAGESPLITFUNCS += "set_imsdk_oss_metapkg_rdepends"
98

109
python split_imsdk_module_packages () {
1110
imsdk_root = d.expand('${libdir}/imsdk')
@@ -14,51 +13,6 @@ python split_imsdk_module_packages () {
1413
do_split_packages(d, imsdk_root, r'([^/]+)/modules/[^/]+\.so', d.expand('${PN}-%s-modules'), 'IMSDK runtime modules for %s plugin', recursive=True, extra_depends='', match_path=True)
1514
}
1615

17-
# List of plugin packages to exclude from OSS meta package
18-
# Add package names (without version/architecture suffix) to this list
19-
# Example: to exclude gst-plugins-imsdk-qtimlqnn, add 'qtimlqnn' to the list
20-
IMSDK_OSS_METAPKG_EXCLUDE ?= "qtimlqnn qtimlsnpe qtiqmmfsrc qtismartvencbin"
21-
22-
python set_imsdk_oss_metapkg_rdepends () {
23-
import os
24-
import oe.utils
25-
26-
# Go through all generated packages (excluding the main package and
27-
# the -meta package itself) and add them to the -meta package as RDEPENDS.
28-
# Also exclude packages specified in IMSDK_OSS_METAPKG_EXCLUDE.
29-
30-
pn = d.getVar('PN')
31-
metapkg = pn + '-oss-meta'
32-
d.setVar('ALLOW_EMPTY:' + metapkg, "1")
33-
d.setVar('FILES:' + metapkg, "")
34-
exclude = [ pn, pn + '-meta', pn + '-oss-meta' ]
35-
36-
# Add user-defined plugin exclusions to the exclude list
37-
exclude_plugins = d.getVar('IMSDK_OSS_METAPKG_EXCLUDE') or ""
38-
if exclude_plugins:
39-
for plugin in exclude_plugins.split():
40-
# Add packages like gst-plugins-imsdk-<plugin>
41-
exclude.append(pn + '-' + plugin)
42-
43-
metapkg_rdepends = []
44-
pkgdest = d.getVar('PKGDEST')
45-
for pkg in oe.utils.packages_filter_out_system(d):
46-
if pkg not in exclude and pkg not in metapkg_rdepends:
47-
# See if the package is empty by looking at the contents of its PKGDEST subdirectory.
48-
# If this subdirectory is empty, then the package is.
49-
# Empty packages do not get added to the meta package's RDEPENDS
50-
pkgdir = os.path.join(pkgdest, pkg)
51-
if os.path.exists(pkgdir):
52-
dir_contents = os.listdir(pkgdir) or []
53-
else:
54-
dir_contents = []
55-
is_empty = len(dir_contents) == 0
56-
if not is_empty:
57-
metapkg_rdepends.append(pkg)
58-
d.setVar('RDEPENDS:' + metapkg, ' '.join(metapkg_rdepends))
59-
d.setVar('DESCRIPTION:' + metapkg, pn + ' meta package')
60-
}
61-
62-
PACKAGES += "${PN}-oss-meta ${PN}-configs"
16+
PACKAGES += "${PN}-configs"
6317

6418
FILES:${PN}-configs = "${sysconfdir}/configs/"
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
require gst-plugins-imsdk-common.inc
2+
require gst-plugins-imsdk-packaging.inc
3+
4+
SUMMARY = "Qualcomm IMSDK GStreamer Plugins (Proprietary)"
5+
DESCRIPTION = "Proprietary Qualcomm IMSDK GStreamer plugins including camera, ML/AI (QAIRT), and smart video encoder"
6+
7+
DEPENDS += "gst-plugins-imsdk-base"
8+
9+
PACKAGECONFIG ??= "qairt smartvencbin"

0 commit comments

Comments
 (0)