Skip to contentSkip to conversation

package/vlc: fix build with opencv3

PATCH Superseded Fabrice Fontaine 2 participants 5 messages Feb 28, 2020 – Mar 8, 2020

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/vlc: fix build with opencv3

Fixes:
- http://autobuild.buildroot.org/results/210424bd33f660aa0757f62a558e1e03faf0f371

---
 ...lter-opencv_example.cpp-fix-build-wi.patch | 38 +++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 package/vlc/0010-modules-video_filter-opencv_example.cpp-fix-build-wi.patch
package/vlc/0010-modules-video_filter-opencv_example.cpp-fix-build-wi.patch new file +38 -0
new file mode 100644
index 0000000000..04c9958298
@@ -0,0 +1,38 @@
+From 67244e60fc1d8c7a9350bac30611f56c398761e5 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <[email protected]>
+Date: Fri, 28 Feb 2020 14:29:47 +0100
+Subject: [PATCH] modules/video_filter/opencv_example.cpp: fix build with
+ opencv 3.4.9
+
+Convert CV_RGB to cvScalar to avoid the following build failure with
+opencv 3.4.9:
+
+In file included from /home/naourr/work/instance-2/output-1/host/x86_64-buildroot-linux-uclibc/sysroot/usr/include/opencv2/imgproc/imgproc.hpp:48,
+                 from video_filter/opencv_example.cpp:46:
+video_filter/opencv_example.cpp: In function 'picture_t* Filter(filter_t*, picture_t*)':
+video_filter/opencv_example.cpp:200:46: error: could not convert 'cv::Scalar_<double>((double)0, (double)0, (double)0, (double)0)' from 'cv::Scalar' {aka 'cv::Scalar_<double>'} to 'CvScalar'
+             cvRectangle( p_img[0], pt1, pt2, CV_RGB(0,0,0), 3, 8, 0 );
+                                              ^~~~~~
+
+Signed-off-by: Fabrice Fontaine <[email protected]>
+[Upstream status: sent to vlc-devel at videolan.org]
+---
+ modules/video_filter/opencv_example.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/modules/video_filter/opencv_example.cpp b/modules/video_filter/opencv_example.cpp
+index 1334cd4c36..292f24b257 100644
+--- a/modules/video_filter/opencv_example.cpp
++++ b/modules/video_filter/opencv_example.cpp
+@@ -202,7 +202,7 @@ static picture_t *Filter( filter_t *p_filter, picture_t *p_pic )
+             pt2.x = (r->x+r->width)*scale;
+             pt1.y = r->y*scale;
+             pt2.y = (r->y+r->height)*scale;
+-            cvRectangle( p_img[0], pt1, pt2, CV_RGB(0,0,0), 3, 8, 0 );
++            cvRectangle( p_img[0], pt1, pt2, cvScalar(CV_RGB(0,0,0)), 3, 8, 0 );
+ 
+             *(CvRect*)(&(p_sys->event_info.p_region[i])) = *r;
+             p_sys->event_info.p_region[i].i_id = p_sys->i_id++;
+-- 
+2.25.0
+
Signature · 1 line
2.25.0
#1 lore raw

PATCH 1/1 package/vlc: fix build with opencv3

Hello Fabrice,

Quoted 19 lines · On Fri, 28 Feb 2020 14:38:09 +0100 Fabrice Fontaine…

Fixes:
- http://autobuild.buildroot.org/results/210424bd33f660aa0757f62a558e1e03faf0f371

---
 ...lter-opencv_example.cpp-fix-build-wi.patch | 38 +++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 package/vlc/0010-modules-video_filter-opencv_example.cpp-fix-build-wi.patch
package/vlc/0010-modules-video_filter-opencv_example.cpp-fix-build-wi.patch new file +4 -0
new file mode 100644
index 0000000000..04c9958298
@@ -0,0 +1,38 @@
+From 67244e60fc1d8c7a9350bac30611f56c398761e5 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <[email protected]>
+Date: Fri, 28 Feb 2020 14:29:47 +0100
+Subject: [PATCH] modules/video_filter/opencv_example.cpp: fix build with

package/vlc/0010-modules-video_filter-opencv_example.cpp-fix-build-wi.patch line 14

Quoted 10 lines
package/vlc/0010-modules-video_filter-opencv_example.cpp-fix-build-wi.patch new file +10 -0
+ opencv 3.4.9
+
+Convert CV_RGB to cvScalar to avoid the following build failure with
+opencv 3.4.9:
+
+In file included from /home/naourr/work/instance-2/output-1/host/x86_64-buildroot-linux-uclibc/sysroot/usr/include/opencv2/imgproc/imgproc.hpp:48,
+                 from video_filter/opencv_example.cpp:46:
+video_filter/opencv_example.cpp: In function 'picture_t* Filter(filter_t*, picture_t*)':
+video_filter/opencv_example.cpp:200:46: error: could not convert 'cv::Scalar_<double>((double)0, (double)0, (double)0, (double)0)' from 'cv::Scalar' {aka 'cv::Scalar_<double>'} to 'CvScalar'
+             cvRectangle( p_img[0], pt1, pt2, CV_RGB(0,0,0), 3, 8, 0 );

Thanks for looking into this. I must say I don't feel very confident about the fix. Have you been able to trace which change in OpenCV caused this build issue ?

Also, is the fix still compatible with OpenCV 2.x ? Indeed, VLC requires OpenCV > 2.0, so I guess it can still work with some 2.x OpenCV version.

