]> git.pld-linux.org Git - packages/opencv.git/blob - opencv-ffmpeg-0.8.patch
- added gcc patch (fixes build with gcc 4.6)
[packages/opencv.git] / opencv-ffmpeg-0.8.patch
1 --- OpenCV-2.2.0/modules/highgui/src/cap_ffmpeg.cpp.orig        2010-12-05 04:35:25.000000000 +0100
2 +++ OpenCV-2.2.0/modules/highgui/src/cap_ffmpeg.cpp     2011-06-29 16:24:22.527412497 +0200
3 @@ -466,7 +466,7 @@
4          AVCodecContext *enc = &ic->streams[i]->codec;
5  #endif
6  
7 -        if( CODEC_TYPE_VIDEO == enc->codec_type && video_stream < 0) {
8 +        if( AVMEDIA_TYPE_VIDEO == enc->codec_type && video_stream < 0) {
9              AVCodec *codec = avcodec_find_decoder(enc->codec_id);
10              if (!codec ||
11              avcodec_open(enc, codec) < 0)
12 @@ -551,9 +551,16 @@
13                 }
14  
15  #if LIBAVFORMAT_BUILD > 4628
16 -        avcodec_decode_video(video_st->codec,
17 +       {
18 +       AVPacket avpkt;
19 +       av_init_packet(&avpkt);
20 +       avpkt.data = packet.data;
21 +       avpkt.size = packet.size;
22 +       avpkt.flags = AV_PKT_FLAG_KEY;
23 +        avcodec_decode_video2(video_st->codec,
24                               picture, &got_picture,
25 -                             packet.data, packet.size);
26 +                             &avpkt);
27 +       }
28  #else
29          avcodec_decode_video(&video_st->codec,
30                               picture, &got_picture,
31 @@ -806,15 +813,15 @@
32  static const char * icvFFMPEGErrStr(int err)
33  {
34      switch(err) {
35 -    case AVERROR_NUMEXPECTED:
36 +    case AVERROR(EINVAL):
37                 return "Incorrect filename syntax";
38      case AVERROR_INVALIDDATA:
39                 return "Invalid data in header";
40 -    case AVERROR_NOFMT:
41 +    case AVERROR(EILSEQ):
42                 return "Unknown format";
43 -    case AVERROR_IO:
44 +    case AVERROR(EIO):
45                 return "I/O error occurred";
46 -    case AVERROR_NOMEM:
47 +    case AVERROR(ENOMEM):
48                 return "Memory allocation error";
49      default:
50                 break;
51 @@ -899,7 +906,7 @@
52  #endif
53  
54  #if LIBAVFORMAT_BUILD > 4621
55 -       c->codec_id = av_guess_codec(oc->oformat, NULL, oc->filename, NULL, CODEC_TYPE_VIDEO);
56 +       c->codec_id = av_guess_codec(oc->oformat, NULL, oc->filename, NULL, AVMEDIA_TYPE_VIDEO);
57  #else
58         c->codec_id = oc->oformat->video_codec;
59  #endif
60 @@ -911,7 +918,7 @@
61      //if(codec_tag) c->codec_tag=codec_tag;
62         codec = avcodec_find_encoder(c->codec_id);
63  
64 -       c->codec_type = CODEC_TYPE_VIDEO;
65 +       c->codec_type = AVMEDIA_TYPE_VIDEO;
66  
67         /* put sample parameters */
68         c->bit_rate = bitrate;
69 @@ -998,7 +1005,7 @@
70          AVPacket pkt;
71          av_init_packet(&pkt);
72  
73 -        pkt.flags |= PKT_FLAG_KEY;
74 +        pkt.flags |= AV_PKT_FLAG_KEY;
75          pkt.stream_index= video_st->index;
76          pkt.data= (uint8_t *)picture;
77          pkt.size= sizeof(AVPicture);
78 @@ -1018,7 +1025,7 @@
79                         pkt.pts = c->coded_frame->pts;
80  #endif
81              if(c->coded_frame->key_frame)
82 -                pkt.flags |= PKT_FLAG_KEY;
83 +                pkt.flags |= AV_PKT_FLAG_KEY;
84              pkt.stream_index= video_st->index;
85              pkt.data= outbuf;
86              pkt.size= out_size;
87 @@ -1215,7 +1222,7 @@
88         av_register_all ();
89  
90         /* auto detect the output format from the name and fourcc code. */
91 -       fmt = guess_format(NULL, filename, NULL);
92 +       fmt = av_guess_format(NULL, filename, NULL);
93         if (!fmt)
94          return false;
95  
96 @@ -1238,7 +1245,7 @@
97  #endif
98  
99      // alloc memory for context
100 -       oc = av_alloc_format_context();
101 +       oc = avformat_alloc_context();
102         assert (oc);
103  
104         /* set file name */
This page took 0.052582 seconds and 3 git commands to generate.