From d2ee9b16fa7d4d3c2ded648a7606152209813a34 Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Thu, 2 Aug 2018 11:19:07 -0400 Subject: [PATCH] opencv: Fixup include to follow new standard This uses the new path for OpenCV headers. OpenCV now have master headers files per modules, which reduce the amount of required includes. Note that HIGHGUI was included to get the imgcodecs includes, which I fixed, though the master header is missing the C headers, so I included that directly. All the image stuff should be ported to C++ eventually. Finally, this patch also update the header checks to reflect the modules that are really being used. --- configure.ac | 15 ++++++++------- ext/opencv/MotionCells.h | 7 +------ ext/opencv/gsthanddetect.h | 6 ------ ext/opencv/gsttemplatematch.cpp | 1 + ext/opencv/gsttemplatematch.h | 7 ------- ext/opencv/meson.build | 14 +++++++------- meson.build | 2 -- 7 files changed, 17 insertions(+), 35 deletions(-) diff --git a/configure.ac b/configure.ac index db1f3cb7d8..36b3a548bd 100644 --- a/configure.ac +++ b/configure.ac @@ -1891,13 +1891,14 @@ AG_GST_CHECK_FEATURE(OPENCV, [opencv plugins], opencv, [ OLD_CPPFLAGS=$CPPFLAGS CPPFLAGS=$OPENCV_CFLAGS something_not_found=no - AC_CHECK_HEADERS([opencv2/core/core_c.h \ - opencv2/core/version.hpp \ - opencv2/highgui/highgui_c.h \ - opencv2/imgproc/imgproc.hpp \ - opencv2/imgproc/imgproc_c.h \ - opencv2/objdetect/objdetect.hpp \ - opencv2/video/background_segm.hpp \ + AC_CHECK_HEADERS([opencv2/bgsegm.hpp \ + opencv2/calib3d.hpp \ + opencv2/core.hpp \ + opencv2/imgcodecs/imgcodecs_c.h \ + opencv2/imgproc.hpp \ + opencv2/objdetect.hpp \ + opencv2/opencv.hpp \ + opencv2/video.hpp \ opencv2/bgsegm.hpp], [], [something_not_found=yes]) CPPFLAGS=$OLD_CPPFLAGS diff --git a/ext/opencv/MotionCells.h b/ext/opencv/MotionCells.h index 96b048379d..6df49abb6a 100644 --- a/ext/opencv/MotionCells.h +++ b/ext/opencv/MotionCells.h @@ -46,12 +46,7 @@ #define MOTIONCELLS_H_ #include -#ifdef HAVE_HIGHGUI_H -#include // includes highGUI definitions -#endif -#ifdef HAVE_OPENCV2_HIGHGUI_HIGHGUI_C_H -#include // includes highGUI definitions -#endif + #include #include #include diff --git a/ext/opencv/gsthanddetect.h b/ext/opencv/gsthanddetect.h index c719311059..8fa0210e63 100644 --- a/ext/opencv/gsthanddetect.h +++ b/ext/opencv/gsthanddetect.h @@ -50,12 +50,6 @@ #include /* opencv */ #include -#ifdef HAVE_HIGHGUI_H -#include // includes highGUI definitions -#endif -#ifdef HAVE_OPENCV2_HIGHGUI_HIGHGUI_C_H -#include // includes highGUI definitions -#endif #include G_BEGIN_DECLS diff --git a/ext/opencv/gsttemplatematch.cpp b/ext/opencv/gsttemplatematch.cpp index c390d1883f..8b4dcf925e 100644 --- a/ext/opencv/gsttemplatematch.cpp +++ b/ext/opencv/gsttemplatematch.cpp @@ -64,6 +64,7 @@ #include "../../gst-libs/gst/gst-i18n-plugin.h" #include "gsttemplatematch.h" #include +#include GST_DEBUG_CATEGORY_STATIC (gst_template_match_debug); #define GST_CAT_DEFAULT gst_template_match_debug diff --git a/ext/opencv/gsttemplatematch.h b/ext/opencv/gsttemplatematch.h index a51ef9f6c6..27a5432c59 100644 --- a/ext/opencv/gsttemplatematch.h +++ b/ext/opencv/gsttemplatematch.h @@ -48,13 +48,6 @@ #include -#ifdef HAVE_HIGHGUI_H -#include // includes highGUI definitions -#endif -#ifdef HAVE_OPENCV2_HIGHGUI_HIGHGUI_C_H -#include // includes highGUI definitions -#endif - G_BEGIN_DECLS /* #defines don't like whitespacey bits */ #define GST_TYPE_TEMPLATE_MATCH \ diff --git a/ext/opencv/meson.build b/ext/opencv/meson.build index 4627565547..ff2fc98f20 100644 --- a/ext/opencv/meson.build +++ b/ext/opencv/meson.build @@ -29,14 +29,14 @@ gstopencv_sources = [ ] libopencv_headers = [ - 'opencv2/core/core_c.h', - 'opencv2/core/version.hpp', - 'opencv2/highgui/highgui_c.h', - 'opencv2/imgproc/imgproc.hpp', - 'opencv2/imgproc/imgproc_c.h', - 'opencv2/objdetect/objdetect.hpp', - 'opencv2/video/background_segm.hpp', 'opencv2/bgsegm.hpp', + 'opencv2/calib3d.hpp', + 'opencv2/core.hpp', + 'opencv2/imgcodecs/imgcodecs_c.h', + 'opencv2/imgproc.hpp', + 'opencv2/objdetect.hpp', + 'opencv2/opencv.hpp', + 'opencv2/video.hpp', ] gstopencv_cargs = ['-DGST_HAAR_CASCADES_DIR="@0@"'] diff --git a/meson.build b/meson.build index 5f1c430bec..b2042e4716 100644 --- a/meson.build +++ b/meson.build @@ -77,14 +77,12 @@ cdata = configuration_data() check_headers = [ ['HAVE_DLFCN_H', 'dlfcn.h'], ['HAVE_FCNTL_H', 'fcntl.h'], - ['HAVE_HIGHGUI_H', 'highgui.h'], ['HAVE_INTTYPES_H', 'inttypes.h'], ['HAVE_MEMORY_H', 'memory.h'], ['HAVE_MSACM_H', 'msacm.h'], ['HAVE_NETINET_IN_H', 'netinet/in.h'], ['HAVE_NETINET_IP_H', 'netinet/ip.h'], ['HAVE_NETINET_TCP_H', 'netinet/tcp.h'], - ['HAVE_OPENCV2_HIGHGUI_HIGHGUI_C_H', 'opencv2/highgui/highgui_c.h'], ['HAVE_PTHREAD_H', 'pthread.h'], ['HAVE_STDINT_H', 'stdint.h'], ['HAVE_STDLIB_H', 'stdlib.h'],