Skip to contentSkip to conversation

OpenCV bump

PATCH Superseded Samuel Martin 2 participants 18 messages Jul 4, 2015 – Jul 5, 2015

v7 of 9 Superseded Latest is v9 →

lore
Share & tools
lore
#0 lore raw

v7 cover OpenCV bump

Hi all,

Here is yet another (and hopefully the last) iteration for the bump of OpenCV package, and related features/packages.

Patches 1 and 2 update gstreamer support.
Patches 3 to 6 update GUI toolkit support.
Patch 7 fixes reverse dependency (vlc).

Regards,

Samuel Martin (7):
package/opencv: add a choice for selecting gstreamer support package/opencv: add gstreamer-1.x support package/opencv: add a choice for selecting the gui toolkit package/opencv: add qt5 support
package/opencv: add gtk3 support
package/opencv: add opengl support
package/vlc: add opencv support

 package/opencv/Config.in                           | 162 +++++++++++++++++----
 package/opencv/opencv.mk                           |  42 +++++-
 ...opencv_wrapper-use-opencv2-style-includes.patch |  36 +++++
 ...cv_example-add-missing-include-statements.patch |  29 ++++
 package/vlc/Config.in                              |   2 +
 package/vlc/vlc.mk                                 |   8 +-
 6 files changed, 244 insertions(+), 35 deletions(-)
 create mode 100644 package/vlc/0008-opencv_wrapper-use-opencv2-style-includes.patch
 create mode 100644 package/vlc/0009-opencv_example-add-missing-include-statements.patch

--
2.4.5

#1 lore raw

PATCH v7 1/7 package/opencv: add a choice for selecting gstreamer support

OpenCV 3.0 support both gstreamer-0.10 and gstreamer-1.x, but only one is used at the time.

This patch turns the gstreamer support into a choice, in order to prepare adding the support for gstreamer-1 in a following patch.

---
changes v6->v7:
- move gstreamer comment inside the choice (Yann)

changes v5->v6:
- new patch

---
 package/opencv/Config.in | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)
package/opencv/Config.in +15 -5
index 576f667..c3b7535 100644
@@ -173,19 +173,29 @@ config BR2_PACKAGE_OPENCV_WITH_FFMPEG
 	help
 	  Use ffmpeg from the target system.
 
+choice
+	prompt "gstreamer support"
+	help
+	  OpenCV prefers gstreamer-1 over gstreamer-0.10.
+
+config BR2_PACKAGE_OPENCV_WITHOUT_GSTREAMER
+	bool "none"
+
 config BR2_PACKAGE_OPENCV_WITH_GSTREAMER
-	bool "gstreamer support"
-	depends on BR2_USE_MMU # gstreamer -> libglib2
-	depends on BR2_USE_WCHAR # gstreamer -> libglib2
-	depends on BR2_TOOLCHAIN_HAS_THREADS # gstreamer -> libglib2
+	bool "gstreamer-0.10"
+	depends on BR2_USE_MMU # libglib2
+	depends on BR2_USE_WCHAR # libglib2
+	depends on BR2_TOOLCHAIN_HAS_THREADS # libglib2
 	select BR2_PACKAGE_GSTREAMER
 	select BR2_PACKAGE_GST_PLUGINS_BASE
 	select BR2_PACKAGE_GST_PLUGINS_BASE_PLUGIN_APP
 
-comment "gstreamer support needs a toolchain w/ wchar, threads"
+comment "gstreamer-0.10 support needs a toolchain w/ wchar, threads"
 	depends on BR2_USE_MMU
 	depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS
 
+endchoice
+
 config BR2_PACKAGE_OPENCV_WITH_GTK
 	bool "gtk support"
 	depends on BR2_PACKAGE_XORG7
Signature · 1 line
2.4.5
#2 lore raw

PATCH v7 1/7 package/opencv: add a choice for selecting gstreamer support

Samuel, All,

On 2015-07-04 21:06 +0200, Samuel Martin spake thusly:

Quoted 23 lines

OpenCV 3.0 support both gstreamer-0.10 and gstreamer-1.x, but only one is used at the time.

This patch turns the gstreamer support into a choice, in order to prepare adding the support for gstreamer-1 in a following patch.

---
changes v6->v7:
- move gstreamer comment inside the choice (Yann)

changes v5->v6:
- new patch

---
 package/opencv/Config.in | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)
package/opencv/Config.in +0 -0
index 576f667..c3b7535 100644

package/opencv/Config.in config BR2_PACKAGE_OPENCV_WITH_FFMPEG · line 179

Quoted 7 lines
package/opencv/Config.in +4 -0
@@ -173,19 +173,29 @@ config BR2_PACKAGE_OPENCV_WITH_FFMPEG
 	help
 	  Use ffmpeg from the target system.
 
+choice
+	prompt "gstreamer support"
+	help
+	  OpenCV prefers gstreamer-1 over gstreamer-0.10.

This comment does not belong in this commit, but should have been part of the following commit, where you effectively add support for gst-1.

package/opencv/Config.in config BR2_PACKAGE_OPENCV_WITH_FFMPEG · line 188

Quoted 12 lines
package/opencv/Config.in +7 -4
+config BR2_PACKAGE_OPENCV_WITHOUT_GSTREAMER
+	bool "none"
+
 config BR2_PACKAGE_OPENCV_WITH_GSTREAMER
-	bool "gstreamer support"
-	depends on BR2_USE_MMU # gstreamer -> libglib2
-	depends on BR2_USE_WCHAR # gstreamer -> libglib2
-	depends on BR2_TOOLCHAIN_HAS_THREADS # gstreamer -> libglib2
+	bool "gstreamer-0.10"
+	depends on BR2_USE_MMU # libglib2
+	depends on BR2_USE_WCHAR # libglib2
+	depends on BR2_TOOLCHAIN_HAS_THREADS # libglib2

