After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 772822 - opencv: reinstate check for opencv contrib, compilation fails without it
opencv: reinstate check for opencv contrib, compilation fails without it
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other All
: Normal normal
: 1.11.1
Assigned To: Philippe Renon
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-10-12 20:21 UTC by Philippe Renon
Modified: 2017-01-12 13:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
opencv: check presence of required opencv_contrib headers (901 bytes, patch)
2016-11-23 17:36 UTC, Philippe Renon
none Details | Review
opencv: check presence of required opencv_contrib headers (897 bytes, patch)
2016-11-23 17:41 UTC, Philippe Renon
none Details | Review
opencv: check presence of required opencv_contrib headers (947 bytes, patch)
2016-11-23 17:42 UTC, Philippe Renon
committed Details | Review
opencv/meson: check presence of required opencv_contrib headers (758 bytes, patch)
2016-12-02 03:03 UTC, Nicolas Dufresne (ndufresne)
committed Details | Review

Description Philippe Renon 2016-10-12 20:21:47 UTC
when migrating to opencv 3.10 that check was removed but if opencv_contrib is not present compilation will fail later.

better if it fails fast...

ideally, the opencv element that rely on contrib should be excluded from the build if it not present.
Comment 1 Matthew Waters (ystreet00) 2016-10-19 10:21:04 UTC
Sounds fine.

Would you like to provide a patch?
Comment 2 Philippe Renon 2016-10-19 12:22:35 UTC
Yes, I will submit a patch eventually. 
I wanted to assign the issue to myself but could not find how to do that.
Comment 3 Philippe Renon 2016-11-23 17:36:52 UTC
Created attachment 340626 [details] [review]
opencv: check presence of required opencv_contrib headers

The patch simply checks that one of the needed opencv_header is present.

This header is needed by the segmentation element of the opencv plugin.

Ideally we should have a HAVE_OPENCV_CONTRIB flag and conditionally build the element that depend on it.
Comment 4 Philippe Renon 2016-11-23 17:41:27 UTC
Created attachment 340627 [details] [review]
opencv: check presence of required opencv_contrib headers
Comment 5 Philippe Renon 2016-11-23 17:42:48 UTC
Created attachment 340628 [details] [review]
opencv: check presence of required opencv_contrib headers
Comment 6 Nicolas Dufresne (ndufresne) 2016-11-30 02:48:07 UTC
Attachment 340628 [details] pushed as bf11338 - opencv: check presence of required opencv_contrib headers
Comment 7 Nicolas Dufresne (ndufresne) 2016-11-30 02:50:33 UTC
Actually, this is probably needed on meson side right ?
Comment 8 Philippe Renon 2016-11-30 10:28:11 UTC
> Actually, this is probably needed on meson side right ?

Yep.
Comment 9 Philippe Renon 2016-11-30 11:00:47 UTC
Note that if opencv_contrib is not detected then neither ext/opencv nor the new gst-libs/gst/opencv will be built.

gst-libs/gst/opencv does not depend on opencv_contrib so could be built even if opencv_contrib is missing.

Only one ext/opencv element (afaik) relies on opencv_contrib. Ideally the other ones should be build if opencv_contrib is missing.

We could introduce a HAVE_OPENCV_CONTRIB and have HAVE_OPENCV be true if plain opencv is found.
Comment 10 Nicolas Dufresne (ndufresne) 2016-12-02 03:03:24 UTC
Created attachment 341202 [details] [review]
opencv/meson: check presence of required opencv_contrib headers
Comment 11 Nicolas Dufresne (ndufresne) 2016-12-02 03:04:09 UTC
I'm not ignoring what you said, but just keeping things simple for now. We can
improve is this actually causes issues later.

Attachment 341202 [details] pushed as ab28399 - opencv/meson: check presence of required opencv_contrib headers
Comment 12 Philippe Renon 2016-12-02 07:01:00 UTC
No problems. I captured the above for future reference. No urgency.
Comment 13 Philippe Renon 2016-12-02 07:08:26 UTC
Best, I guess, is to close this issue as it is done and eventually create a new one for further improvements.
Comment 14 Sebastian Dröge (slomo) 2017-01-12 13:58:10 UTC
This broke compilation with OpenCV < 3. Merged a patch

commit c176904c9efb173c9bc368124ebffcab19b7eac8
Author: Sebastian Dröge <sebastian@centricular.com>
Date:   Thu Jan 12 15:55:52 2017 +0200

    opencv: Fix build with OpenCV < 3
    
    We only need the opencv2/bgsegm.hpp header for OpenCV >= 3 and have
    compat code for older versions.