packages: opencv/opencv.spec, opencv/opencv-ffmpeg-0.8.patch (NEW), opencv/...

qboosh qboosh at pld-linux.org
Wed Jun 29 18:59:58 CEST 2011


Author: qboosh                       Date: Wed Jun 29 16:59:58 2011 GMT
Module: packages                      Tag: HEAD
---- Log message:
- added gcc patch (fixes build with gcc 4.6)
- added ffmpeg-0.8 patch (ffmpeg API updates)
- disable all v4l support by default for now (V4L2 code heavily depends on V4L1 being enabled)

---- Files affected:
packages/opencv:
   opencv.spec (1.27 -> 1.28) , opencv-ffmpeg-0.8.patch (NONE -> 1.1)  (NEW), opencv-gcc.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/opencv/opencv.spec
diff -u packages/opencv/opencv.spec:1.27 packages/opencv/opencv.spec:1.28
--- packages/opencv/opencv.spec:1.27	Mon Jun 27 21:22:16 2011
+++ packages/opencv/opencv.spec	Wed Jun 29 18:59:52 2011
@@ -7,6 +7,7 @@
 %bcond_with	qt		# Qt backend instead of GTK+
 %bcond_with	tbb		# Threading Building Blocks support
 %bcond_with	unicap		# Unicap support (GPL)
+%bcond_with	v4l		# Video4Linux (even V4L2 support currently relies on V4L1 API)
 %bcond_with	xine		# XINE support (GPL)
 #
 Summary:	A library of programming functions mainly aimed at real time computer vision
@@ -28,13 +29,15 @@
 Patch2:		%{name}-link.patch
 Patch3:		%{name}-unicap-c++.patch
 Patch4:		%{name}-c.patch
+Patch5:		%{name}-gcc.patch
+Patch6:		%{name}-ffmpeg-0.8.patch
 URL:		http://opencv.willowgarage.com/
 %{?with_pvapi:BuildRequires:	AVT_GigE_SDK-devel}
 BuildRequires:	OpenEXR-devel
 BuildRequires:	cmake >= 2.4
 BuildRequires:	doxygen
 BuildRequires:	eigen >= 2
-BuildRequires:	ffmpeg-devel
+BuildRequires:	ffmpeg-devel >= 0.6
 %if %{with gstreamer}
 BuildRequires:	gstreamer-devel >= 0.10
 BuildRequires:	gstreamer-plugins-base-devel >= 0.10
@@ -141,6 +144,8 @@
 %patch2 -p1
 %patch3 -p1
 %patch4 -p1
+%patch5 -p1
+%patch6 -p1
 
 %build
 install -d build
@@ -162,6 +167,7 @@
 	%{?with_qt:-DWITH_QT=ON -DWITH_QT_OPENGL=ON -DQT_QMAKE_EXECUTABLE=/usr/bin/qmake-qt4} \
 	%{?with_tbb:-DWITH_TBB=ON} \
 	%{?with_unicap:-DWITH_UNICAP=ON} \
+	%{!?with_v4l:-DWITH_V4L=OFF} \
 	%{?with_xine:-DWITH_XINE=ON}
 
 %{__make}
@@ -214,6 +220,11 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.28  2011/06/29 16:59:52  qboosh
+- added gcc patch (fixes build with gcc 4.6)
+- added ffmpeg-0.8 patch (ffmpeg API updates)
+- disable all v4l support by default for now (V4L2 code heavily depends on V4L1 being enabled)
+
 Revision 1.27  2011/06/27 19:22:16  arekm
 - release 8
 