I would have changed the comment about the dependencies, and if so, I would have kept the gst part, not the glib part (because we're not selecting glib, so it is not so obvious why we need those deps).

Otherwise:

Regards,
Yann E. MORIN.

Quoted 21 lines
package/opencv/Config.in +3 -1
 	select BR2_PACKAGE_GSTREAMER
 	select BR2_PACKAGE_GST_PLUGINS_BASE
 	select BR2_PACKAGE_GST_PLUGINS_BASE_PLUGIN_APP
 
-comment "gstreamer support needs a toolchain w/ wchar, threads"
+comment "gstreamer-0.10 support needs a toolchain w/ wchar, threads"
 	depends on BR2_USE_MMU
 	depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS
 
+endchoice
+
 config BR2_PACKAGE_OPENCV_WITH_GTK
 	bool "gtk support"
 	depends on BR2_PACKAGE_XORG7
Signature · 6 lines
2.4.5

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#3 lore raw

PATCH v7 2/7 package/opencv: add gstreamer-1.x support

In reply to Samuel Martin

Starting with the 2.4.10 release, OpenCV supports both Gstreamer-0.10 and Gstreamer-1, but only one can be enabled at the same time (OpenCV chooses Gstreamer-1 over Gstreamer-0.10 when both are available).

Cc "Yann E. MORIN" <[email protected]>

---
changes v6->v7:
- move gstreamer1 comment inside the choice (Yann)
- remove extra endif in opencv.mk (catched by Yann)

changes v5->v6:
- rebase
- use a choice

changes v4->v5:
- rebase
- update a/r/t tags
- rework gst-X backend selection (use similar structure for qt)
- remove patch merged upstream

changes v3->v4:
- new patch

---
 package/opencv/Config.in | 13 +++++++++++++
 package/opencv/opencv.mk | 13 ++++++++++---
 2 files changed, 23 insertions(+), 3 deletions(-)
package/opencv/Config.in +13 -0
index c3b7535..92a1306 100644
@@ -194,6 +194,19 @@ comment "gstreamer-0.10 support needs a toolchain w/ wchar, threads"
 	depends on BR2_USE_MMU
 	depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS
 
+config BR2_PACKAGE_OPENCV_WITH_GSTREAMER1
+	bool "gstreamer-1.x"
+	depends on BR2_USE_MMU # libglib2
+	depends on BR2_USE_WCHAR # libglib2
+	depends on BR2_TOOLCHAIN_HAS_THREADS # libglib2
+	select BR2_PACKAGE_GSTREAMER1
+	select BR2_PACKAGE_GST1_PLUGINS_BASE
+	select BR2_PACKAGE_GST1_PLUGINS_BASE_PLUGIN_APP
+
+comment "gstreamer-1.x support needs a toolchain w/ wchar, threads"
+	depends on BR2_USE_MMU
+	depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS
+
 endchoice
 
 config BR2_PACKAGE_OPENCV_WITH_GTK
package/opencv/opencv.mk +10 -3
index 633c2bf..6b1a139 100644
@@ -222,11 +222,18 @@ else
 OPENCV_CONF_OPTS += -DWITH_FFMPEG=OFF
 endif
 
+ifeq ($(BR2_PACKAGE_OPENCV_WITH_GSTREAMER)$(BR2_PACKAGE_OPENCV_WITH_GSTREAMER1),)
+OPENCV_CONF_OPTS += -DWITH_GSTREAMER=OFF -DWITH_GSTREAMER_0_10=OFF
+endif
+
 ifeq ($(BR2_PACKAGE_OPENCV_WITH_GSTREAMER),y)
-OPENCV_CONF_OPTS += -DWITH_GSTREAMER=ON -DWITH_GSTREAMER_0_10=ON
+OPENCV_CONF_OPTS += -DWITH_GSTREAMER=OFF -DWITH_GSTREAMER_0_10=ON
 OPENCV_DEPENDENCIES += gstreamer gst-plugins-base
-else
-OPENCV_CONF_OPTS += -DWITH_GSTREAMER=OFF -DWITH_GSTREAMER_0_10=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_OPENCV_WITH_GSTREAMER1),y)
+OPENCV_CONF_OPTS += -DWITH_GSTREAMER=ON -DWITH_GSTREAMER_0_10=OFF
+OPENCV_DEPENDENCIES += gstreamer1 gst1-plugins-base
 endif
 
 ifeq ($(BR2_PACKAGE_OPENCV_WITH_GTK),y)
Signature · 1 line
2.4.5
#4 lore raw

PATCH v7 2/7 package/opencv: add gstreamer-1.x support

Samuel, All,

On 2015-07-04 21:06 +0200, Samuel Martin spake thusly:

Quoted 6 lines

Starting with the 2.4.10 release, OpenCV supports both Gstreamer-0.10 and Gstreamer-1, but only one can be enabled at the same time (OpenCV chooses Gstreamer-1 over Gstreamer-0.10 when both are available).

Cc "Yann E. MORIN" <[email protected]>

[--SNIP--]

package/opencv/Config.in comment "gstreamer-0.10 support needs a toolchain w/ wchar, threads" · line 201

Quoted 13 lines
package/opencv/Config.in +5 -0
index c3b7535..92a1306 100644
@@ -194,6 +194,19 @@ comment "gstreamer-0.10 support needs a toolchain w/ wchar, threads"
 	depends on BR2_USE_MMU
 	depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS
 
+config BR2_PACKAGE_OPENCV_WITH_GSTREAMER1
+	bool "gstreamer-1.x"
+	depends on BR2_USE_MMU # libglib2
+	depends on BR2_USE_WCHAR # libglib2
+	depends on BR2_TOOLCHAIN_HAS_THREADS # libglib2

I would have used the "gst -> libglib2" trail in the comment because, again, we're not selecting libglib2, but gst-1, so it's weid to see the dependency being explained because of libglib2...

[--SNIP--]

package/opencv/opencv.mk else · line 227

Quoted 11 lines
package/opencv/opencv.mk +3 -0
index 633c2bf..6b1a139 100644
@@ -222,11 +222,18 @@ else
 OPENCV_CONF_OPTS += -DWITH_FFMPEG=OFF
 endif
 
+ifeq ($(BR2_PACKAGE_OPENCV_WITH_GSTREAMER)$(BR2_PACKAGE_OPENCV_WITH_GSTREAMER1),)
+OPENCV_CONF_OPTS += -DWITH_GSTREAMER=OFF -DWITH_GSTREAMER_0_10=OFF
+endif

Why do you split this out, rather than have each be defined in the else clause of each if-block?

AFAICS, GST and GST_0_10 are mutually exclusive (i.e. when one is ON, the other is OFF) :

package/opencv/opencv.mk else · line 230

Quoted 3 lines
package/opencv/opencv.mk +1 -1
 ifeq ($(BR2_PACKAGE_OPENCV_WITH_GSTREAMER),y)
-OPENCV_CONF_OPTS += -DWITH_GSTREAMER=ON -DWITH_GSTREAMER_0_10=ON
+OPENCV_CONF_OPTS += -DWITH_GSTREAMER=OFF -DWITH_GSTREAMER_0_10=ON

... here: GST=OFFF and GST_0_10=ON ...

package/opencv/opencv.mk else · line 235

Quoted 7 lines
package/opencv/opencv.mk +4 -2
 OPENCV_DEPENDENCIES += gstreamer gst-plugins-base
-else
-OPENCV_CONF_OPTS += -DWITH_GSTREAMER=OFF -DWITH_GSTREAMER_0_10=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_OPENCV_WITH_GSTREAMER1),y)
+OPENCV_CONF_OPTS += -DWITH_GSTREAMER=ON -DWITH_GSTREAMER_0_10=OFF

... and here GST=ON and GST_0_10=OFF

package/opencv/opencv.mk else · line 237

Quoted 2 lines
package/opencv/opencv.mk +1 -0
+OPENCV_DEPENDENCIES += gstreamer1 gst1-plugins-base
 endif

So, I'd have written something like:

    ifeq ($(BR2_PKG_OCV_GST_0_10),y)
    OCV_CONF_OPTS += -DWITH_GST_0_10=ON
    OVC_DEPS += gst gst-plugins-base
    else
    OCV_CONF_OPTS += -DWITH_GST_0_10=OFF
    endif

    ifeq ($(BR2_PKG_OCV_GST),y)
    OCV_CONF_OPTS += -DWITH_GST=ON
    OVC_DEPS += gst-1 gst-1-plugins-base
    else
    OCV_CONF_OPTS += -DWITH_GST=OFF
    endif

(Sorry, I forgot to say so in my previous review... :-( )

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#5 lore raw

PATCH v7 2/7 package/opencv: add gstreamer-1.x support

Yann,

Quoted 19 lines · Yann E. MORIN

Samuel, All,

On 2015-07-04 21:06 +0200, Samuel Martin spake thusly:

Quoted 6 lines

Starting with the 2.4.10 release, OpenCV supports both Gstreamer-0.10 and Gstreamer-1, but only one can be enabled at the same time (OpenCV chooses Gstreamer-1 over Gstreamer-0.10 when both are available).

Cc "Yann E. MORIN" <[email protected]>

[--SNIP--]

Quoted 8 lines
package/opencv/Config.in +0 -0
index c3b7535..92a1306 100644
@@ -194,6 +194,19 @@ comment "gstreamer-0.10 support needs a toolchain w/ wchar, threads"
      depends on BR2_USE_MMU
      depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS
 
Quoted 9 lines

package/opencv/Config.in comment "gstreamer-0.10 support needs a toolchain w/ wchar, threads" · line 201

Quoted 5 lines
package/opencv/Config.in +5 -0
+config BR2_PACKAGE_OPENCV_WITH_GSTREAMER1
+     bool "gstreamer-1.x"
+     depends on BR2_USE_MMU # libglib2
+     depends on BR2_USE_WCHAR # libglib2
+     depends on BR2_TOOLCHAIN_HAS_THREADS # libglib2

I would have used the "gst -> libglib2" trail in the comment because, again, we're not selecting libglib2, but gst-1, so it's weid to see the dependency being explained because of libglib2...

done.

Quoted 26 lines

[--SNIP--]

package/opencv/opencv.mk else · line 227

Quoted 11 lines
package/opencv/opencv.mk +3 -0
index 633c2bf..6b1a139 100644
@@ -222,11 +222,18 @@ else
 OPENCV_CONF_OPTS += -DWITH_FFMPEG=OFF
 endif
 
+ifeq ($(BR2_PACKAGE_OPENCV_WITH_GSTREAMER)$(BR2_PACKAGE_OPENCV_WITH_GSTREAMER1),)
+OPENCV_CONF_OPTS += -DWITH_GSTREAMER=OFF -DWITH_GSTREAMER_0_10=OFF
+endif

Why do you split this out, rather than have each be defined in the else clause of each if-block?

AFAICS, GST and GST_0_10 are mutually exclusive (i.e. when one is ON, the other is OFF) :

package/opencv/opencv.mk else · line 230

Quoted 3 lines
package/opencv/opencv.mk +1 -1
 ifeq ($(BR2_PACKAGE_OPENCV_WITH_GSTREAMER),y)
-OPENCV_CONF_OPTS += -DWITH_GSTREAMER=ON -DWITH_GSTREAMER_0_10=ON
+OPENCV_CONF_OPTS += -DWITH_GSTREAMER=OFF -DWITH_GSTREAMER_0_10=ON

... here: GST=OFFF and GST_0_10=ON ...

Quoted 9 lines

package/opencv/opencv.mk else · line 235

Quoted 7 lines
package/opencv/opencv.mk +4 -2
 OPENCV_DEPENDENCIES += gstreamer gst-plugins-base
-else
-OPENCV_CONF_OPTS += -DWITH_GSTREAMER=OFF -DWITH_GSTREAMER_0_10=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_OPENCV_WITH_GSTREAMER1),y)
+OPENCV_CONF_OPTS += -DWITH_GSTREAMER=ON -DWITH_GSTREAMER_0_10=OFF

... and here GST=ON and GST_0_10=OFF

You're right! Just letf-over stuff from previous bump in which, to get gst-0.10 support, one has to do GST=ON and GST_0_10=ON.
I'm fixing this.

Quoted 20 lines

package/opencv/opencv.mk else · line 237

Quoted 3 lines
package/opencv/opencv.mk +1 -0
+OPENCV_DEPENDENCIES += gstreamer1 gst1-plugins-base
 endif

So, I'd have written something like:

    ifeq ($(BR2_PKG_OCV_GST_0_10),y)
    OCV_CONF_OPTS += -DWITH_GST_0_10=ON
    OVC_DEPS += gst gst-plugins-base
    else
    OCV_CONF_OPTS += -DWITH_GST_0_10=OFF
    endif

    ifeq ($(BR2_PKG_OCV_GST),y)
    OCV_CONF_OPTS += -DWITH_GST=ON
    OVC_DEPS += gst-1 gst-1-plugins-base
    else
    OCV_CONF_OPTS += -DWITH_GST=OFF
    endif
Quoted 1 line

(Sorry, I forgot to say so in my previous review... :-( )

no pb ;)

Quoted 11 lines

Regards,
Yann E. MORIN.

--
.-----------------.--------------------.------------------.--------------------.

|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |

'------------------------------^-------^------------------^--------------------'

Thanks,

Signature · 1 line
Samuel
#6 lore raw

PATCH v7 3/7 package/opencv: add a choice for selecting the gui toolkit

In reply to Samuel Martin

This patch moves the existing Qt4 and gtk2 options in that choice right after the highgui knob.
In OpenCV, only one GUI toolkik will be actually used at the time by the highgui module, given priority to Qt4.

---
changes v6->v7:
- move choice right after highgui knob (Yann)
- reword help text and comment (Yann)

changes v5->v6:
- new patch

---
 package/opencv/Config.in | 76 +++++++++++++++++++++++++++++++++---------------
 1 file changed, 53 insertions(+), 23 deletions(-)
package/opencv/Config.in +53 -23
index 92a1306..9479b35 100644
@@ -52,6 +52,59 @@ config BR2_PACKAGE_OPENCV_LIB_HIGHGUI
 	  Include opencv_highgui (high-level gui and media i/o) module into the
 	  OpenCV build.
 
+choice
+	prompt "gui toolkit"
+	depends on BR2_PACKAGE_OPENCV_LIB_HIGHGUI
+	help
+	  GUI toolkit for opencv_highgui module.
+
+	  The best toolkit to work with OpenCV are, in decreasing order of
+	  preference by the OpenCV build system):
+	  - Qt4
+	  - gtk2
+
+	  Note that, whatever you choose here will be used by OpenCV, even
+	  if you also enabled a more preferred toolkit in your Buildroot
+	  configuration.
+
+config BR2_PACKAGE_OPENCV_GUI_NONE
+	bool "none"
+
+config BR2_PACKAGE_OPENCV_WITH_GTK
+	bool "gtk2"
+	depends on BR2_ARCH_HAS_ATOMICS # libgtk2 -> cairo
+	depends on BR2_USE_MMU # libgtk2 -> libglib2
+	depends on BR2_USE_WCHAR # libgtk2 -> libglib2
+	depends on BR2_TOOLCHAIN_HAS_THREADS # libgtk2 -> libglib2
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_PACKAGE_XORG7
+	select BR2_PACKAGE_LIBGTK2
+
+comment "gtk2 needs X.org and a toolchain w/ wchar, threads, C++"
+	depends on BR2_USE_MMU # libgtk2 -> glib2
+	depends on BR2_ARCH_HAS_ATOMICS # libgtk2 -> cairo
+	depends on !BR2_PACKAGE_XORG7 || \
+		!BR2_USE_WCHAR || \
+		!BR2_TOOLCHAIN_HAS_THREADS || \
+		!BR2_INSTALL_LIBSTDCPP
+
+config BR2_PACKAGE_OPENCV_WITH_QT
+	bool "qt4"
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_USE_MMU # qt
+	select BR2_PACKAGE_QT
+	select BR2_PACKAGE_QT_STL
+	select BR2_PACKAGE_QT_GUI_MODULE
+	select BR2_PACKAGE_QT_TEST
+	help
+	  Use Qt with QtTest module and STL support
+
+comment "qt4 needs a toolchain w/ C++"
+	depends on BR2_USE_MMU # qt
+	depends on !BR2_INSTALL_LIBSTDCPP
+
+endchoice
+
 config BR2_PACKAGE_OPENCV_LIB_IMGCODECS
 	bool "imgcodecs"
 	select BR2_PACKAGE_OPENCV_LIB_IMGPROC
@@ -209,17 +262,6 @@ comment "gstreamer-1.x support needs a toolchain w/ wchar, threads"
 
 endchoice
 
-config BR2_PACKAGE_OPENCV_WITH_GTK
-	bool "gtk support"
-	depends on BR2_PACKAGE_XORG7
-	depends on BR2_USE_WCHAR # libgtk2 -> libglib2
-	depends on BR2_TOOLCHAIN_HAS_THREADS # libgtk2 -> libglib2
-	depends on BR2_INSTALL_LIBSTDCPP
-	depends on BR2_USE_MMU # libgtk2 -> glib2
-	depends on BR2_ARCH_HAS_ATOMICS # libgtk2 -> cairo
-	depends on BR2_PACKAGE_OPENCV_LIB_HIGHGUI
-	select BR2_PACKAGE_LIBGTK2
-
 config BR2_PACKAGE_OPENCV_WITH_JASPER
 	bool "jpeg2000 support"
 	select BR2_PACKAGE_JASPER
@@ -242,18 +284,6 @@ config BR2_PACKAGE_OPENCV_WITH_PNG
 	help
 	  Use shared libpng from the target system.
 
