我可以在
gstreamer
上使用 CMakeLists
成功编译并运行这个 ubuntu 22.04
插件:LINK
现在,我正在尝试将此包集成到我的
Yocto project
中。所以我写了这个bb recipe
:
SUMMARY = "Test"
LICENSE = "CLOSED"
SECTION = "support"
PACKAGE_ARCH = "${MACHINE_ARCH}"
PV = "${MY_VERSION}"
PR = "${MY_REVISION}"
FILESEXTRAPATHS:prepend := "${MY_SOURCE_DIR}:"
SRC_URI = " \
file://image-processing/CMakeLists.txt \
file://image-processing/main.cpp \
file://image-processing/gst_opencv_call_plugin.cpp \
"
S = "${WORKDIR}/image-processing"
DEPENDS += " \
pkgconfig \
gstreamer1.0 \
gstreamer1.0-plugins-bad \
opencv \
glib-2.0 \
pcre \
libffi \
zlib \
"
inherit cmake pkgconfig
CMAKE_INSTALL_DIR = "/usr/lib/gstreamer-1.0"
CXXFLAGS += "-I${S}/gst-libs"
FILES_${PN} += "${CMAKE_INSTALL_DIR}/libcvimageprocessing.so"
do_install() {
install -d ${D}${CMAKE_INSTALL_DIR}
install -m 0755 ${B}/libcvimageprocessing.so ${D}${CMAKE_INSTALL_DIR}/
}
FILES_${PN}-dbg += "${CMAKE_INSTALL_DIR}/.debug/"
FILES_${PN}-dev += "${CMAKE_INSTALL_DIR}/libcvimageprocessing.so"
RDEPENDS:${PN} += "\
gstreamer1.0-plugins-bad-dtls \
gstreamer1.0-plugins-bad-shm \
gstreamer1.0-plugins-bad-srtp \
gstreamer1.0-plugins-bad-videoparsersbad \
gstreamer1.0-plugins-bad-opusparse \
gstreamer1.0-plugins-bad-webrtc \
gstreamer1.0-plugins-bad-webrtcdsp \
gstreamer1.0-plugins-bad-opencv \
gstreamer1.0-plugins-good \
gstreamer1.0-plugins-good-alpha \
gstreamer1.0-plugins-good-autodetect \
gstreamer1.0-plugins-good-isomp4 \
gstreamer1.0-plugins-good-multifile \
gstreamer1.0-plugins-good-png \
gstreamer1.0-plugins-good-pulseaudio \
gstreamer1.0-plugins-good-rtp \
gstreamer1.0-plugins-good-rtpmanager \
gstreamer1.0-plugins-good-rtsp \
gstreamer1.0-plugins-good-udp \
libnice \
"
但是我在使用
bitbake
构建项目时遇到此错误:
gst_opencv_call_plugin.cpp:5:10: fatal error: gst/opencv/gstopencvvideofilter.h: No such file or directory
| 5 | #include <gst/opencv/gstopencvvideofilter.h>
| | ^~~~~~~~
我查找了该文件,并在以下路径中找到了它:
poky/build/tmp/work/cortexa53-oclea-linux/gstreamer1.0-plugins-bad/1.18.6-r1/gst-plugins-bad-1.18.6/gst-libs/gst/opencv
这意味着包
gst-plugins-bad
已经由bitbake
构建了。
问题与我的
bb recipe
或我的CMakeLists
有关吗?
我通过在 a 中附加 opencv 解决了该错误
gstreamer1.0-plugins-bad_1.%.bbappend
:
PACKAGECONFIG:append = " opencv"
并且还增加了
gstreamer1.0-plugins-bad
文件中 meson.build
所需的最大版本,因为它仅限于旧版本:
opencv_dep = dependency('opencv4', version : ['>= 4.0.0', '< 4.8.0'], required : false)