<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>(This is an additional mail, as the original is lost and I want
      to answer again)</p>
    <p>Hi Steve!</p>
    <p>Today I found out, that the patched opencv_wrapper.c, renamed to
      opencv_wrapper.cpp is also working with opencv3. My conclusion is,
      that opencv_wrapper.c is obsolete and should be replaced by
      opencv_wrapper.cpp. Please check the code-changes before.<br>
    </p>
    <p>thanks<br>
    </p>
    <p>walther<br>
    </p>
    <p><br>
    </p>
    <p><br>
    </p>
    <p><br>
    </p>
    <p>Hi,<br>
      <br>
      On 2019-09-23 11:55, w.pelser wrote:<br>
      > <br>
      > <br>
      > <br>
      > <br>
      > <br>
      > <br>
      > <br>
      > <br>
      > <br>
      > VLC and vlc-dev are not compatible with opencv4.<br>
      > <br>
      > - video_filter/opencv_example.cpp should be rewritten or
      excluded. It<br>
      > seems to require objectdetect_c.h, which is not longer part
      of opencv.<br>
      > <br>
      > - video_filter/opencv_wrapper.c needes to be converted to a
      cpp file, to<br>
      > enable cplusplus a.o.<br>
      > <br>
      > So I tried to do this with the help of the opencv_example.cpp
      file. My<br>
      > knowledge is very smal, but the following patches do not
      break my<br>
      > vlc-dev (git/videolan/vlc_branch_master) build anymore.<br>
      > <br>
      > opencv_wrapper_cpp.patch:<br>
      > <br>
      > --- a/modules/video_filter/opencv_wrapper.c<br>
      > +++ b/modules/video_filter/opencv_wrapper.c<br>
      > @@ -154 +154 @@<br>
      > -    p_sys = malloc( sizeof( filter_sys_t ) );<br>
      > +    p_sys = (filter_sys_t *)malloc(sizeof (filter_sys_t));<br>
      > @@ -167 +167 @@<br>
      > -    p_sys->p_opencv = vlc_object_create( p_filter,
      sizeof(filter_t) );<br>
      > +    p_sys->p_opencv = (filter_t*) vlc_object_create(
      p_filter,<br>
      > sizeof(filter_t) );<br>
      > @@ -266 +266 @@<br>
      > -    filter_sys_t *p_sys = p_filter->p_sys;<br>
      > +    filter_sys_t *p_sys = static_cast<filter_sys_t
      *>(p_filter->p_sys);<br>
      > @@ -281 +281 @@<br>
      > -    filter_sys_t* p_sys = p_filter->p_sys;<br>
      > +    filter_sys_t *p_sys = static_cast<filter_sys_t
      *>(p_filter->p_sys);<br>
      > @@ -317 +317 @@<br>
      > -    filter_sys_t* p_sys = p_filter->p_sys;<br>
      > +    filter_sys_t *p_sys = static_cast<filter_sys_t
      *>(p_filter->p_sys);<br>
      > @@ -402 +402 @@<br>
      > -    filter_sys_t *p_sys = p_filter->p_sys;<br>
      > +    filter_sys_t *p_sys = static_cast<filter_sys_t
      *>(p_filter->p_sys);<br>
      > <br>
      > <br>
      > configure_ac.patch:<br>
      > <br>
      > --- a/configure.ac<br>
      > +++ b/configure.ac<br>
      > @@ -2017 +2017 @@<br>
      > -PKG_ENABLE_MODULES_VLC([OPENCV], [opencv_example
      opencv_wrapper],<br>
      > [opencv > 2.0], (OpenCV (computer vision) filter), [auto])<br>
      > +PKG_ENABLE_MODULES_VLC([OPENCV], [opencv_example
      opencv_wrapper],<br>
      > [opencv4], (OpenCV (computer vision) filter), [auto])<br>
      > <br>
      > <br>
      > video_filter_makefile_am.patch:<br>
      > <br>
      > --- a/modules/video_filter/Makefile.am<br>
      > +++ b/modules/video_filter/Makefile.am<br>
      > @@ -157 +157 @@ cpp-Version<br>
      > -libopencv_wrapper_plugin_la_SOURCES =
      video_filter/opencv_wrapper.c<br>
      > +libopencv_wrapper_plugin_la_SOURCES =
      video_filter/opencv_wrapper.cpp<br>
      <br>
      It seems that you didn't rename the file in your patch so it
      shouldn't <br>
      compile.</p>
    <pre>Yes, I renamed patched opencv_wrapper.c to opencv_wrapper.cpp. During build opencv_wrapper.c is buils as CC, opencv_wrapper.cpp is build as CXX. That's the point for me.
</pre>
    <p><br>
      As for C++ do you need it for linking ? Or do the API not work
      with C <br>
      anymore ? In the former case you can just add dummy.cpp to you
      project <br>
      and it will trigger the C++ handling of autotools.</p>
    <pre>The API does not work anymore with CC. See <a class="moz-txt-link-freetext" href="https://trac.videolan.org/vlc/ticket/22016">https://trac.videolan.org/vlc/ticket/22016</a> and the include lines always produce lots of fatal errors during build as CC.
My OS is openSUSE Tumbleweed, where opencv4 has become the default opencv-version. since then the trouble began. opencv3 is at its end and not developed further.</pre>
    <p><br>
      > @@ -175,6+175,6 @@ objdetect_c.h missing, not provided by
      opencv4<br>
      > -libopencv_example_plugin_la_SOURCES =
      video_filter/opencv_example.cpp<br>
      > video_filter/filter_event_info.h<br>
      > -libopencv_example_plugin_la_CPPFLAGS = $(AM_CPPFLAGS)
      $(OPENCV_CFLAGS)<br>
      > -libopencv_example_plugin_la_LIBADD = $(OPENCV_LIBS)<br>
      > -libopencv_example_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath<br>
      > '$(video_filterdir)'<br>
      > -video_filter_LTLIBRARIES += $(LTLIBopencv_example)<br>
      > -EXTRA_LTLIBRARIES += libopencv_example_plugin.la<br>
      > +#libopencv_example_plugin_la_SOURCES =
      video_filter/opencv_example.cpp<br>
      > video_filter/filter_event_info.h<br>
      > +#libopencv_example_plugin_la_CPPFLAGS = $(AM_CPPFLAGS)
      $(OPENCV_CFLAGS)<br>
      > +#libopencv_example_plugin_la_LIBADD = $(OPENCV_LIBS)<br>
      > +#libopencv_example_plugin_la_LDFLAGS = $(AM_LDFLAGS) -rpath<br>
      > '$(video_filterdir)'<br>
      > +#video_filter_LTLIBRARIES += $(LTLIBopencv_example)<br>
      > +#EXTRA_LTLIBRARIES += libopencv_example_plugin.la<br>
      > <br>
      > In the hope, this could be helpful,<br>
      > <br>
      > thanks<br>
      > <br>
      > walther<br>
      > <br>
      > <br>
      > <br>
      > <br>
      > _______________________________________________<br>
      <br>
    </p>
  </body>
</html>