-config BR2_PACKAGE_OPENCV_WITH_QT
-	bool "qt backend support"
-	depends on BR2_INSTALL_LIBSTDCPP
-	depends on BR2_USE_MMU # qt
-	depends on BR2_PACKAGE_OPENCV_LIB_HIGHGUI
-	select BR2_PACKAGE_QT
-	select BR2_PACKAGE_QT_STL
-	select BR2_PACKAGE_QT_GUI_MODULE
-	select BR2_PACKAGE_QT_TEST
-	help
-	  Use Qt with QtTest module and STL support
-
 config BR2_PACKAGE_OPENCV_WITH_TIFF
 	bool "tiff support"
 	select BR2_PACKAGE_TIFF
Signature · 1 line
2.4.5
#7 lore raw

PATCH v7 3/7 package/opencv: add a choice for selecting the gui toolkit

Samuel, All,

On 2015-07-04 21:06 +0200, Samuel Martin spake thusly:

Quoted 7 lines

This patch moves the existing Qt4 and gtk2 options in that choice right after the highgui knob.
In OpenCV, only one GUI toolkik will be actually used at the time by the highgui module, given priority to Qt4.

Regards,
Yann E. MORIN.

Quoted 119 lines

---
changes v6->v7:
- move choice right after highgui knob (Yann)
- reword help text and comment (Yann)

changes v5->v6:
- new patch

---
 package/opencv/Config.in | 76 +++++++++++++++++++++++++++++++++---------------
 1 file changed, 53 insertions(+), 23 deletions(-)
package/opencv/Config.in +53 -23
index 92a1306..9479b35 100644
@@ -52,6 +52,59 @@ config BR2_PACKAGE_OPENCV_LIB_HIGHGUI
 	  Include opencv_highgui (high-level gui and media i/o) module into the
 	  OpenCV build.
 
+choice
+	prompt "gui toolkit"
+	depends on BR2_PACKAGE_OPENCV_LIB_HIGHGUI
+	help
+	  GUI toolkit for opencv_highgui module.
+
+	  The best toolkit to work with OpenCV are, in decreasing order of
+	  preference by the OpenCV build system):
+	  - Qt4
+	  - gtk2
+
+	  Note that, whatever you choose here will be used by OpenCV, even
+	  if you also enabled a more preferred toolkit in your Buildroot
+	  configuration.
+
+config BR2_PACKAGE_OPENCV_GUI_NONE
+	bool "none"
+
+config BR2_PACKAGE_OPENCV_WITH_GTK
+	bool "gtk2"
+	depends on BR2_ARCH_HAS_ATOMICS # libgtk2 -> cairo
+	depends on BR2_USE_MMU # libgtk2 -> libglib2
+	depends on BR2_USE_WCHAR # libgtk2 -> libglib2
+	depends on BR2_TOOLCHAIN_HAS_THREADS # libgtk2 -> libglib2
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_PACKAGE_XORG7
+	select BR2_PACKAGE_LIBGTK2
+
+comment "gtk2 needs X.org and a toolchain w/ wchar, threads, C++"
+	depends on BR2_USE_MMU # libgtk2 -> glib2
+	depends on BR2_ARCH_HAS_ATOMICS # libgtk2 -> cairo
+	depends on !BR2_PACKAGE_XORG7 || \
+		!BR2_USE_WCHAR || \
+		!BR2_TOOLCHAIN_HAS_THREADS || \
+		!BR2_INSTALL_LIBSTDCPP
+
+config BR2_PACKAGE_OPENCV_WITH_QT
+	bool "qt4"
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_USE_MMU # qt
+	select BR2_PACKAGE_QT
+	select BR2_PACKAGE_QT_STL
+	select BR2_PACKAGE_QT_GUI_MODULE
+	select BR2_PACKAGE_QT_TEST
+	help
+	  Use Qt with QtTest module and STL support
+
+comment "qt4 needs a toolchain w/ C++"
+	depends on BR2_USE_MMU # qt
+	depends on !BR2_INSTALL_LIBSTDCPP
+
+endchoice
+
 config BR2_PACKAGE_OPENCV_LIB_IMGCODECS
 	bool "imgcodecs"
 	select BR2_PACKAGE_OPENCV_LIB_IMGPROC
@@ -209,17 +262,6 @@ comment "gstreamer-1.x support needs a toolchain w/ wchar, threads"
 
 endchoice
 
-config BR2_PACKAGE_OPENCV_WITH_GTK
-	bool "gtk support"
-	depends on BR2_PACKAGE_XORG7
-	depends on BR2_USE_WCHAR # libgtk2 -> libglib2
-	depends on BR2_TOOLCHAIN_HAS_THREADS # libgtk2 -> libglib2
-	depends on BR2_INSTALL_LIBSTDCPP
-	depends on BR2_USE_MMU # libgtk2 -> glib2
-	depends on BR2_ARCH_HAS_ATOMICS # libgtk2 -> cairo
-	depends on BR2_PACKAGE_OPENCV_LIB_HIGHGUI
-	select BR2_PACKAGE_LIBGTK2
-
 config BR2_PACKAGE_OPENCV_WITH_JASPER
 	bool "jpeg2000 support"
 	select BR2_PACKAGE_JASPER
@@ -242,18 +284,6 @@ config BR2_PACKAGE_OPENCV_WITH_PNG
 	help
 	  Use shared libpng from the target system.
 
-config BR2_PACKAGE_OPENCV_WITH_QT
-	bool "qt backend support"
-	depends on BR2_INSTALL_LIBSTDCPP
-	depends on BR2_USE_MMU # qt
-	depends on BR2_PACKAGE_OPENCV_LIB_HIGHGUI
-	select BR2_PACKAGE_QT
-	select BR2_PACKAGE_QT_STL
-	select BR2_PACKAGE_QT_GUI_MODULE
-	select BR2_PACKAGE_QT_TEST
-	help
-	  Use Qt with QtTest module and STL support
-
 config BR2_PACKAGE_OPENCV_WITH_TIFF
 	bool "tiff support"
 	select BR2_PACKAGE_TIFF
Signature · 6 lines
2.4.5

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#8 lore raw

PATCH v7 4/7 package/opencv: add qt5 support

In reply to Samuel Martin

Starting with the 2.4.6 release, OpenCV supports both Qt4 and Qt5 as GUI toolkit, but only one can be enabled at the same time.

Since Buildroot does not support Qt4/Qt5 co-existence, we make the Qt4 knob depend on BR2_PACKAGE_QT5.

Note that we usually use 'select ...' to express the dependencies between packages, but in this case, we cannot since the Qt4/Qt5 co-existence exclusion is not handled by a simple choice, but by some extra dependencies in the choice entries. This makes impossible using 'select ...' for the Qt support knob without triggering a circular dependency at the kconfig level.

Besides, we already use 'depends on ...' to express the dependencies with some "big" packages (like xorg or libgtk2). qt or qt5* packages are fairly big. So, I don't think it will hurt that much to use a 'depends on ...' statement in this case.

Cc "Yann E. MORIN" <[email protected]>

---
changes v6->v7:
- fix depends on statements and comments (Yann)

changes v5->v6:
- bury BR2_avr32 remains (Yann)
- move knob in a choice (Yann)
- reword commit log

changes v4->v5:
- rebase

changes v3->v4:
- rebase
- rename _OPT -> _OPTS options
- rework qt backend selection (Yann)

changes v2->v3:
- rebase
- remove duplicate qt/qt5 dependencies (Yann)
- add missing 'depends on' to the comment about qt4

changes v1->v2:
- rebase
- update threads support dependency for qt5

---
 package/opencv/Config.in | 31 +++++++++++++++++++++++++------
 package/opencv/opencv.mk | 11 +++++++++--
 2 files changed, 34 insertions(+), 8 deletions(-)