Have you considered talking with the OpenCV community to see what is the proper fix ?

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#2 lore raw

PATCH 1/1 package/vlc: fix build with opencv3

Hello Thomas,

Le dim. 8 mars 2020 ? 15:42, Thomas Petazzoni
<[email protected]> a ?crit :

Quoted 31 lines

Hello Fabrice,

Quoted 25 lines · On Fri, 28 Feb 2020 14:38:09 +0100 Fabrice Fontaine…

Fixes:
- http://autobuild.buildroot.org/results/210424bd33f660aa0757f62a558e1e03faf0f371

---
 ...lter-opencv_example.cpp-fix-build-wi.patch | 38 +++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 package/vlc/0010-modules-video_filter-opencv_example.cpp-fix-build-wi.patch
package/vlc/0010-modules-video_filter-opencv_example.cpp-fix-build-wi.patch new file +10 -0
new file mode 100644
index 0000000000..04c9958298
@@ -0,0 +1,38 @@
+From 67244e60fc1d8c7a9350bac30611f56c398761e5 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <[email protected]>
+Date: Fri, 28 Feb 2020 14:29:47 +0100
+Subject: [PATCH] modules/video_filter/opencv_example.cpp: fix build with
+ opencv 3.4.9
+
+Convert CV_RGB to cvScalar to avoid the following build failure with
+opencv 3.4.9:
+
+In file included from /home/naourr/work/instance-2/output-1/host/x86_64-buildroot-linux-uclibc/sysroot/usr/include/opencv2/imgproc/imgproc.hpp:48,
Quoted 8 lines

package/vlc/0010-modules-video_filter-opencv_example.cpp-fix-build-wi.patch line 14

Quoted 4 lines
package/vlc/0010-modules-video_filter-opencv_example.cpp-fix-build-wi.patch new file +4 -0
+                 from video_filter/opencv_example.cpp:46:
+video_filter/opencv_example.cpp: In function 'picture_t* Filter(filter_t*, picture_t*)':
+video_filter/opencv_example.cpp:200:46: error: could not convert 'cv::Scalar_<double>((double)0, (double)0, (double)0, (double)0)' from 'cv::Scalar' {aka 'cv::Scalar_<double>'} to 'CvScalar'
+             cvRectangle( p_img[0], pt1, pt2, CV_RGB(0,0,0), 3, 8, 0 );

Thanks for looking into this. I must say I don't feel very confident about the fix. Have you been able to trace which change in OpenCV caused this build issue ?

The issue is raised by
https://github.com/opencv/opencv/pull/11159/commits/7f9253ea0a9fe2635926379420002dbf0c3fce0f
which changed the CV_RGB definition from cvScalar to cv::Scalar however cvRectangle was not updated and still waits for a CvScalar color.
So, a better fix would be to remove the reference on CV_RGB and use directly cvScalar. I'll send a v2 if you agree that this is a better proposal.

Quoted 8 lines

Also, is the fix still compatible with OpenCV 2.x ? Indeed, VLC requires OpenCV > 2.0, so I guess it can still work with some 2.x OpenCV version.

Have you considered talking with the OpenCV community to see what is the proper fix ?

Quoted 7 lines

Thanks!

Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

Best Regards,

Fabrice

#3 lore raw

PATCH 1/1 package/vlc: fix build with opencv3

Hello,

Quoted 11 lines · On Sun, 8 Mar 2020 16:49:07 +0100 Fabrice Fontaine…
Quoted 3 lines

Thanks for looking into this. I must say I don't feel very confident about the fix. Have you been able to trace which change in OpenCV caused this build issue ?

The issue is raised by
https://github.com/opencv/opencv/pull/11159/commits/7f9253ea0a9fe2635926379420002dbf0c3fce0f
which changed the CV_RGB definition from cvScalar to cv::Scalar however cvRectangle was not updated and still waits for a CvScalar color.
So, a better fix would be to remove the reference on CV_RGB and use directly cvScalar. I'll send a v2 if you agree that this is a better proposal.

I don't really know what is the right way of fixing this. Have you paid attention to compatibility with OpenCV 2.x, if VLC can build with OpenCV 2.x ?

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#4 lore raw

PATCH 1/1 package/vlc: fix build with opencv3

Hello,

Le dim. 8 mars 2020 ? 22:28, Thomas Petazzoni
<[email protected]> a ?crit :

Quoted 18 lines

Hello,

Quoted 11 lines · On Sun, 8 Mar 2020 16:49:07 +0100 Fabrice Fontaine…
Quoted 3 lines

Thanks for looking into this. I must say I don't feel very confident about the fix. Have you been able to trace which change in OpenCV caused this build issue ?

The issue is raised by
https://github.com/opencv/opencv/pull/11159/commits/7f9253ea0a9fe2635926379420002dbf0c3fce0f
which changed the CV_RGB definition from cvScalar to cv::Scalar however cvRectangle was not updated and still waits for a CvScalar color.
So, a better fix would be to remove the reference on CV_RGB and use directly cvScalar. I'll send a v2 if you agree that this is a better proposal.

Quoted 3 lines

I don't really know what is the right way of fixing this. Have you paid attention to compatibility with OpenCV 2.x, if VLC can build with OpenCV 2.x ?

The second version is building fine with OpenCV 2.x which is not the case for the first one. So I'll send a v2.

Quoted 6 lines

Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

Best Regards,

Fabrice