[FFmpeg-trac] #323(avfilter:new): [patch] properly detect and compile with opencv 2.2+
FFmpeg
trac at avcodec.org
Thu Jun 30 10:22:12 CEST 2011
#323: [patch] properly detect and compile with opencv 2.2+
----------------------+--------------------------
Reporter: mm | Type: enhancement
Status: new | Priority: normal
Component: avfilter | Version: unspecified
Keywords: opencv | Blocked By:
Blocking: | Reproduced: 0
Analyzed: 0 |
----------------------+--------------------------
For libavfilter/vf_libopencv.c starting with OpenCV version 2.2 only the
opencv_core and opencv_imgproc headers and libraries are required. Example
patch below adds proper support for this case. This is relevant for master
and oldabi.
{{{
diff --git a/configure b/configure
index fd4b034..ea74df3 100755
--- a/configure
+++ b/configure
@@ -2900,6 +2900,8 @@ enabled libnut && require libnut libnut.h
nut_demuxer_init -lnut
enabled libopencore_amrnb && require libopencore_amrnb opencore-
amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb
enabled libopencore_amrwb && require libopencore_amrwb opencore-
amrwb/dec_if.h D_IF_init -lopencore-amrwb
enabled libopencv && require_pkg_config opencv opencv/cxcore.h
cvCreateImageHeader
+enabled libopencv && check_pkg_config opencv opencv2/imgproc/imgproc_c.h
cvCreateImageHeader && add_cflags -DHAVE_OPENCV2 ||
+ require_pkg_config opencv opencv/cxcore.h
cvCreateImageHeader
enabled libopenjpeg && require libopenjpeg openjpeg.h opj_version
-lopenjpeg
enabled librtmp && require_pkg_config librtmp librtmp/rtmp.h
RTMP_Socket
enabled libschroedinger && require_pkg_config schroedinger-1.0
schroedinger/schro.h schro_init
diff --git a/libavfilter/vf_libopencv.c b/libavfilter/vf_libopencv.c
index e1b51c5..f22b2bc 100644
--- a/libavfilter/vf_libopencv.c
+++ b/libavfilter/vf_libopencv.c
@@ -25,8 +25,13 @@
/* #define DEBUG */
+#ifdef HAVE_OPENCV2
+#include <opencv2/core/core_c.h>
+#include <opencv2/imgproc/imgproc_c.h>
+#else
#include <opencv/cv.h>
#include <opencv/cxcore.h>
+#endif
#include "libavutil/avstring.h"
#include "libavutil/file.h"
#include "avfilter.h"
}}}
--
Ticket URL: <https://ffmpeg.org/trac/ffmpeg/ticket/323>
FFmpeg <http://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list