package/opencv/Config.in +25 -6
index 9479b35..7bd11cf 100644
@@ -60,6 +60,7 @@ choice
 
 	  The best toolkit to work with OpenCV are, in decreasing order of
 	  preference by the OpenCV build system):
+	  - Qt5
 	  - Qt4
 	  - gtk2
 
@@ -90,18 +91,36 @@ comment "gtk2 needs X.org and a toolchain w/ wchar, threads, C++"
 
 config BR2_PACKAGE_OPENCV_WITH_QT
 	bool "qt4"
-	depends on BR2_INSTALL_LIBSTDCPP
-	depends on BR2_USE_MMU # qt
-	select BR2_PACKAGE_QT
+	depends on BR2_PACKAGE_QT
 	select BR2_PACKAGE_QT_STL
 	select BR2_PACKAGE_QT_GUI_MODULE
 	select BR2_PACKAGE_QT_TEST
 	help
-	  Use Qt with QtTest module and STL support
+	  Use Qt4 with QtTest and QtGui modules and STL support, as GUI toolkit.
+
+# no need for a comment about qt availability WRT the toolchain dependencies
+# because they are included in the opencv's ones, so already met.
 
-comment "qt4 needs a toolchain w/ C++"
+comment "qt4 support needs qt"
 	depends on BR2_USE_MMU # qt
-	depends on !BR2_INSTALL_LIBSTDCPP
+	depends on !BR2_PACKAGE_QT && !BR2_PACKAGE_QT5
+
+config BR2_PACKAGE_OPENCV_WITH_QT5
+	bool "qt5"
+	depends on BR2_PACKAGE_QT5
+	select BR2_PACKAGE_QT5BASE
+	select BR2_PACKAGE_QT5BASE_CONCURRENT
+	select BR2_PACKAGE_QT5BASE_GUI
+	select BR2_PACKAGE_QT5BASE_WIDGETS
+	help
+	  Use Qt5 with base, concurrent, test, gui and widgets components, as GUI
+	  toolkit.
+
+# no need for a comment about qt5 availability WRT the toolchain dependencies
+# because they are included in the opencv's ones, so already met.
+
+comment "qt5 support needs qt5"
+	depends on !BR2_PACKAGE_QT && !BR2_PACKAGE_QT5
 
 endchoice
 
package/opencv/opencv.mk +9 -2
index 6b1a139..79cf110 100644
@@ -266,11 +266,18 @@ else
 OPENCV_CONF_OPTS += -DWITH_PNG=OFF
 endif
 
+ifeq ($(BR2_PACKAGE_OPENCV_WITH_QT)$(BR2_PACKAGE_OPENCV_WITH_QT5),)
+OPENCV_CONF_OPTS += -DWITH_QT=OFF
+endif
+
 ifeq ($(BR2_PACKAGE_OPENCV_WITH_QT),y)
 OPENCV_CONF_OPTS += -DWITH_QT=4
 OPENCV_DEPENDENCIES += qt
-else
-OPENCV_CONF_OPTS += -DWITH_QT=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_OPENCV_WITH_QT5),y)
+OPENCV_CONF_OPTS += -DWITH_QT=5
+OPENCV_DEPENDENCIES += qt5base
 endif
 
 ifeq ($(BR2_PACKAGE_OPENCV_WITH_TIFF),y)
Signature · 1 line
2.4.5
#9 lore raw

PATCH v7 4/7 package/opencv: add qt5 support

Samuel, All,

On 2015-07-04 21:06 +0200, Samuel Martin spake thusly:

Quoted 13 lines

Starting with the 2.4.6 release, OpenCV supports both Qt4 and Qt5 as GUI toolkit, but only one can be enabled at the same time.

Since Buildroot does not support Qt4/Qt5 co-existence, we make the Qt4 knob depend on BR2_PACKAGE_QT5.

Note that we usually use 'select ...' to express the dependencies between packages, but in this case, we cannot since the Qt4/Qt5 co-existence exclusion is not handled by a simple choice, but by some extra dependencies in the choice entries. This makes impossible using 'select ...' for the Qt support knob without triggering a circular dependency at the kconfig level.

Quoted 7 lines

Besides, we already use 'depends on ...' to express the dependencies with some "big" packages (like xorg or libgtk2). qt or qt5* packages are fairly big. So, I don't think it will hurt that much to use a 'depends on ...' statement in this case.

Cc "Yann E. MORIN" <[email protected]>

Regards,
Yann E. MORIN.

Quoted 113 lines

---
changes v6->v7:
- fix depends on statements and comments (Yann)

changes v5->v6:
- bury BR2_avr32 remains (Yann)
- move knob in a choice (Yann)
- reword commit log

changes v4->v5:
- rebase

changes v3->v4:
- rebase
- rename _OPT -> _OPTS options
- rework qt backend selection (Yann)

changes v2->v3:
- rebase
- remove duplicate qt/qt5 dependencies (Yann)
- add missing 'depends on' to the comment about qt4

changes v1->v2:
- rebase
- update threads support dependency for qt5

---
 package/opencv/Config.in | 31 +++++++++++++++++++++++++------
 package/opencv/opencv.mk | 11 +++++++++--
 2 files changed, 34 insertions(+), 8 deletions(-)
package/opencv/Config.in +25 -6
index 9479b35..7bd11cf 100644
@@ -60,6 +60,7 @@ choice
 
 	  The best toolkit to work with OpenCV are, in decreasing order of
 	  preference by the OpenCV build system):
+	  - Qt5
 	  - Qt4
 	  - gtk2
 
@@ -90,18 +91,36 @@ comment "gtk2 needs X.org and a toolchain w/ wchar, threads, C++"
 
 config BR2_PACKAGE_OPENCV_WITH_QT
 	bool "qt4"
-	depends on BR2_INSTALL_LIBSTDCPP
-	depends on BR2_USE_MMU # qt
-	select BR2_PACKAGE_QT
+	depends on BR2_PACKAGE_QT
 	select BR2_PACKAGE_QT_STL
 	select BR2_PACKAGE_QT_GUI_MODULE
 	select BR2_PACKAGE_QT_TEST
 	help
-	  Use Qt with QtTest module and STL support
+	  Use Qt4 with QtTest and QtGui modules and STL support, as GUI toolkit.
+
+# no need for a comment about qt availability WRT the toolchain dependencies
+# because they are included in the opencv's ones, so already met.
 
-comment "qt4 needs a toolchain w/ C++"
+comment "qt4 support needs qt"
 	depends on BR2_USE_MMU # qt
-	depends on !BR2_INSTALL_LIBSTDCPP
+	depends on !BR2_PACKAGE_QT && !BR2_PACKAGE_QT5
+
+config BR2_PACKAGE_OPENCV_WITH_QT5
+	bool "qt5"
+	depends on BR2_PACKAGE_QT5
+	select BR2_PACKAGE_QT5BASE
+	select BR2_PACKAGE_QT5BASE_CONCURRENT
+	select BR2_PACKAGE_QT5BASE_GUI
+	select BR2_PACKAGE_QT5BASE_WIDGETS
+	help
+	  Use Qt5 with base, concurrent, test, gui and widgets components, as GUI
+	  toolkit.
+
+# no need for a comment about qt5 availability WRT the toolchain dependencies
+# because they are included in the opencv's ones, so already met.
+
+comment "qt5 support needs qt5"
+	depends on !BR2_PACKAGE_QT && !BR2_PACKAGE_QT5
 
 endchoice
 
package/opencv/opencv.mk +9 -2
index 6b1a139..79cf110 100644
@@ -266,11 +266,18 @@ else
 OPENCV_CONF_OPTS += -DWITH_PNG=OFF
 endif
 
+ifeq ($(BR2_PACKAGE_OPENCV_WITH_QT)$(BR2_PACKAGE_OPENCV_WITH_QT5),)
+OPENCV_CONF_OPTS += -DWITH_QT=OFF
+endif
+
 ifeq ($(BR2_PACKAGE_OPENCV_WITH_QT),y)
 OPENCV_CONF_OPTS += -DWITH_QT=4
 OPENCV_DEPENDENCIES += qt
