package/libcamera-apps: enable LIBAV only if libdrm is present
PATCH 1/1 package/libcamera-apps: enable LIBAV only if libdrm is present
Since commit 35266e84043f880d7591e52b71a8c5b8d0e4717d, libcamera-apps does enable LIBAV by default which depends on libdrm.
Fixes:
- http://autobuild.buildroot.net/results/548f2a3b353ce4693fb60d7fb1e06e02af22991c/
/home/buildroot/autobuild/run/instance-1/output-1/build/libcamera-apps-1.1.1/encoder/libav_encoder.cpp:13:10: fatal error: libdrm/drm_fourcc.h: No such file or directory
13 | #include <libdrm/drm_fourcc.h>
| ^~~~~~~~~~~~~~~~~~~~~
--- package/libcamera-apps/libcamera-apps.mk | 2 ++ 1 file changed, 2 insertions(+)
package/libcamera-apps/libcamera-apps.mk +2 -0
@@ -25,8 +25,10 @@ LIBCAMERA_APPS_CONF_OPTS = \ ifeq ($(BR2_PACKAGE_LIBDRM),y) LIBCAMERA_APPS_DEPENDENCIES += libdrm LIBCAMERA_APPS_CONF_OPTS += -DENABLE_DRM=1 +LIBCAMERA_APPS_CONF_OPTS += -DENABLE_LIBAV=1 else LIBCAMERA_APPS_CONF_OPTS += -DENABLE_DRM=0 +LIBCAMERA_APPS_CONF_OPTS += -DENABLE_LIBAV=0 endif ifeq ($(BR2_PACKAGE_XORG7),y)
Signature · 6 lines
2.38.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Marcus, All,
On 2023-02-07 09:54 +0100, Marcus Folkesson spake thusly:
Quoted 20 lines
Since commit
35266e84043f880d7591e52b71a8c5b8d0e4717d, libcamera-apps does enable LIBAV by default which depends on libdrm.Fixes:
- http://autobuild.buildroot.net/results/548f2a3b353ce4693fb60d7fb1e06e02af22991c/
/home/buildroot/autobuild/run/instance-1/output-1/build/libcamera-apps-1.1.1/encoder/libav_encoder.cpp:13:10: fatal error:libdrm/drm_fourcc.h: No such file or directory
13 | #include <libdrm/drm_fourcc.h>| ^~~~~~~~~~~~~~~~~~~~~Signed-off-by Marcus Folkesson <[email protected]>--- package/libcamera-apps/libcamera-apps.mk | 2 ++ 1 file changed, 2 insertions(+)package/libcamera-apps/libcamera-apps.mk +0
-0
package/libcamera-apps/libcamera-apps.mk LIBCAMERA_APPS_CONF_OPTS = \ · line 28
Quoted 4 lines
package/libcamera-apps/libcamera-apps.mk +1
-0@@ -25,8 +25,10 @@ LIBCAMERA_APPS_CONF_OPTS = \ ifeq ($(BR2_PACKAGE_LIBDRM),y) LIBCAMERA_APPS_DEPENDENCIES += libdrm LIBCAMERA_APPS_CONF_OPTS += -DENABLE_DRM=1 +LIBCAMERA_APPS_CONF_OPTS += -DENABLE_LIBAV=1
But doesn't ENABLE_LIBAV also need a few libraries? From libcamera-apps' encoder/CMakeLists.txt:
13 if (ENABLE_LIBAV)
14 message(STATUS "Checking for libavcodec")
15 pkg_check_modules(LIBAV QUIET IMPORTED_TARGET
16 libavcodec 17 libavdevice 18 libavformat 19 libswresample
20 )
libavcodec, libavdevice, libavformat, and libswresample come with ffmpeg, so this should be added to dependencies too.
Note: in fact, if the libs are not found, the feature will be silently disabled:
21 if (LIBAV_FOUND)
22 include_directories(${LIBAV_INCLUDE_DIRS})
23 set(SRC ${SRC} libav_encoder.cpp)
24 set(TARGET_LIBS ${TARGET_LIBS} ${LIBAV_LIBRARIES})
25 set(LIBAV_PRESENT 1)
26 message(STATUS "libavcodec found:")
27 message(STATUS " libraries: ${LIBAV_LIBRARIES}")
28 endif()
29 else()
30 message(STATUS "Omitting libavcodec")
31 endif()However, this is not clean, because we explicitly asked for a feature (enable libav suport) but it gets disabled because of missing dependencies.
So, either we explicitly and unconditionally disable it, or we add the necessary dependencies.
Regards,
Yann E. MORIN.
Quoted 13 lines
package/libcamera-apps/libcamera-apps.mk +1
-0else LIBCAMERA_APPS_CONF_OPTS += -DENABLE_DRM=0 +LIBCAMERA_APPS_CONF_OPTS += -DENABLE_LIBAV=0 endif ifeq ($(BR2_PACKAGE_XORG7),y)Signature · 6 lines
2.38.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 561 099 427 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------' _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot