[FFmpeg-cvslog] vf_libopencv: add support for opencv 3
Andreas Cadhalpun
git at videolan.org
Tue Jan 26 00:00:46 CET 2016
ffmpeg | branch: master | Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com> | Thu Jan 21 23:17:47 2016 +0100| [38622007c4bdfbdc9e688bf5bb1cdcab0f045e67] | committer: Andreas Cadhalpun
vf_libopencv: add support for opencv 3
It dropped the old headers, but the replacements are already available
with opencv 2.
Reviewed-by: Michael Niedermayer <michael at niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=38622007c4bdfbdc9e688bf5bb1cdcab0f045e67
---
configure | 5 ++++-
libavfilter/vf_libopencv.c | 6 ++++++
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/configure b/configure
index 57b526f..e5cd88e 100755
--- a/configure
+++ b/configure
@@ -1774,6 +1774,7 @@ HEADERS_LIST="
machine_ioctl_bt848_h
machine_ioctl_meteor_h
malloc_h
+ opencv2_core_core_c_h
openjpeg_2_1_openjpeg_h
openjpeg_2_0_openjpeg_h
openjpeg_1_5_openjpeg_h
@@ -5481,7 +5482,9 @@ enabled libmp3lame && require "libmp3lame >= 3.98.3" lame/lame.h lame_set
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_header opencv2/core/core_c.h &&
+ require_pkg_config opencv opencv2/core/core_c.h cvCreateImageHeader ||
+ require_pkg_config opencv opencv/cxcore.h cvCreateImageHeader; }
enabled libopenh264 && require_pkg_config openh264 wels/codec_api.h WelsGetCodecVersion
enabled libopenjpeg && { check_lib openjpeg-2.1/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC ||
check_lib openjpeg-2.0/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC ||
diff --git a/libavfilter/vf_libopencv.c b/libavfilter/vf_libopencv.c
index be27552..f8ae9d5 100644
--- a/libavfilter/vf_libopencv.c
+++ b/libavfilter/vf_libopencv.c
@@ -23,8 +23,14 @@
* libopencv wrapper functions
*/
+#include "config.h"
+#if HAVE_OPENCV2_CORE_CORE_C_H
+#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/common.h"
#include "libavutil/file.h"
More information about the ffmpeg-cvslog
mailing list