-else
-OPENCV_CONF_OPTS += -DWITH_QT=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_OPENCV_WITH_QT5),y)
+OPENCV_CONF_OPTS += -DWITH_QT=5
+OPENCV_DEPENDENCIES += qt5base
 endif
 
 ifeq ($(BR2_PACKAGE_OPENCV_WITH_TIFF),y)
Signature · 1 line
2.4.5
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#10 lore raw

PATCH v7 5/7 package/opencv: add gtk3 support

In reply to Samuel Martin

Fully rework the GTK support in OpenCV because it now supports gtk-2 and gtk-3 (but only one at the time).
Note that, in the build-system, the gtk support is only available when Qt support is disabled; so make sure the menuconfig reflects this.

---
changes v6->v7:
- update A/R/T tags
- rebase

changes v5->v6:
- update a/r/t tags
- remove unneeded "default ..." (Yann)

changes v4->v5:
- new patch

---
 package/opencv/Config.in | 16 ++++++++++++++++
 package/opencv/opencv.mk | 11 +++++++++--
 2 files changed, 25 insertions(+), 2 deletions(-)
package/opencv/Config.in +16 -0
index 7bd11cf..e54d436 100644
@@ -62,6 +62,7 @@ choice
 	  preference by the OpenCV build system):
 	  - Qt5
 	  - Qt4
+	  - gtk3
 	  - gtk2
 
 	  Note that, whatever you choose here will be used by OpenCV, even
@@ -89,6 +90,21 @@ comment "gtk2 needs X.org and a toolchain w/ wchar, threads, C++"
 		!BR2_TOOLCHAIN_HAS_THREADS || \
 		!BR2_INSTALL_LIBSTDCPP
 
+config BR2_PACKAGE_OPENCV_WITH_GTK3
+	bool "gtk3"
+	depends on BR2_ARCH_HAS_ATOMICS # libgtk3 -> cairo
+	depends on BR2_USE_MMU # libgtk3 -> libglib2
+	depends on BR2_USE_WCHAR # libgtk3 -> libglib2
+	depends on BR2_TOOLCHAIN_HAS_THREADS # libgtk3 -> libglib2
+	depends on BR2_INSTALL_LIBSTDCPP
+	select BR2_PACKAGE_LIBGTK3
+
+comment "gtk3 needs a toolchain w/ wchar, threads, C++"
+	depends on BR2_USE_MMU # libgtk3 -> glib2
+	depends on BR2_ARCH_HAS_ATOMICS # libgtk3 -> cairo
+	depends on !(BR2_USE_WCHAR || BR2_TOOLCHAIN_HAS_THREADS || \
+		BR2_INSTALL_LIBSTDCPP)
+
 config BR2_PACKAGE_OPENCV_WITH_QT
 	bool "qt4"
 	depends on BR2_PACKAGE_QT
package/opencv/opencv.mk +9 -2
index 79cf110..986e7b4 100644
@@ -236,11 +236,18 @@ OPENCV_CONF_OPTS += -DWITH_GSTREAMER=ON -DWITH_GSTREAMER_0_10=OFF
 OPENCV_DEPENDENCIES += gstreamer1 gst1-plugins-base
 endif
 
+ifeq ($(BR2_PACKAGE_OPENCV_WITH_GTK)$(BR2_PACKAGE_OPENCV_WITH_GTK3),)
+OPENCV_CONF_OPTS += -DWITH_GTK=OFF -DWITH_GTK_2_X=OFF
+endif
+
 ifeq ($(BR2_PACKAGE_OPENCV_WITH_GTK),y)
 OPENCV_CONF_OPTS += -DWITH_GTK=ON -DWITH_GTK_2_X=ON
 OPENCV_DEPENDENCIES += libgtk2
-else
-OPENCV_CONF_OPTS += -DWITH_GTK=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_OPENCV_WITH_GTK3),y)
+OPENCV_CONF_OPTS += -DWITH_GTK=ON -DWITH_GTK_2_X=OFF
+OPENCV_DEPENDENCIES += libgtk3
 endif
 
 ifeq ($(BR2_PACKAGE_OPENCV_WITH_JASPER),y)
Signature · 1 line
2.4.5
#11 lore raw

PATCH v7 5/7 package/opencv: add gtk3 support

Samuel, All,

On 2015-07-04 21:06 +0200, Samuel Martin spake thusly:

Quoted 6 lines

Fully rework the GTK support in OpenCV because it now supports gtk-2 and gtk-3 (but only one at the time).
Note that, in the build-system, the gtk support is only available when Qt support is disabled; so make sure the menuconfig reflects this.

[--SNIP--]

Quoted 5 lines
package/opencv/opencv.mk +0 -0
index 79cf110..986e7b4 100644

package/opencv/opencv.mk OPENCV_CONF_OPTS += -DWITH_GSTREAMER=ON -DWITH_GSTREAMER_0_10=OFF · line 244

Quoted 9 lines
package/opencv/opencv.mk +4 -0
@@ -236,11 +236,18 @@ OPENCV_CONF_OPTS += -DWITH_GSTREAMER=ON -DWITH_GSTREAMER_0_10=OFF
 OPENCV_DEPENDENCIES += gstreamer1 gst1-plugins-base
 endif
 
+ifeq ($(BR2_PACKAGE_OPENCV_WITH_GTK)$(BR2_PACKAGE_OPENCV_WITH_GTK3),)
+OPENCV_CONF_OPTS += -DWITH_GTK=OFF -DWITH_GTK_2_X=OFF
+endif
+
 ifeq ($(BR2_PACKAGE_OPENCV_WITH_GTK),y)
 OPENCV_CONF_OPTS += -DWITH_GTK=ON -DWITH_GTK_2_X=ON

So here, this is unlike the GST case, where we need GTK=ON whenever we want to have gtk support, which is gtk3 by default, unless GTK_2=ON is also specified, in which case it's gtk2.

Right?

If so:

    Reviewed-by: "Yann E. MORIN" <[email protected]>

Regards,
Yann E. MORIN.

Quoted 18 lines
package/opencv/opencv.mk +5 -2
 OPENCV_DEPENDENCIES += libgtk2
-else
-OPENCV_CONF_OPTS += -DWITH_GTK=OFF
+endif
+
+ifeq ($(BR2_PACKAGE_OPENCV_WITH_GTK3),y)
+OPENCV_CONF_OPTS += -DWITH_GTK=ON -DWITH_GTK_2_X=OFF
+OPENCV_DEPENDENCIES += libgtk3
 endif
 
 ifeq ($(BR2_PACKAGE_OPENCV_WITH_JASPER),y)
Signature · 6 lines
2.4.5

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#12 lore raw

PATCH v7 5/7 package/opencv: add gtk3 support

Yann,

Quoted 30 lines · Yann E. MORIN

Samuel, All,

On 2015-07-04 21:06 +0200, Samuel Martin spake thusly:

Quoted 6 lines

Fully rework the GTK support in OpenCV because it now supports gtk-2 and gtk-3 (but only one at the time).
Note that, in the build-system, the gtk support is only available when Qt support is disabled; so make sure the menuconfig reflects this.

[--SNIP--]

Quoted 5 lines
package/opencv/opencv.mk +0 -0
index 79cf110..986e7b4 100644

package/opencv/opencv.mk OPENCV_CONF_OPTS += -DWITH_GSTREAMER=ON -DWITH_GSTREAMER_0_10=OFF · line 244

Quoted 9 lines
package/opencv/opencv.mk +4 -0
@@ -236,11 +236,18 @@ OPENCV_CONF_OPTS += -DWITH_GSTREAMER=ON -DWITH_GSTREAMER_0_10=OFF
 OPENCV_DEPENDENCIES += gstreamer1 gst1-plugins-base
 endif
 
