[vlc-devel] opencv4_patches opencv_wrapper

w.pelser w.pelser at web.de
Mon Sep 23 11:55:43 CEST 2019










VLC and vlc-dev are not compatible with opencv4.

- video_filter/opencv_example.cpp should be rewritten or excluded. It
seems to require objectdetect_c.h, which is not longer part of opencv.

- video_filter/opencv_wrapper.c needes to be converted to a cpp file, to
enable cplusplus a.o.

So I tried to do this with the help of the opencv_example.cpp file. My
knowledge is very smal, but the following patches do not break my
vlc-dev (git/videolan/vlc_branch_master) build anymore.

opencv_wrapper_cpp.patch:

--- a/modules/video_filter/opencv_wrapper.c
+++ b/modules/video_filter/opencv_wrapper.c
@@ -154 +154 @@
-    p_sys = malloc( sizeof( filter_sys_t ) );
+    p_sys = (filter_sys_t *)malloc(sizeof (filter_sys_t));
@@ -167 +167 @@
-    p_sys->p_opencv = vlc_object_create( p_filter, sizeof(filter_t) );
+    p_sys->p_opencv = (filter_t*) vlc_object_create( p_filter,
sizeof(filter_t) );
@@ -266 +266 @@
-    filter_sys_t *p_sys = p_filter->p_sys;
+    filter_sys_t *p_sys = static_cast<filter_sys_t *>(p_filter->p_sys);
@@ -281 +281 @@
-    filter_sys_t* p_sys = p_filter->p_sys;
+    filter_sys_t *p_sys = static_cast<filter_sys_t *>(p_filter->p_sys);
@@ -317 +317 @@
-    filter_sys_t* p_sys = p_filter->p_sys;
+    filter_sys_t *p_sys = static_cast<filter_sys_t *>(p_filter->p_sys);
@@ -402 +402 @@
-    filter_sys_t *p_sys = p_filter->p_sys;
+    filter_sys_t *p_sys = static_cast<filter_sys_t *>(p_filter->p_sys);


configure_ac.patch:

--- a/configure.ac
+++ b/configure.ac
@@ -2017 +2017 @@
-PKG_ENABLE_MODULES_VLC([OPENCV], [opencv_example opencv_wrapper],
[opencv > 2.0], (OpenCV (computer vision) filter), [auto])
+PKG_ENABLE_MODULES_VLC([OPENCV], [opencv_example opencv_wrapper],
[opencv4], (OpenCV (computer vision) filter), [auto])


video_filter_makefile_am.patch:

--- a/modules/video_filter/Makefile.am
+++ b/modules/video_filter/Makefile.am
@@ -157 +157 @@ cpp-Version
-libopencv_wrapper_plugin_la_SOURCES = video_filter/opencv_wrapper.c
+libopencv_wrapper_plugin_la_SOURCES = video_filter/opencv_wrapper.cpp
@@ -175,6+175,6 @@ objdetect_c.h missing, not provided by opencv4
-libopencv_example_plugin_la_SOURCES = video_filter/opencv_example.cpp
video_filter/filter_event_info.h
-libopencv_example_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) $(OPENCV_CFLAGS)
-libopencv_example_plugin_la_LIBADD = $(OPENCV_LIBS)
-libopencv_example_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath
'$(video_filterdir)'
-video_filter_LTLIBRARIES += $(LTLIBopencv_example)
-EXTRA_LTLIBRARIES += libopencv_example_plugin.la
+#libopencv_example_plugin_la_SOURCES = video_filter/opencv_example.cpp
video_filter/filter_event_info.h
+#libopencv_example_plugin_la_CPPFLAGS = $(AM_CPPFLAGS) $(OPENCV_CFLAGS)
+#libopencv_example_plugin_la_LIBADD = $(OPENCV_LIBS)
+#libopencv_example_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath
'$(video_filterdir)'
+#video_filter_LTLIBRARIES += $(LTLIBopencv_example)
+#EXTRA_LTLIBRARIES += libopencv_example_plugin.la

In the hope, this could be helpful,

thanks

walther


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20190923/5afa213a/attachment.html>


More information about the vlc-devel mailing list