================================================================
Index: packages/opencv/opencv-ffmpeg-0.8.patch
diff -u /dev/null packages/opencv/opencv-ffmpeg-0.8.patch:1.1
--- /dev/null	Wed Jun 29 18:59:58 2011
+++ packages/opencv/opencv-ffmpeg-0.8.patch	Wed Jun 29 18:59:52 2011
@@ -0,0 +1,104 @@
+--- OpenCV-2.2.0/modules/highgui/src/cap_ffmpeg.cpp.orig	2010-12-05 04:35:25.000000000 +0100
++++ OpenCV-2.2.0/modules/highgui/src/cap_ffmpeg.cpp	2011-06-29 16:24:22.527412497 +0200
+@@ -466,7 +466,7 @@
+         AVCodecContext *enc = &ic->streams[i]->codec;
+ #endif
+ 
+-        if( CODEC_TYPE_VIDEO == enc->codec_type && video_stream < 0) {
++        if( AVMEDIA_TYPE_VIDEO == enc->codec_type && video_stream < 0) {
+             AVCodec *codec = avcodec_find_decoder(enc->codec_id);
+             if (!codec ||
+             avcodec_open(enc, codec) < 0)
+@@ -551,9 +551,16 @@
+     		}
+ 
+ #if LIBAVFORMAT_BUILD > 4628
+-        avcodec_decode_video(video_st->codec,
++	{
++	AVPacket avpkt;
++	av_init_packet(&avpkt);
++	avpkt.data = packet.data;
++	avpkt.size = packet.size;
++	avpkt.flags = AV_PKT_FLAG_KEY;
++        avcodec_decode_video2(video_st->codec,
+                              picture, &got_picture,
+-                             packet.data, packet.size);
++                             &avpkt);
++	}
+ #else
+         avcodec_decode_video(&video_st->codec,
+                              picture, &got_picture,
+@@ -806,15 +813,15 @@
+ static const char * icvFFMPEGErrStr(int err)
+ {
+     switch(err) {
+-    case AVERROR_NUMEXPECTED:
++    case AVERROR(EINVAL):
+ 		return "Incorrect filename syntax";
+     case AVERROR_INVALIDDATA:
+ 		return "Invalid data in header";
+-    case AVERROR_NOFMT:
++    case AVERROR(EILSEQ):
+ 		return "Unknown format";
+-    case AVERROR_IO:
++    case AVERROR(EIO):
+ 		return "I/O error occurred";
+-    case AVERROR_NOMEM:
++    case AVERROR(ENOMEM):
+ 		return "Memory allocation error";
+     default:
+ 		break;
+@@ -899,7 +906,7 @@
+ #endif
+ 
+ #if LIBAVFORMAT_BUILD > 4621
+-	c->codec_id = av_guess_codec(oc->oformat, NULL, oc->filename, NULL, CODEC_TYPE_VIDEO);
++	c->codec_id = av_guess_codec(oc->oformat, NULL, oc->filename, NULL, AVMEDIA_TYPE_VIDEO);
+ #else
+ 	c->codec_id = oc->oformat->video_codec;
+ #endif
+@@ -911,7 +918,7 @@
+     //if(codec_tag) c->codec_tag=codec_tag;
+ 	codec = avcodec_find_encoder(c->codec_id);
+ 
+-	c->codec_type = CODEC_TYPE_VIDEO;
++	c->codec_type = AVMEDIA_TYPE_VIDEO;
+ 
+ 	/* put sample parameters */
+ 	c->bit_rate = bitrate;
+@@ -998,7 +1005,7 @@
+         AVPacket pkt;
+         av_init_packet(&pkt);
+ 
+-        pkt.flags |= PKT_FLAG_KEY;
++        pkt.flags |= AV_PKT_FLAG_KEY;
+         pkt.stream_index= video_st->index;
+         pkt.data= (uint8_t *)picture;
+         pkt.size= sizeof(AVPicture);
+@@ -1018,7 +1025,7 @@
+ 			pkt.pts = c->coded_frame->pts;
+ #endif
+             if(c->coded_frame->key_frame)
+-                pkt.flags |= PKT_FLAG_KEY;
++                pkt.flags |= AV_PKT_FLAG_KEY;
+             pkt.stream_index= video_st->index;
+             pkt.data= outbuf;
+             pkt.size= out_size;
+@@ -1215,7 +1222,7 @@
+ 	av_register_all ();
+ 
+ 	/* auto detect the output format from the name and fourcc code. */
+-	fmt = guess_format(NULL, filename, NULL);
++	fmt = av_guess_format(NULL, filename, NULL);
+ 	if (!fmt)
+         return false;
+ 
+@@ -1238,7 +1245,7 @@
+ #endif
+ 
+     // alloc memory for context
+-	oc = av_alloc_format_context();
++	oc = avformat_alloc_context();
+ 	assert (oc);
+ 
+ 	/* set file name */

================================================================
Index: packages/opencv/opencv-gcc.patch
diff -u /dev/null packages/opencv/opencv-gcc.patch:1.1
--- /dev/null	Wed Jun 29 18:59:58 2011
+++ packages/opencv/opencv-gcc.patch	Wed Jun 29 18:59:52 2011
@@ -0,0 +1,10 @@
+--- OpenCV-2.2.0/modules/core/include/opencv2/core/core.hpp.orig	2010-12-05 04:35:24.000000000 +0100
++++ OpenCV-2.2.0/modules/core/include/opencv2/core/core.hpp	2011-06-28 21:14:32.258435783 +0200
+@@ -56,6 +56,7 @@
+ #include <algorithm>
+ #include <cmath>
+ #include <complex>
++#include <cstddef>
+ #include <map>
+ #include <new>
+ #include <string>
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/opencv/opencv.spec?r1=1.27&r2=1.28&f=u



More information about the pld-cvs-commit mailing list