--- /dev/null
+--- 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 */
%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
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
%patch2 -p1
%patch3 -p1
%patch4 -p1
+%patch5 -p1
+%patch6 -p1
%build
install -d build
%{?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}