Skip to contentSkip to conversation

package/libcamera-apps: enable LIBAV only if libdrm is present

PATCH Superseded Marcus Folkesson 2 participants 3 messages Feb 20, 2023 – Feb 21, 2023

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 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>

      |          ^~~~~~~~~~~~~~~~~~~~~

---

Notes:
v2:
-Add dependency to ffmpeg

 package/libcamera-apps/Config.in         | 1 +
 package/libcamera-apps/libcamera-apps.mk | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)
package/libcamera-apps/Config.in +1 -0
index 711fd6de05..d0cc6a4210 100644
@@ -15,6 +15,7 @@ config BR2_PACKAGE_LIBCAMERA_APPS
 	select BR2_PACKAGE_TIFF
 	select BR2_PACKAGE_XLIB_LIBX11 if BR2_PACKAGE_XORG7 && (BR2_PACKAGE_HAS_LIBEGL || BR2_PACKAGE_HAS_LIBGL)
 	select BR2_PACKAGE_LIBDRM if BR2_PACKAGE_XORG7 && (BR2_PACKAGE_HAS_LIBEGL || BR2_PACKAGE_HAS_LIBGL)
+	select BR2_PACKAGE_FFMPEG if BR2_PACKAGE_LIBDRM
 	select BR2_PACKAGE_LIBEPOXY if BR2_PACKAGE_XORG7 && (BR2_PACKAGE_HAS_LIBEGL || BR2_PACKAGE_HAS_LIBGL)
 	select BR2_PACKAGE_QT5BASE_GUI if BR2_PACKAGE_QT5
 	select BR2_PACKAGE_QT5BASE_WIDGETS if BR2_PACKAGE_QT5
package/libcamera-apps/libcamera-apps.mk +3 -1
index 290ee9a026..1464875298 100644
@@ -23,10 +23,12 @@ LIBCAMERA_APPS_CONF_OPTS = \
 	-DENABLE_TFLITE=0
 
 ifeq ($(BR2_PACKAGE_LIBDRM),y)
-LIBCAMERA_APPS_DEPENDENCIES += libdrm
+LIBCAMERA_APPS_DEPENDENCIES += ffmpeg 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
#1 lore raw

Hello Marcus,

Quoted 11 lines · On Mon, 20 Feb 2023 08:18:46 +0100 Marcus Folkesson…

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>

      |          ^~~~~~~~~~~~~~~~~~~~~

I need to do some test builds, but I believe this patch is not correct. What the error message seems to say is that when you build libav support in libcamera-apps, then libdrm support is needed.

But what you're patch is doing is that it's forcing to have libva as soon as libdrm is available, which I'm not sure is needed.

Quoted 18 lines
package/libcamera-apps/Config.in +1 -0
index 711fd6de05..d0cc6a4210 100644
@@ -15,6 +15,7 @@ config BR2_PACKAGE_LIBCAMERA_APPS
 	select BR2_PACKAGE_TIFF
 	select BR2_PACKAGE_XLIB_LIBX11 if BR2_PACKAGE_XORG7 && (BR2_PACKAGE_HAS_LIBEGL || BR2_PACKAGE_HAS_LIBGL)
 	select BR2_PACKAGE_LIBDRM if BR2_PACKAGE_XORG7 && (BR2_PACKAGE_HAS_LIBEGL || BR2_PACKAGE_HAS_LIBGL)
+	select BR2_PACKAGE_FFMPEG if BR2_PACKAGE_LIBDRM
 	select BR2_PACKAGE_LIBEPOXY if BR2_PACKAGE_XORG7 && (BR2_PACKAGE_HAS_LIBEGL || BR2_PACKAGE_HAS_LIBGL)
 	select BR2_PACKAGE_QT5BASE_GUI if BR2_PACKAGE_QT5
 	select BR2_PACKAGE_QT5BASE_WIDGETS if BR2_PACKAGE_QT5
package/libcamera-apps/libcamera-apps.mk +0 -0
index 290ee9a026..1464875298 100644
@@ -23,10 +23,12 @@ LIBCAMERA_APPS_CONF_OPTS = \
 	-DENABLE_TFLITE=0

package/libcamera-apps/libcamera-apps.mk LIBCAMERA_APPS_CONF_OPTS = \ · line 32

Quoted 10 lines
package/libcamera-apps/libcamera-apps.mk +3 -1
 
 ifeq ($(BR2_PACKAGE_LIBDRM),y)
-LIBCAMERA_APPS_DEPENDENCIES += libdrm
+LIBCAMERA_APPS_DEPENDENCIES += ffmpeg 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

Could you instead try something like this:

ifeq ($(BR2_PACKAGE_FFMPEG)$(BR2_PACKAGE_LIBDRM),yy) LIBCAMERA_APPS_DEPENDENCIES += ffmpeg libdrm LIBCAMERA_APPS_CONF_OPTS += -DENABLE_LIBAV=1 else
LIBCAMERA_APPS_CONF_OPTS += -DENABLE_LIBAV=0 endif

To test this, you need to test 4 different cases:

- libcamera-apps enabled, ffmpeg disabled, libdrm disabled
- libcamera-apps enabled, ffmpeg enabled, libdrm disabled
- libcamera-apps enabled, ffmpeg disabled, libdrm enabled
- libcamera-apps enabled, ffmpeg enabled, libdrm enabled

Best regards,

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw
Quoted 1 line · On Mon, 20 Feb 2023 22:17:21 +0100 Thomas Petazzoni…

I need to do some test builds, but I believe this patch is not correct.

I confirm the patch is not correct: if you have a configuration with libcamera-apps and libdrm (but ffmpeg disabled), it builds just fine, and DRM support in camera-apps is enabled.

In this configuration, your patch forces a dependency on ffmpeg, which is not correct.

Could you have a look at my previous suggestion instead?

Thanks a lot,

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot