package/ffmpeg: add optional support for opencv
authorBernd Kuhls <bernd.kuhls@t-online.de>
Mon, 15 Aug 2016 15:03:39 +0000 (17:03 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Fri, 26 Aug 2016 15:17:47 +0000 (17:17 +0200)
ffmpeg only needs the imgproc module of opencv:
https://github.com/FFmpeg/FFmpeg/commit/15708f13477aaf2effdc0d7fc727507bc468335a

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/ffmpeg/ffmpeg.mk

index 91e7fa979a3108aa333a5ff782bf5197d2be1d85..1d041012e729b437d1d34c604b327845bff74c14 100644 (file)
@@ -48,7 +48,6 @@ FFMPEG_CONF_OPTS = \
        --disable-frei0r \
        --disable-libopencore-amrnb \
        --disable-libopencore-amrwb \
-       --disable-libopencv \
        --disable-libcdio \
        --disable-libdc1394 \
        --disable-libfaac \
@@ -249,6 +248,15 @@ else
 FFMPEG_CONF_OPTS += --disable-vdpau
 endif
 
+# To avoid a circular dependency only use opencv if opencv itself does
+# not depend on ffmpeg.
+ifeq ($(BR2_PACKAGE_OPENCV_LIB_IMGPROC)x$(BR2_PACKAGE_OPENCV_WITH_FFMPEG),yx)
+FFMPEG_CONF_OPTS += --enable-libopencv
+FFMPEG_DEPENDENCIES += opencv
+else
+FFMPEG_CONF_OPTS += --disable-libopencv
+endif
+
 ifeq ($(BR2_PACKAGE_OPUS),y)
 FFMPEG_CONF_OPTS += --enable-libopus
 FFMPEG_DEPENDENCIES += opus