]> code.ossystems Code Review - meta-freescale.git/commitdiff
gstreamer1.0-plugins-bad: fix build for opencv >= 3.4.2
authorGary Bisson <gary.bisson@boundarydevices.com>
Wed, 12 Sep 2018 13:20:46 +0000 (15:20 +0200)
committerOtavio Salvador <otavio@ossystems.com.br>
Wed, 12 Sep 2018 13:30:23 +0000 (10:30 -0300)
Since OpenCV was updated to version 3.4.3 in meta-openembedded:
7b9f86ca7 opencv: Update to 3.4.3

The gstreamer-plugins from NXP is therefore out of sync and can't build
without this patch from upstream.

Signed-off-by: Gary Bisson <gary.bisson@boundarydevices.com>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-opencv-fix-build-for-opencv-3-4-2.patch [new file with mode: 0644]
recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.14.imx.bb

diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-opencv-fix-build-for-opencv-3-4-2.patch b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0001-opencv-fix-build-for-opencv-3-4-2.patch
new file mode 100644 (file)
index 0000000..5c53e8e
--- /dev/null
@@ -0,0 +1,63 @@
+From c247745faaf885fd3fa094198fc0ea288e295dbf Mon Sep 17 00:00:00 2001
+From: Thibault Saunier <tsaunier@igalia.com>
+Date: Fri, 13 Jul 2018 14:42:28 -0400
+Subject: [PATCH] opencv: Fix build for opencv >= 3.4.2
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The `CV_RGB` macro is now in `imgproc.hpp`.
+
+Fixes:
+
+    ../subprojects/gst-plugins-bad/ext/opencv/gsthanddetect.cpp:497:40: error: ‘CV_RGB’ was not declared in this scope
+            cvCircle (img, center, radius, CV_RGB (0, 0, 200), 1, 8, 0);
+                                        ^~~~~~
+---
+ ext/opencv/MotionCells.cpp      | 3 +++
+ ext/opencv/gsthanddetect.cpp    | 3 +++
+ ext/opencv/gsttemplatematch.cpp | 3 +++
+ 3 files changed, 9 insertions(+)
+
+diff --git a/ext/opencv/MotionCells.cpp b/ext/opencv/MotionCells.cpp
+index f85989e117..175ec901b2 100644
+--- a/ext/opencv/MotionCells.cpp
++++ b/ext/opencv/MotionCells.cpp
+@@ -51,6 +51,9 @@
+ #include <errno.h>
+ #include "MotionCells.h"
++#if (CV_MAJOR_VERSION >= 3)
++#include <opencv2/imgproc.hpp>
++#endif
+ #include <opencv2/imgproc/imgproc_c.h>
+ MotionCells::MotionCells ()
+diff --git a/ext/opencv/gsthanddetect.cpp b/ext/opencv/gsthanddetect.cpp
+index 60fd5be72b..47203fd0ea 100644
+--- a/ext/opencv/gsthanddetect.cpp
++++ b/ext/opencv/gsthanddetect.cpp
+@@ -62,6 +62,9 @@
+ /* element header */
+ #include "gsthanddetect.h"
++#if (CV_MAJOR_VERSION >= 3)
++#include <opencv2/imgproc.hpp>
++#endif
+ #include <opencv2/imgproc/imgproc_c.h>
+ GST_DEBUG_CATEGORY_STATIC (gst_handdetect_debug);
+diff --git a/ext/opencv/gsttemplatematch.cpp b/ext/opencv/gsttemplatematch.cpp
+index f39208dc28..ec0b56af88 100644
+--- a/ext/opencv/gsttemplatematch.cpp
++++ b/ext/opencv/gsttemplatematch.cpp
+@@ -63,6 +63,9 @@
+ #include "../../gst-libs/gst/gst-i18n-plugin.h"
+ #include "gsttemplatematch.h"
++#if (CV_MAJOR_VERSION >= 3)
++#include <opencv2/imgproc.hpp>
++#endif
+ #include <opencv2/imgproc/imgproc_c.h>
+ GST_DEBUG_CATEGORY_STATIC (gst_template_match_debug);
index 313d4da1d566b436f507a34c338a0d0a84727962..f35c825b12453c78a5c88258b5d8ecbf73ff70e2 100644 (file)
@@ -23,6 +23,7 @@ SRC_URI = " \
     ${GST1.0-PLUGINS-BAD_SRC};branch=${SRCBRANCH} \
     file://configure-allow-to-disable-libssh2.patch \
     file://0001-Makefile.am-don-t-hardcode-libtool-name-when-running.patch \
+    file://0001-opencv-fix-build-for-opencv-3-4-2.patch \
 "
 
 SRCREV = "07ad0bb676a16c2dffb0f0e415a873f0924cfdc0"