+ifeq ($(BR2_PACKAGE_OPENCV_WITH_GTK)$(BR2_PACKAGE_OPENCV_WITH_GTK3),)
+OPENCV_CONF_OPTS += -DWITH_GTK=OFF -DWITH_GTK_2_X=OFF
+endif
+
 ifeq ($(BR2_PACKAGE_OPENCV_WITH_GTK),y)
 OPENCV_CONF_OPTS += -DWITH_GTK=ON -DWITH_GTK_2_X=ON

So here, this is unlike the GST case, where we need GTK=ON whenever we want to have gtk support, which is gtk3 by default, unless GTK_2=ON is also specified, in which case it's gtk2.

Quoted 1 line

Right?

Exactly.

Quoted 4 lines

If so:

    Reviewed-by: "Yann E. MORIN" <[email protected]>

Thanks,

Signature · 1 line
Samuel
#13 lore raw

PATCH v7 6/7 package/opencv: add opengl support

In reply to Samuel Martin

In OpenCV, OpenGL is only used by highgui module.

OpenGL support is done using extensions from 3rd party framework: either Qt5OpenGL with Qt5 (with GL support only, not GLES); or gtkglext (which is not available in Buildroot) with gtk2

So, make OpenGL knob a sub-option of the Qt5 support option.

---
changes v6->v7:
- rework comment as sugessted by Yann
- move opengl option close to the gui toolkit choice

changes v5->v6:
- update comments (Yann)

changes v4->v5:
- new patch

---
 package/opencv/Config.in | 22 +++++++++++++++++++++-
 package/opencv/opencv.mk |  7 +++++++
 2 files changed, 28 insertions(+), 1 deletion(-)
package/opencv/Config.in +21 -1
index e54d436..7912a1a 100644
@@ -52,9 +52,10 @@ config BR2_PACKAGE_OPENCV_LIB_HIGHGUI
 	  Include opencv_highgui (high-level gui and media i/o) module into the
 	  OpenCV build.
 
+if BR2_PACKAGE_OPENCV_LIB_HIGHGUI
+
 choice
 	prompt "gui toolkit"
-	depends on BR2_PACKAGE_OPENCV_LIB_HIGHGUI
 	help
 	  GUI toolkit for opencv_highgui module.
 
@@ -140,6 +141,25 @@ comment "qt5 support needs qt5"
 
 endchoice
 
+config BR2_PACKAGE_OPENCV_WITH_OPENGL
+	bool "opengl support"
+	# OpenGL support done using Qt5OpenGL, so depends on WITH_QT5
+	depends on BR2_PACKAGE_OPENCV_WITH_QT5
+	# OpenGL support requires Qt5OpenGL with GL support, not GLES
+	depends on BR2_PACKAGE_QT5_GL_AVAILABLE
+	depends on BR2_PACKAGE_HAS_LIBGL
+	select BR2_PACKAGE_QT5BASE_OPENGL
+	help
+	  Enable OpenGL for UI.
+
+comment "opengl support needs an OpenGL provider"
+	depends on BR2_PACKAGE_OPENCV_WITH_QT5
+	depends on !BR2_PACKAGE_QT5_GL_AVAILABLE || \
+		!BR2_PACKAGE_HAS_LIBGL
+
+endif # BR2_PACKAGE_OPENCV_LIB_HIGHGUI
+
+
 config BR2_PACKAGE_OPENCV_LIB_IMGCODECS
 	bool "imgcodecs"
 	select BR2_PACKAGE_OPENCV_LIB_IMGPROC
package/opencv/opencv.mk +7 -0
index 986e7b4..61a3ccd 100644
@@ -264,6 +264,13 @@ else
 OPENCV_CONF_OPTS += -DWITH_JPEG=OFF
 endif
 
+ifeq ($(BR2_PACKAGE_OPENCV_WITH_OPENGL),y)
+OPENCV_CONF_OPTS += -DWITH_OPENGL=ON
+OPENCV_DEPENDENCIES += libgl qt5base
+else
+OPENCV_CONF_OPTS += -DWITH_OPENGL=OFF
+endif
+
 OPENCV_CONF_OPTS += -DWITH_OPENMP=$(if $(BR2_GCC_ENABLE_OPENMP),ON,OFF)
 
 ifeq ($(BR2_PACKAGE_OPENCV_WITH_PNG),y)
Signature · 1 line
2.4.5
#14 lore raw

PATCH v7 6/7 package/opencv: add opengl support

Samuel, All,

On 2015-07-04 21:07 +0200, Samuel Martin spake thusly:

Quoted 9 lines

In OpenCV, OpenGL is only used by highgui module.

OpenGL support is done using extensions from 3rd party framework: either Qt5OpenGL with Qt5 (with GL support only, not GLES); or gtkglext (which is not available in Buildroot) with gtk2

So, make OpenGL knob a sub-option of the Qt5 support option.

[--SNIP--]

package/opencv/opencv.mk else · line 269

Quoted 11 lines
package/opencv/opencv.mk +3 -0
index 986e7b4..61a3ccd 100644
@@ -264,6 +264,13 @@ else
 OPENCV_CONF_OPTS += -DWITH_JPEG=OFF
 endif
 
+ifeq ($(BR2_PACKAGE_OPENCV_WITH_OPENGL),y)
+OPENCV_CONF_OPTS += -DWITH_OPENGL=ON
+OPENCV_DEPENDENCIES += libgl qt5base

No need for qt5base here, since gl is already conditional to Qt5.

With that fixed:

    Reviewed-by: "Yann E. MORIN" <[email protected]>

Regards,
Yann E. MORIN.

Quoted 14 lines
package/opencv/opencv.mk +4 -0
+else
+OPENCV_CONF_OPTS += -DWITH_OPENGL=OFF
+endif
+
 OPENCV_CONF_OPTS += -DWITH_OPENMP=$(if $(BR2_GCC_ENABLE_OPENMP),ON,OFF)
 
 ifeq ($(BR2_PACKAGE_OPENCV_WITH_PNG),y)
Signature · 6 lines
2.4.5

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#15 lore raw

PATCH v7 7/7 package/vlc: add opencv support

In reply to Samuel Martin

This change adds 2 patches (backported from upstream) to vlc fixing the build against opencv2 APIs.
This allows to select the minimal set of opencv modules when opencv support is enabled.

---
changes v5->v6:
- update a/r/t tags
- add backport url (Yann)

changes v4->v5:
- new patch

---
 ...opencv_wrapper-use-opencv2-style-includes.patch | 36 ++++++++++++++++++++++
 ...cv_example-add-missing-include-statements.patch | 29 +++++++++++++++++
 package/vlc/Config.in                              |  2 ++
 package/vlc/vlc.mk                                 |  8 ++++-
 4 files changed, 74 insertions(+), 1 deletion(-)
 create mode 100644 package/vlc/0008-opencv_wrapper-use-opencv2-style-includes.patch
 create mode 100644 package/vlc/0009-opencv_example-add-missing-include-statements.patch
