1 |
commit: 18360ae24794a90e4bf9910298cdab551fcdb250 |
2 |
Author: Andreas K. Huettel (dilfridge) <mail <AT> akhuettel <DOT> de> |
3 |
AuthorDate: Sat Apr 30 17:10:34 2011 +0000 |
4 |
Commit: Andreas K. Huettel <dilfridge <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Apr 30 17:10:34 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/kde.git;a=commit;h=18360ae2 |
7 |
|
8 |
[media-libs/opencv] Convert upstream patches to sane line endings |
9 |
|
10 |
(Portage version: 2.1.9.46/git/Linux x86_64, RepoMan options: --force, signed Manifest commit with key B6C5F7DE) |
11 |
|
12 |
--- |
13 |
media-libs/opencv/files/2.2.0-ffmpeg01.patch | 209 +++++++++++++------------ |
14 |
media-libs/opencv/files/2.2.0-ffmpeg02.patch | 115 +++++++------- |
15 |
media-libs/opencv/files/2.2.0-libpng1.5.patch | 79 +++++----- |
16 |
3 files changed, 203 insertions(+), 200 deletions(-) |
17 |
|
18 |
diff --git a/media-libs/opencv/files/2.2.0-ffmpeg01.patch b/media-libs/opencv/files/2.2.0-ffmpeg01.patch |
19 |
index 4a5392f..bfde3a9 100644 |
20 |
--- a/media-libs/opencv/files/2.2.0-ffmpeg01.patch |
21 |
+++ b/media-libs/opencv/files/2.2.0-ffmpeg01.patch |
22 |
@@ -1,104 +1,105 @@ |
23 |
-Index: D:/WaterWATCH/dev/opencv/modules/highgui/src/cap_ffmpeg.cpp |
24 |
-=================================================================== |
25 |
---- D:/WaterWATCH/dev/opencv/modules/highgui/src/cap_ffmpeg.cpp (revision 2112) |
26 |
-+++ D:/WaterWATCH/dev/opencv/modules/highgui/src/cap_ffmpeg.cpp (revision 2113) |
27 |
-@@ -466,7 +466,7 @@ |
28 |
- AVCodecContext *enc = &ic->streams[i]->codec; |
29 |
- #endif |
30 |
- |
31 |
-- if( CODEC_TYPE_VIDEO == enc->codec_type && video_stream < 0) { |
32 |
-+ if( AVMEDIA_TYPE_VIDEO == enc->codec_type && video_stream < 0) { |
33 |
- AVCodec *codec = avcodec_find_decoder(enc->codec_id); |
34 |
- if (!codec || |
35 |
- avcodec_open(enc, codec) < 0) |
36 |
-@@ -550,15 +550,27 @@ |
37 |
- continue; |
38 |
- } |
39 |
- |
40 |
--#if LIBAVFORMAT_BUILD > 4628 |
41 |
-- avcodec_decode_video(video_st->codec, |
42 |
-- picture, &got_picture, |
43 |
-- packet.data, packet.size); |
44 |
--#else |
45 |
-- avcodec_decode_video(&video_st->codec, |
46 |
-- picture, &got_picture, |
47 |
-- packet.data, packet.size); |
48 |
--#endif |
49 |
-+ |
50 |
-+ AVPacket avpkt; |
51 |
-+ av_init_packet(&avpkt); |
52 |
-+ avpkt.data = packet.data; |
53 |
-+ avpkt.size = packet.size; |
54 |
-+ // |
55 |
-+ // HACK for CorePNG to decode as normal PNG by default |
56 |
-+ // same method used by ffmpeg |
57 |
-+ avpkt.flags = AV_PKT_FLAG_KEY; |
58 |
-+ avcodec_decode_video2(video_st->codec, |
59 |
-+ picture, &got_picture, &avpkt); |
60 |
-+//Functions Removed from ffmpeg on 4/19/11 |
61 |
-+//#if LIBAVFORMAT_BUILD > 4628 |
62 |
-+// avcodec_decode_video(video_st->codec, |
63 |
-+// picture, &got_picture, |
64 |
-+// packet.data, packet.size); |
65 |
-+//#else |
66 |
-+// avcodec_decode_video(&video_st->codec, |
67 |
-+// picture, &got_picture, |
68 |
-+// packet.data, packet.size); |
69 |
-+//#endif |
70 |
- |
71 |
- if (got_picture) { |
72 |
- // we have a new picture, so memorize it |
73 |
-@@ -899,7 +911,7 @@ |
74 |
- #endif |
75 |
- |
76 |
- #if LIBAVFORMAT_BUILD > 4621 |
77 |
-- c->codec_id = av_guess_codec(oc->oformat, NULL, oc->filename, NULL, CODEC_TYPE_VIDEO); |
78 |
-+ c->codec_id = av_guess_codec(oc->oformat, NULL, oc->filename, NULL, AVMEDIA_TYPE_VIDEO); |
79 |
- #else |
80 |
- c->codec_id = oc->oformat->video_codec; |
81 |
- #endif |
82 |
-@@ -911,7 +923,7 @@ |
83 |
- //if(codec_tag) c->codec_tag=codec_tag; |
84 |
- codec = avcodec_find_encoder(c->codec_id); |
85 |
- |
86 |
-- c->codec_type = CODEC_TYPE_VIDEO; |
87 |
-+ c->codec_type = AVMEDIA_TYPE_VIDEO; |
88 |
- |
89 |
- /* put sample parameters */ |
90 |
- c->bit_rate = bitrate; |
91 |
-@@ -998,7 +1010,7 @@ |
92 |
- AVPacket pkt; |
93 |
- av_init_packet(&pkt); |
94 |
- |
95 |
-- pkt.flags |= PKT_FLAG_KEY; |
96 |
-+ pkt.flags |= AV_PKT_FLAG_KEY; |
97 |
- pkt.stream_index= video_st->index; |
98 |
- pkt.data= (uint8_t *)picture; |
99 |
- pkt.size= sizeof(AVPicture); |
100 |
-@@ -1018,7 +1030,7 @@ |
101 |
- pkt.pts = c->coded_frame->pts; |
102 |
- #endif |
103 |
- if(c->coded_frame->key_frame) |
104 |
-- pkt.flags |= PKT_FLAG_KEY; |
105 |
-+ pkt.flags |= AV_PKT_FLAG_KEY; |
106 |
- pkt.stream_index= video_st->index; |
107 |
- pkt.data= outbuf; |
108 |
- pkt.size= out_size; |
109 |
-@@ -1215,7 +1227,7 @@ |
110 |
- av_register_all (); |
111 |
- |
112 |
- /* auto detect the output format from the name and fourcc code. */ |
113 |
-- fmt = guess_format(NULL, filename, NULL); |
114 |
-+ fmt = av_guess_format(NULL, filename, NULL); |
115 |
- if (!fmt) |
116 |
- return false; |
117 |
- |
118 |
-@@ -1238,7 +1250,7 @@ |
119 |
- #endif |
120 |
- |
121 |
- // alloc memory for context |
122 |
-- oc = av_alloc_format_context(); |
123 |
-+ oc = avformat_alloc_context(); |
124 |
- assert (oc); |
125 |
- |
126 |
- /* set file name */ |
127 |
+ |
128 |
+Index: D:/WaterWATCH/dev/opencv/modules/highgui/src/cap_ffmpeg.cpp |
129 |
+=================================================================== |
130 |
+--- D:/WaterWATCH/dev/opencv/modules/highgui/src/cap_ffmpeg.cpp (revision 2112) |
131 |
++++ D:/WaterWATCH/dev/opencv/modules/highgui/src/cap_ffmpeg.cpp (revision 2113) |
132 |
+@@ -466,7 +466,7 @@ |
133 |
+ AVCodecContext *enc = &ic->streams[i]->codec; |
134 |
+ #endif |
135 |
+ |
136 |
+- if( CODEC_TYPE_VIDEO == enc->codec_type && video_stream < 0) { |
137 |
++ if( AVMEDIA_TYPE_VIDEO == enc->codec_type && video_stream < 0) { |
138 |
+ AVCodec *codec = avcodec_find_decoder(enc->codec_id); |
139 |
+ if (!codec || |
140 |
+ avcodec_open(enc, codec) < 0) |
141 |
+@@ -550,15 +550,27 @@ |
142 |
+ continue; |
143 |
+ } |
144 |
+ |
145 |
+-#if LIBAVFORMAT_BUILD > 4628 |
146 |
+- avcodec_decode_video(video_st->codec, |
147 |
+- picture, &got_picture, |
148 |
+- packet.data, packet.size); |
149 |
+-#else |
150 |
+- avcodec_decode_video(&video_st->codec, |
151 |
+- picture, &got_picture, |
152 |
+- packet.data, packet.size); |
153 |
+-#endif |
154 |
++ |
155 |
++ AVPacket avpkt; |
156 |
++ av_init_packet(&avpkt); |
157 |
++ avpkt.data = packet.data; |
158 |
++ avpkt.size = packet.size; |
159 |
++ // |
160 |
++ // HACK for CorePNG to decode as normal PNG by default |
161 |
++ // same method used by ffmpeg |
162 |
++ avpkt.flags = AV_PKT_FLAG_KEY; |
163 |
++ avcodec_decode_video2(video_st->codec, |
164 |
++ picture, &got_picture, &avpkt); |
165 |
++//Functions Removed from ffmpeg on 4/19/11 |
166 |
++//#if LIBAVFORMAT_BUILD > 4628 |
167 |
++// avcodec_decode_video(video_st->codec, |
168 |
++// picture, &got_picture, |
169 |
++// packet.data, packet.size); |
170 |
++//#else |
171 |
++// avcodec_decode_video(&video_st->codec, |
172 |
++// picture, &got_picture, |
173 |
++// packet.data, packet.size); |
174 |
++//#endif |
175 |
+ |
176 |
+ if (got_picture) { |
177 |
+ // we have a new picture, so memorize it |
178 |
+@@ -899,7 +911,7 @@ |
179 |
+ #endif |
180 |
+ |
181 |
+ #if LIBAVFORMAT_BUILD > 4621 |
182 |
+- c->codec_id = av_guess_codec(oc->oformat, NULL, oc->filename, NULL, CODEC_TYPE_VIDEO); |
183 |
++ c->codec_id = av_guess_codec(oc->oformat, NULL, oc->filename, NULL, AVMEDIA_TYPE_VIDEO); |
184 |
+ #else |
185 |
+ c->codec_id = oc->oformat->video_codec; |
186 |
+ #endif |
187 |
+@@ -911,7 +923,7 @@ |
188 |
+ //if(codec_tag) c->codec_tag=codec_tag; |
189 |
+ codec = avcodec_find_encoder(c->codec_id); |
190 |
+ |
191 |
+- c->codec_type = CODEC_TYPE_VIDEO; |
192 |
++ c->codec_type = AVMEDIA_TYPE_VIDEO; |
193 |
+ |
194 |
+ /* put sample parameters */ |
195 |
+ c->bit_rate = bitrate; |
196 |
+@@ -998,7 +1010,7 @@ |
197 |
+ AVPacket pkt; |
198 |
+ av_init_packet(&pkt); |
199 |
+ |
200 |
+- pkt.flags |= PKT_FLAG_KEY; |
201 |
++ pkt.flags |= AV_PKT_FLAG_KEY; |
202 |
+ pkt.stream_index= video_st->index; |
203 |
+ pkt.data= (uint8_t *)picture; |
204 |
+ pkt.size= sizeof(AVPicture); |
205 |
+@@ -1018,7 +1030,7 @@ |
206 |
+ pkt.pts = c->coded_frame->pts; |
207 |
+ #endif |
208 |
+ if(c->coded_frame->key_frame) |
209 |
+- pkt.flags |= PKT_FLAG_KEY; |
210 |
++ pkt.flags |= AV_PKT_FLAG_KEY; |
211 |
+ pkt.stream_index= video_st->index; |
212 |
+ pkt.data= outbuf; |
213 |
+ pkt.size= out_size; |
214 |
+@@ -1215,7 +1227,7 @@ |
215 |
+ av_register_all (); |
216 |
+ |
217 |
+ /* auto detect the output format from the name and fourcc code. */ |
218 |
+- fmt = guess_format(NULL, filename, NULL); |
219 |
++ fmt = av_guess_format(NULL, filename, NULL); |
220 |
+ if (!fmt) |
221 |
+ return false; |
222 |
+ |
223 |
+@@ -1238,7 +1250,7 @@ |
224 |
+ #endif |
225 |
+ |
226 |
+ // alloc memory for context |
227 |
+- oc = av_alloc_format_context(); |
228 |
++ oc = avformat_alloc_context(); |
229 |
+ assert (oc); |
230 |
+ |
231 |
+ /* set file name */ |
232 |
|
233 |
diff --git a/media-libs/opencv/files/2.2.0-ffmpeg02.patch b/media-libs/opencv/files/2.2.0-ffmpeg02.patch |
234 |
index a0c5787..00ee541 100644 |
235 |
--- a/media-libs/opencv/files/2.2.0-ffmpeg02.patch |
236 |
+++ b/media-libs/opencv/files/2.2.0-ffmpeg02.patch |
237 |
@@ -1,57 +1,58 @@ |
238 |
-Index: D:/WaterWATCH/dev/opencv/modules/highgui/src/cap_ffmpeg.cpp |
239 |
-=================================================================== |
240 |
---- D:/WaterWATCH/dev/opencv/modules/highgui/src/cap_ffmpeg.cpp (revision 2121) |
241 |
-+++ D:/WaterWATCH/dev/opencv/modules/highgui/src/cap_ffmpeg.cpp (revision 2122) |
242 |
-@@ -815,24 +815,25 @@ |
243 |
- #endif |
244 |
- }; |
245 |
- |
246 |
--static const char * icvFFMPEGErrStr(int err) |
247 |
--{ |
248 |
-- switch(err) { |
249 |
-- case AVERROR_NUMEXPECTED: |
250 |
-- return "Incorrect filename syntax"; |
251 |
-- case AVERROR_INVALIDDATA: |
252 |
-- return "Invalid data in header"; |
253 |
-- case AVERROR_NOFMT: |
254 |
-- return "Unknown format"; |
255 |
-- case AVERROR_IO: |
256 |
-- return "I/O error occurred"; |
257 |
-- case AVERROR_NOMEM: |
258 |
-- return "Memory allocation error"; |
259 |
-- default: |
260 |
-- break; |
261 |
-- } |
262 |
-- return "Unspecified error"; |
263 |
--} |
264 |
-+//Deprecated Errors, should be using AVERROR(EINVAL) to return error strings |
265 |
-+//static const char * icvFFMPEGErrStr(int err) |
266 |
-+//{ |
267 |
-+// switch(err) { |
268 |
-+// case AVERROR_NUMEXPECTED: |
269 |
-+// return "Incorrect filename syntax"; |
270 |
-+// case AVERROR_INVALIDDATA: |
271 |
-+// return "Invalid data in header"; |
272 |
-+// case AVERROR_NOFMT: |
273 |
-+// return "Unknown format"; |
274 |
-+// case AVERROR_IO: |
275 |
-+// return "I/O error occurred"; |
276 |
-+// case AVERROR_NOMEM: |
277 |
-+// return "Memory allocation error"; |
278 |
-+// default: |
279 |
-+// break; |
280 |
-+// } |
281 |
-+// return "Unspecified error"; |
282 |
-+//} |
283 |
- |
284 |
- /* function internal to FFMPEG (libavformat/riff.c) to lookup codec id by fourcc tag*/ |
285 |
- extern "C" { |
286 |
-@@ -1322,7 +1323,7 @@ |
287 |
- /* open the codec */ |
288 |
- if ( (err=avcodec_open(c, codec)) < 0) { |
289 |
- char errtext[256]; |
290 |
-- sprintf(errtext, "Could not open codec '%s': %s", codec->name, icvFFMPEGErrStr(err)); |
291 |
-+ sprintf(errtext, "Could not open codec '%s': %s", codec->name, AVERROR(EINVAL)); |
292 |
- CV_Error(CV_StsBadArg, errtext); |
293 |
- } |
294 |
- |
295 |
+ |
296 |
+Index: D:/WaterWATCH/dev/opencv/modules/highgui/src/cap_ffmpeg.cpp |
297 |
+=================================================================== |
298 |
+--- D:/WaterWATCH/dev/opencv/modules/highgui/src/cap_ffmpeg.cpp (revision 2121) |
299 |
++++ D:/WaterWATCH/dev/opencv/modules/highgui/src/cap_ffmpeg.cpp (revision 2122) |
300 |
+@@ -815,24 +815,25 @@ |
301 |
+ #endif |
302 |
+ }; |
303 |
+ |
304 |
+-static const char * icvFFMPEGErrStr(int err) |
305 |
+-{ |
306 |
+- switch(err) { |
307 |
+- case AVERROR_NUMEXPECTED: |
308 |
+- return "Incorrect filename syntax"; |
309 |
+- case AVERROR_INVALIDDATA: |
310 |
+- return "Invalid data in header"; |
311 |
+- case AVERROR_NOFMT: |
312 |
+- return "Unknown format"; |
313 |
+- case AVERROR_IO: |
314 |
+- return "I/O error occurred"; |
315 |
+- case AVERROR_NOMEM: |
316 |
+- return "Memory allocation error"; |
317 |
+- default: |
318 |
+- break; |
319 |
+- } |
320 |
+- return "Unspecified error"; |
321 |
+-} |
322 |
++//Deprecated Errors, should be using AVERROR(EINVAL) to return error strings |
323 |
++//static const char * icvFFMPEGErrStr(int err) |
324 |
++//{ |
325 |
++// switch(err) { |
326 |
++// case AVERROR_NUMEXPECTED: |
327 |
++// return "Incorrect filename syntax"; |
328 |
++// case AVERROR_INVALIDDATA: |
329 |
++// return "Invalid data in header"; |
330 |
++// case AVERROR_NOFMT: |
331 |
++// return "Unknown format"; |
332 |
++// case AVERROR_IO: |
333 |
++// return "I/O error occurred"; |
334 |
++// case AVERROR_NOMEM: |
335 |
++// return "Memory allocation error"; |
336 |
++// default: |
337 |
++// break; |
338 |
++// } |
339 |
++// return "Unspecified error"; |
340 |
++//} |
341 |
+ |
342 |
+ /* function internal to FFMPEG (libavformat/riff.c) to lookup codec id by fourcc tag*/ |
343 |
+ extern "C" { |
344 |
+@@ -1322,7 +1323,7 @@ |
345 |
+ /* open the codec */ |
346 |
+ if ( (err=avcodec_open(c, codec)) < 0) { |
347 |
+ char errtext[256]; |
348 |
+- sprintf(errtext, "Could not open codec '%s': %s", codec->name, icvFFMPEGErrStr(err)); |
349 |
++ sprintf(errtext, "Could not open codec '%s': %s", codec->name, AVERROR(EINVAL)); |
350 |
+ CV_Error(CV_StsBadArg, errtext); |
351 |
+ } |
352 |
+ |
353 |
|
354 |
diff --git a/media-libs/opencv/files/2.2.0-libpng1.5.patch b/media-libs/opencv/files/2.2.0-libpng1.5.patch |
355 |
index 1a99998..fce010d 100644 |
356 |
--- a/media-libs/opencv/files/2.2.0-libpng1.5.patch |
357 |
+++ b/media-libs/opencv/files/2.2.0-libpng1.5.patch |
358 |
@@ -1,39 +1,40 @@ |
359 |
-Index: /trunk/opencv/modules/highgui/src/grfmt_png.cpp |
360 |
-=================================================================== |
361 |
---- /trunk/opencv/modules/highgui/src/grfmt_png.cpp (revision 4337) |
362 |
-+++ /trunk/opencv/modules/highgui/src/grfmt_png.cpp (revision 4945) |
363 |
-@@ -108,5 +108,5 @@ |
364 |
- { |
365 |
- png_structp png_ptr = (png_structp)_png_ptr; |
366 |
-- PngDecoder* decoder = (PngDecoder*)(png_ptr->io_ptr); |
367 |
-+ PngDecoder* decoder = (PngDecoder*)(png_get_io_ptr(png_ptr)); |
368 |
- CV_Assert( decoder ); |
369 |
- const Mat& buf = decoder->m_buf; |
370 |
-@@ -139,5 +139,5 @@ |
371 |
- if( info_ptr && end_info ) |
372 |
- { |
373 |
-- if( setjmp( png_ptr->jmpbuf ) == 0 ) |
374 |
-+ if( setjmp( png_jmpbuf( png_ptr ) ) == 0 ) |
375 |
- { |
376 |
- if( !m_buf.empty() ) |
377 |
-@@ -201,5 +201,5 @@ |
378 |
- png_infop end_info = (png_infop)m_end_info; |
379 |
- |
380 |
-- if( setjmp(png_ptr->jmpbuf) == 0 ) |
381 |
-+ if( setjmp( png_jmpbuf ( png_ptr ) ) == 0 ) |
382 |
- { |
383 |
- int y; |
384 |
-@@ -285,5 +285,5 @@ |
385 |
- return; |
386 |
- png_structp png_ptr = (png_structp)_png_ptr; |
387 |
-- PngEncoder* encoder = (PngEncoder*)(png_ptr->io_ptr); |
388 |
-+ PngEncoder* encoder = (PngEncoder*)(png_get_io_ptr(png_ptr)); |
389 |
- CV_Assert( encoder && encoder->m_buf ); |
390 |
- size_t cursz = encoder->m_buf->size(); |
391 |
-@@ -327,5 +327,5 @@ |
392 |
- if( info_ptr ) |
393 |
- { |
394 |
-- if( setjmp( png_ptr->jmpbuf ) == 0 ) |
395 |
-+ if( setjmp( png_jmpbuf ( png_ptr ) ) == 0 ) |
396 |
- { |
397 |
- if( m_buf ) |
398 |
+ |
399 |
+Index: /trunk/opencv/modules/highgui/src/grfmt_png.cpp |
400 |
+=================================================================== |
401 |
+--- /trunk/opencv/modules/highgui/src/grfmt_png.cpp (revision 4337) |
402 |
++++ /trunk/opencv/modules/highgui/src/grfmt_png.cpp (revision 4945) |
403 |
+@@ -108,5 +108,5 @@ |
404 |
+ { |
405 |
+ png_structp png_ptr = (png_structp)_png_ptr; |
406 |
+- PngDecoder* decoder = (PngDecoder*)(png_ptr->io_ptr); |
407 |
++ PngDecoder* decoder = (PngDecoder*)(png_get_io_ptr(png_ptr)); |
408 |
+ CV_Assert( decoder ); |
409 |
+ const Mat& buf = decoder->m_buf; |
410 |
+@@ -139,5 +139,5 @@ |
411 |
+ if( info_ptr && end_info ) |
412 |
+ { |
413 |
+- if( setjmp( png_ptr->jmpbuf ) == 0 ) |
414 |
++ if( setjmp( png_jmpbuf( png_ptr ) ) == 0 ) |
415 |
+ { |
416 |
+ if( !m_buf.empty() ) |
417 |
+@@ -201,5 +201,5 @@ |
418 |
+ png_infop end_info = (png_infop)m_end_info; |
419 |
+ |
420 |
+- if( setjmp(png_ptr->jmpbuf) == 0 ) |
421 |
++ if( setjmp( png_jmpbuf ( png_ptr ) ) == 0 ) |
422 |
+ { |
423 |
+ int y; |
424 |
+@@ -285,5 +285,5 @@ |
425 |
+ return; |
426 |
+ png_structp png_ptr = (png_structp)_png_ptr; |
427 |
+- PngEncoder* encoder = (PngEncoder*)(png_ptr->io_ptr); |
428 |
++ PngEncoder* encoder = (PngEncoder*)(png_get_io_ptr(png_ptr)); |
429 |
+ CV_Assert( encoder && encoder->m_buf ); |
430 |
+ size_t cursz = encoder->m_buf->size(); |
431 |
+@@ -327,5 +327,5 @@ |
432 |
+ if( info_ptr ) |
433 |
+ { |
434 |
+- if( setjmp( png_ptr->jmpbuf ) == 0 ) |
435 |
++ if( setjmp( png_jmpbuf ( png_ptr ) ) == 0 ) |
436 |
+ { |
437 |
+ if( m_buf ) |