opencv: rework V4L/libv4l support
authorSamuel Martin <s.martin49@gmail.com>
Sun, 31 Aug 2014 20:09:03 +0000 (22:09 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sun, 21 Sep 2014 20:46:52 +0000 (22:46 +0200)
Starting with the 2.4.7 release, for V4L support, OpenCV does not
requires a libv4l dependency for its V4L support.

So, it now provides 2 distincts knobs for this: WITH_V4L and a new
one: WITH_LIBV4L.

This patch takes advantage of this new knob and libv4l support is
now automatically enabled only if the libv4l package is enabled.

In OpenCV, the logic behind this is:
- using libv4l if available,
- otherwise, use v4l2 or v4l API from the kernel if available.

[Thomas: remove gratuituous reformating, as suggested by Yann.]

Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/opencv/Config.in
package/opencv/opencv.mk

index 3f5051ef1288bf6704d975d66a65fae4c8f4ffa2..24f540efbd6f9d83c88ca8c587c5a06c1ad1f417 100644 (file)
@@ -205,16 +205,10 @@ config BR2_PACKAGE_OPENCV_WITH_TIFF
 
 config BR2_PACKAGE_OPENCV_WITH_V4L
        bool "v4l support"
-       depends on BR2_LARGEFILE
-       depends on BR2_TOOLCHAIN_HAS_THREADS
-       depends on BR2_USE_MMU # libv4l fork
-       select BR2_PACKAGE_LIBV4L
        help
          Enable Video 4 Linux support.
 
-comment "v4l support needs a toolchain w/ largefile, threads"
-       depends on !BR2_LARGEFILE || !BR2_TOOLCHAIN_HAS_THREADS
-       depends on BR2_USE_MMU
+         If the package libv4l is enabled, its support is automatically enabled.
 
 comment "Install options"
 
index 1341d3208ab9b869ab5bb7e040f06654307e1f56..8c2de7988e1d376bd20ec532efac00519f5f98c7 100644 (file)
@@ -220,8 +220,10 @@ OPENCV_CONF_OPT += -DWITH_TIFF=OFF
 endif
 
 ifeq ($(BR2_PACKAGE_OPENCV_WITH_V4L),y)
-OPENCV_CONF_OPT += -DWITH_V4L=ON -DWITH_LIBV4L=ON
-OPENCV_DEPENDENCIES += libv4l
+OPENCV_CONF_OPT += \
+       -DWITH_V4L=ON \
+       -DWITH_LIBV4L=$(if $(BR2_PACKAGE_LIBV4L),ON,OFF)
+OPENCV_DEPENDENCIES += $(if $(BR2_PACKAGE_LIBV4L),libv4l)
 else
 OPENCV_CONF_OPT += -DWITH_V4L=OFF -DWITH_LIBV4L=OFF
 endif