package/vlc/0008-opencv_wrapper-use-opencv2-style-includes.patch new file +36 -0
new file mode 100644
index 0000000..0ce0206
@@ -0,0 +1,36 @@
+Backport from: https://git.videolan.org/?p=vlc.git;a=commit;h=cc236e4652255902f2c2cee3b18f83367f35a8c7
+
+From cc236e4652255902f2c2cee3b18f83367f35a8c7 Mon Sep 17 00:00:00 2001
+From: Samuel Martin <[email protected]>
+Date: Sun, 24 May 2015 14:30:09 +0200
+Subject: [PATCH 8/9] opencv_wrapper: use opencv2-style includes
+
+If old opencv1-style legacy include directory is available, this change
+becomes purely cosmetic (maybe will compile a bit faster).
+It becomes an FTBFS fix when opencv1-style include directory is missing
+(i.e. from opencv-3.0).
+
+Signed-off-by: Samuel Martin <[email protected]>
+Signed-off-by: Jean-Baptiste Kempf <[email protected]>
+---
+ modules/video_filter/opencv_wrapper.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/modules/video_filter/opencv_wrapper.c b/modules/video_filter/opencv_wrapper.c
+index e36e1a5..5d74241 100644
+--- a/modules/video_filter/opencv_wrapper.c
++++ b/modules/video_filter/opencv_wrapper.c
+@@ -39,8 +39,8 @@
+ #include <vlc_image.h>
+ #include "filter_picture.h"
+ 
+-#include <cxcore.h>
+-#include <cv.h>
++#include <opencv2/core/core_c.h>
++#include <opencv2/core/types_c.h>
+ 
+ /*****************************************************************************
+  * Local prototypes
+-- 
+2.4.2
+
package/vlc/0009-opencv_example-add-missing-include-statements.patch new file +29 -0
new file mode 100644
index 0000000..7b7f727
@@ -0,0 +1,29 @@
+Backport from: https://git.videolan.org/?p=vlc.git;a=commit;h=b82416d7000a993b33e903095a590fe32212a85e
+
+From b82416d7000a993b33e903095a590fe32212a85e Mon Sep 17 00:00:00 2001
+From: Samuel Martin <[email protected]>
+Date: Sun, 24 May 2015 14:30:10 +0200
+Subject: [PATCH 9/9] opencv_example: add missing #include statements
+
+Signed-off-by: Samuel Martin <[email protected]>
+Signed-off-by: Jean-Baptiste Kempf <[email protected]>
+---
+ modules/video_filter/opencv_example.cpp | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/modules/video_filter/opencv_example.cpp b/modules/video_filter/opencv_example.cpp
+index ae3af05..998f286 100644
+--- a/modules/video_filter/opencv_example.cpp
++++ b/modules/video_filter/opencv_example.cpp
+@@ -41,6 +41,8 @@
+ 
+ #include <opencv2/core/core_c.h>
+ #include <opencv2/core/core.hpp>
++#include <opencv2/imgproc/imgproc_c.h>
++#include <opencv2/imgproc/imgproc.hpp>
+ #include <opencv2/objdetect/objdetect.hpp>
+ 
+ /*****************************************************************************
+-- 
+2.4.2
+
package/vlc/Config.in +2 -0
index b030a56..471f4a7 100644
@@ -11,6 +11,8 @@ config BR2_PACKAGE_VLC
 	depends on BR2_TOOLCHAIN_HAS_THREADS
 	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_7
 	select BR2_PACKAGE_LIBVORBIS if BR2_PACKAGE_OPUS
+	select BR2_PACKAGE_OPENCV_LIB_IMGPROC if BR2_PACKAGE_OPENCV
+	select BR2_PACKAGE_OPENCV_LIB_OBJDETECT if BR2_PACKAGE_OPENCV
 	help
 	  VLC is a free and open source cross-platform multimedia player
 	  and framework that plays most multimedia files as well as DVD,
package/vlc/vlc.mk +7 -1
index 4ef69aa..a553648 100644
@@ -44,7 +44,6 @@ VLC_CONF_OPTS += \
 	--disable-projectm \
 	--disable-vsxu \
 	--disable-mtp \
-	--disable-opencv \
 	--disable-mmal-codec \
 	--disable-mmal-vout \
 	--disable-dvdnav \
@@ -148,6 +147,13 @@ else
 VLC_CONF_OPTS += --disable-gles2
 endif
 
+ifeq ($(BR2_PACKAGE_OPENCV),y)
+VLC_CONF_OPTS += --enable-opencv
+VLC_DEPENDENCIES += opencv
+else
+VLC_CONF_OPTS += --disable-opencv
+endif
+
 ifeq ($(BR2_PACKAGE_OPUS),y)
 VLC_CONF_OPTS += --enable-opus
 VLC_DEPENDENCIES += libvorbis opus
Signature · 1 line
2.4.5
#16 lore raw

PATCH v7 7/7 package/vlc: add opencv support

Samuel, all,

On 2015-07-04 21:07 +0200, Samuel Martin spake thusly:

Quoted 7 lines

This change adds 2 patches (backported from upstream) to vlc fixing the build against opencv2 APIs.
This allows to select the minimal set of opencv modules when opencv support is enabled.

This reviewd tag stands, still I have a question:

package/vlc/Config.in config BR2_PACKAGE_VLC · line 15

Quoted 10 lines
package/vlc/Config.in +2 -0
index b030a56..471f4a7 100644
@@ -11,6 +11,8 @@ config BR2_PACKAGE_VLC
 	depends on BR2_TOOLCHAIN_HAS_THREADS
 	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_7
 	select BR2_PACKAGE_LIBVORBIS if BR2_PACKAGE_OPUS
+	select BR2_PACKAGE_OPENCV_LIB_IMGPROC if BR2_PACKAGE_OPENCV
+	select BR2_PACKAGE_OPENCV_LIB_OBJDETECT if BR2_PACKAGE_OPENCV

objdetect already selects imgproc. So, does vlc w/ opencv really need imgproc by itself? If so, the select is OK, otherwise, it is superfluous.

Regards,
Yann E. MORIN.

Quoted 36 lines
package/vlc/Config.in +0 -0
 	help
 	  VLC is a free and open source cross-platform multimedia player
 	  and framework that plays most multimedia files as well as DVD,
package/vlc/vlc.mk +7 -1
index 4ef69aa..a553648 100644
@@ -44,7 +44,6 @@ VLC_CONF_OPTS += \
 	--disable-projectm \
 	--disable-vsxu \
 	--disable-mtp \
-	--disable-opencv \
 	--disable-mmal-codec \
 	--disable-mmal-vout \
 	--disable-dvdnav \
@@ -148,6 +147,13 @@ else
 VLC_CONF_OPTS += --disable-gles2
 endif
 
+ifeq ($(BR2_PACKAGE_OPENCV),y)
+VLC_CONF_OPTS += --enable-opencv
+VLC_DEPENDENCIES += opencv
+else
+VLC_CONF_OPTS += --disable-opencv
+endif
+
 ifeq ($(BR2_PACKAGE_OPUS),y)
 VLC_CONF_OPTS += --enable-opus
 VLC_DEPENDENCIES += libvorbis opus
Signature · 6 lines
2.4.5

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#17 lore raw

PATCH v7 7/7 package/vlc: add opencv support

Yann,

Quoted 13 lines · Yann E. MORIN

Samuel, all,

On 2015-07-04 21:07 +0200, Samuel Martin spake thusly:

Quoted 7 lines

This change adds 2 patches (backported from upstream) to vlc fixing the build against opencv2 APIs.
This allows to select the minimal set of opencv modules when opencv support is enabled.

This reviewd tag stands, still I have a question:

Quoted 14 lines

package/vlc/Config.in config BR2_PACKAGE_VLC · line 15

Quoted 10 lines
package/vlc/Config.in +2 -0
index b030a56..471f4a7 100644
@@ -11,6 +11,8 @@ config BR2_PACKAGE_VLC
      depends on BR2_TOOLCHAIN_HAS_THREADS
      depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_7
      select BR2_PACKAGE_LIBVORBIS if BR2_PACKAGE_OPUS
+     select BR2_PACKAGE_OPENCV_LIB_IMGPROC if BR2_PACKAGE_OPENCV
+     select BR2_PACKAGE_OPENCV_LIB_OBJDETECT if BR2_PACKAGE_OPENCV

objdetect already selects imgproc. So, does vlc w/ opencv really need imgproc by itself? If so, the select is OK, otherwise, it is superfluous.

I select all opencv's modules used in the vlc code-base [1].

[1] http://git.videolan.org/gitweb.cgi/vlc.git/?p=vlc.git;a=blob;f=modules/video_filter/opencv_example.cpp;h=998f286ba2269fdf1680b375c1f849d24598742d;hb=HEAD#l42

Regards,

Signature · 1 line
Samuel