aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Jansa <Martin.Jansa@gmail.com>2018-05-12 15:34:55 +0000
committerMartin Jansa <Martin.Jansa@gmail.com>2018-06-21 23:44:01 +0000
commit2d164f0c874a3b7d401f503f63e0972d59621b18 (patch)
treec1691ab58e964aa290051607bdd54d4d405ca0dd
parenta7c45eb0375eb4000aaa3cd752b697042cab0bf1 (diff)
downloadmeta-openembedded-contrib-jansa/master.zip
meta-openembedded-contrib-jansa/master.tar.gz
meta-openembedded-contrib-jansa/master.tar.bz2
opencv: fix build with ffmpeg-4jansa/master
http://errors.yoctoproject.org/Errors/Details/178523/ Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
-rw-r--r--meta-oe/recipes-support/opencv/opencv/0001-fix-build-with-ffmpeg-4.patch30
-rw-r--r--meta-oe/recipes-support/opencv/opencv_3.3.bb1
2 files changed, 31 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/opencv/opencv/0001-fix-build-with-ffmpeg-4.patch b/meta-oe/recipes-support/opencv/opencv/0001-fix-build-with-ffmpeg-4.patch
new file mode 100644
index 0000000..7ce0e6e
--- /dev/null
+++ b/meta-oe/recipes-support/opencv/opencv/0001-fix-build-with-ffmpeg-4.patch
@@ -0,0 +1,30 @@
+From 9a29904274289b377e031a94ff902909aaf5f795 Mon Sep 17 00:00:00 2001
+From: Martin Jansa <Martin.Jansa@gmail.com>
+Date: Sat, 12 May 2018 15:33:06 +0000
+Subject: [PATCH] fix build with ffmpeg-4
+
+* add temporary work around from:
+ https://stackoverflow.com/questions/46884682/error-in-building-opencv-with-ffmpeg
+
+Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
+---
+ modules/videoio/src/cap_ffmpeg_impl.hpp | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/modules/videoio/src/cap_ffmpeg_impl.hpp b/modules/videoio/src/cap_ffmpeg_impl.hpp
+index 5a9b10f075..5ff6424416 100644
+--- a/modules/videoio/src/cap_ffmpeg_impl.hpp
++++ b/modules/videoio/src/cap_ffmpeg_impl.hpp
+@@ -92,6 +92,12 @@ extern "C" {
+ #define CV_WARN(message) fprintf(stderr, "warning: %s (%s:%d)\n", message, __FILE__, __LINE__)
+ #endif
+
++// temporary hack for compatibility with ffmpeg-4
++// https://stackoverflow.com/questions/46884682/error-in-building-opencv-with-ffmpeg
++#define AV_CODEC_FLAG_GLOBAL_HEADER (1 << 22)
++#define CODEC_FLAG_GLOBAL_HEADER AV_CODEC_FLAG_GLOBAL_HEADER
++#define AVFMT_RAWPICTURE 0x0020
++
+ #if defined _WIN32
+ #include <windows.h>
+ #if defined _MSC_VER && _MSC_VER < 1900
diff --git a/meta-oe/recipes-support/opencv/opencv_3.3.bb b/meta-oe/recipes-support/opencv/opencv_3.3.bb
index b697f44..d44d89f 100644
--- a/meta-oe/recipes-support/opencv/opencv_3.3.bb
+++ b/meta-oe/recipes-support/opencv/opencv_3.3.bb
@@ -57,6 +57,7 @@ SRC_URI = "git://github.com/opencv/opencv.git;name=opencv \
file://0001-carotene-don-t-use-__asm__-with-aarch64.patch \
file://0002-Do-not-enable-asm-with-clang.patch \
file://CVE-2017-14136.patch \
+ file://0001-fix-build-with-ffmpeg-4.patch \
file://javagen.patch \
file://protobuf.patch \
file://already-exists.patch \