Gentoo Archives: gentoo-commits

From: "Luca Barbato (lu_zero)" <lu_zero@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in media-gfx/blender/files: blender-2.49b-libav-0.7.patch
Date: Sun, 13 Nov 2011 07:20:06
Message-Id: 20111113071954.896982004C@flycatcher.gentoo.org
1 lu_zero 11/11/13 07:19:54
2
3 Added: blender-2.49b-libav-0.7.patch
4 Log:
5 Update blender-2.49b to support libav-0.7
6
7 (Portage version: 2.1.10.34/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 media-gfx/blender/files/blender-2.49b-libav-0.7.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-gfx/blender/files/blender-2.49b-libav-0.7.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-gfx/blender/files/blender-2.49b-libav-0.7.patch?rev=1.1&content-type=text/plain
14
15 Index: blender-2.49b-libav-0.7.patch
16 ===================================================================
17 diff -urN blender-2.49b.orig//source/blender/blenkernel/intern/writeffmpeg.c blender-2.49b/source/blender/blenkernel/intern/writeffmpeg.c
18 --- blender-2.49b.orig//source/blender/blenkernel/intern/writeffmpeg.c 2009-09-01 17:21:17.000000000 +0200
19 +++ blender-2.49b/source/blender/blenkernel/intern/writeffmpeg.c 2011-11-13 05:36:23.000000000 +0100
20 @@ -32,6 +32,7 @@
21 #include <libavformat/avformat.h>
22 #include <libavcodec/avcodec.h>
23 #include <libavutil/rational.h>
24 +#include <libavutil/mathematics.h>
25 #include <libswscale/swscale.h>
26 #include <libavcodec/opt.h>
27
28 @@ -149,10 +150,9 @@
29 #else
30 pkt.pts = c->coded_frame->pts;
31 #endif
32 - fprintf(stderr, "Audio Frame PTS: %lld\n", pkt.pts);
33
34 pkt.stream_index = audio_stream->index;
35 - pkt.flags |= PKT_FLAG_KEY;
36 + pkt.flags |= AV_PKT_FLAG_KEY;
37 if (av_interleaved_write_frame(outfile, &pkt) != 0) {
38 error("Error writing audio packet");
39 return -1;
40 @@ -271,7 +271,7 @@
41 fprintf(stderr, "Video Frame PTS: not set\n");
42 }
43 if (c->coded_frame->key_frame)
44 - packet.flags |= PKT_FLAG_KEY;
45 + packet.flags |= AV_PKT_FLAG_KEY;
46 packet.stream_index = video_stream->index;
47 packet.data = video_buffer;
48 packet.size = outsize;
49 @@ -373,7 +373,7 @@
50 switch(prop->type) {
51 case IDP_STRING:
52 fprintf(stderr, "%s.\n", IDP_String(prop));
53 - rv = av_set_string(c, prop->name, IDP_String(prop));
54 + av_set_string3(c, prop->name, IDP_String(prop), 0, &rv);
55 break;
56 case IDP_FLOAT:
57 fprintf(stderr, "%g.\n", IDP_Float(prop));
58 @@ -384,12 +384,12 @@
59
60 if (param) {
61 if (IDP_Int(prop)) {
62 - rv = av_set_string(c, name, param);
63 + av_set_string3(c, name, param, 0, &rv);
64 } else {
65 return;
66 }
67 } else {
68 - rv = av_set_int(c, prop->name, IDP_Int(prop));
69 + av_set_int(c, prop->name, IDP_Int(prop));
70 }
71 break;
72 }
73 @@ -438,7 +438,7 @@
74
75 c = get_codec_from_stream(st);
76 c->codec_id = codec_id;
77 - c->codec_type = CODEC_TYPE_VIDEO;
78 + c->codec_type = AVMEDIA_TYPE_VIDEO;
79
80
81 /* Get some values from the current render settings */
82 @@ -496,7 +496,7 @@
83 c->pix_fmt = PIX_FMT_YUV422P;
84 }
85
86 - if (codec_id == CODEC_ID_XVID) {
87 + if (codec_id == CODEC_ID_MPEG4) {
88 /* arghhhh ... */
89 c->pix_fmt = PIX_FMT_YUV420P;
90 }
91 @@ -557,7 +557,7 @@
92
93 c = get_codec_from_stream(st);
94 c->codec_id = codec_id;
95 - c->codec_type = CODEC_TYPE_AUDIO;
96 + c->codec_type = AVMEDIA_TYPE_AUDIO;
97
98 c->sample_rate = G.scene->audio.mixrate;
99 c->bit_rate = ffmpeg_audio_bitrate*1000;
100 @@ -652,14 +652,14 @@
101 error("No valid formats found");
102 return;
103 }
104 - fmt = guess_format(NULL, exts[0], NULL);
105 + fmt = av_guess_format(NULL, exts[0], NULL);
106 if (!fmt) {
107 G.afbreek = 1; /* Abort render */
108 error("No valid formats found");
109 return;
110 }
111
112 - of = av_alloc_format_context();
113 + of = avformat_alloc_context();
114 if (!of) {
115 G.afbreek = 1;
116 error("Error opening output file");
117 @@ -699,7 +699,7 @@
118 fmt->video_codec = CODEC_ID_H264;
119 break;
120 case FFMPEG_XVID:
121 - fmt->video_codec = CODEC_ID_XVID;
122 + fmt->video_codec = CODEC_ID_MPEG4;
123 break;
124 case FFMPEG_FLV:
125 fmt->video_codec = CODEC_ID_FLV1;
126 diff -urN blender-2.49b.orig//source/blender/imbuf/intern/anim.c blender-2.49b/source/blender/imbuf/intern/anim.c
127 --- blender-2.49b.orig//source/blender/imbuf/intern/anim.c 2009-09-01 17:21:50.000000000 +0200
128 +++ blender-2.49b/source/blender/imbuf/intern/anim.c 2011-11-13 06:21:37.000000000 +0100
129 @@ -550,7 +550,7 @@
130 videoStream=-1;
131 for(i=0; i<pFormatCtx->nb_streams; i++)
132 if(get_codec_from_stream(pFormatCtx->streams[i])->codec_type
133 - == CODEC_TYPE_VIDEO) {
134 + == AVMEDIA_TYPE_VIDEO) {
135 videoStream=i;
136 break;
137 }
138 @@ -683,10 +683,10 @@
139 && position - (anim->curposition + 1) < anim->preseek) {
140 while(av_read_frame(anim->pFormatCtx, &packet)>=0) {
141 if (packet.stream_index == anim->videoStream) {
142 - avcodec_decode_video(
143 + avcodec_decode_video2(
144 anim->pCodecCtx,
145 anim->pFrame, &frameFinished,
146 - packet.data, packet.size);
147 + &packet);
148
149 if (frameFinished) {
150 anim->curposition++;
151 @@ -741,9 +741,9 @@
152
153 while(av_read_frame(anim->pFormatCtx, &packet)>=0) {
154 if(packet.stream_index == anim->videoStream) {
155 - avcodec_decode_video(anim->pCodecCtx,
156 + avcodec_decode_video2(anim->pCodecCtx,
157 anim->pFrame, &frameFinished,
158 - packet.data, packet.size);
159 + &packet);
160
161 if (frameFinished && !pos_found) {
162 if (packet.dts >= pts_to_search) {
163 diff -urN blender-2.49b.orig//source/blender/imbuf/intern/util.c blender-2.49b/source/blender/imbuf/intern/util.c
164 --- blender-2.49b.orig//source/blender/imbuf/intern/util.c 2009-09-01 17:21:50.000000000 +0200
165 +++ blender-2.49b/source/blender/imbuf/intern/util.c 2011-11-13 04:37:27.000000000 +0100
166 @@ -324,7 +324,7 @@
167 return 0;
168 }
169
170 - if(UTIL_DEBUG) dump_format(pFormatCtx, 0, filename, 0);
171 + if(UTIL_DEBUG) av_dump_format(pFormatCtx, 0, filename, 0);
172
173
174 /* Find the first video stream */
175 @@ -332,7 +332,7 @@
176 for(i=0; i<pFormatCtx->nb_streams; i++)
177 if(pFormatCtx->streams[i] &&
178 get_codec_from_stream(pFormatCtx->streams[i]) &&
179 - (get_codec_from_stream(pFormatCtx->streams[i])->codec_type==CODEC_TYPE_VIDEO))
180 + (get_codec_from_stream(pFormatCtx->streams[i])->codec_type==AVMEDIA_TYPE_VIDEO))
181 {
182 videoStream=i;
183 break;
184 Binary files blender-2.49b.orig//source/blender/python/api2_2x/BGL.o and blender-2.49b/source/blender/python/api2_2x/BGL.o differ
185 Binary files blender-2.49b.orig//source/blender/python/api2_2x/bpy_internal_import.o and blender-2.49b/source/blender/python/api2_2x/bpy_internal_import.o differ
186 Binary files blender-2.49b.orig//source/blender/python/api2_2x/constant.o and blender-2.49b/source/blender/python/api2_2x/constant.o differ
187 Binary files blender-2.49b.orig//source/blender/python/api2_2x/euler.o and blender-2.49b/source/blender/python/api2_2x/euler.o differ
188 Binary files blender-2.49b.orig//source/blender/python/api2_2x/Geometry.o and blender-2.49b/source/blender/python/api2_2x/Geometry.o differ
189 Binary files blender-2.49b.orig//source/blender/python/api2_2x/Mathutils.o and blender-2.49b/source/blender/python/api2_2x/Mathutils.o differ
190 Binary files blender-2.49b.orig//source/blender/python/api2_2x/matrix.o and blender-2.49b/source/blender/python/api2_2x/matrix.o differ
191 Binary files blender-2.49b.orig//source/blender/python/api2_2x/quat.o and blender-2.49b/source/blender/python/api2_2x/quat.o differ
192 Binary files blender-2.49b.orig//source/blender/python/api2_2x/vector.o and blender-2.49b/source/blender/python/api2_2x/vector.o differ
193 diff -urN blender-2.49b.orig//source/blender/src/buttons_scene.c blender-2.49b/source/blender/src/buttons_scene.c
194 --- blender-2.49b.orig//source/blender/src/buttons_scene.c 2009-09-01 17:21:46.000000000 +0200
195 +++ blender-2.49b/source/blender/src/buttons_scene.c 2011-11-13 05:38:04.000000000 +0100
196 @@ -2169,7 +2169,7 @@
197 "Quicktime", FFMPEG_MOV,
198 "DV", FFMPEG_DV,
199 "H264", FFMPEG_H264,
200 - "XVid", FFMPEG_XVID,
201 + "XVID", FFMPEG_XVID,
202 #if 0
203 /* ifdef WITH_OGG, disabled, since broken within ffmpeg bundled with blender */
204 "OGG", FFMPEG_OGG,
205 @@ -2212,7 +2212,7 @@
206 "HuffYUV", CODEC_ID_HUFFYUV,
207 "DV", CODEC_ID_DVVIDEO,
208 "H264", CODEC_ID_H264,
209 - "XVid", CODEC_ID_XVID,
210 + "XVid", CODEC_ID_MPEG4,
211 #ifdef WITH_OGG
212 "Theora", CODEC_ID_THEORA,
213 #endif
214 @@ -2723,12 +2723,12 @@
215 switch (o->type) {
216 case FF_OPT_TYPE_INT:
217 case FF_OPT_TYPE_INT64:
218 - val.i = o->default_val;
219 + val.i = o->default_val.dbl;
220 idp_type = IDP_INT;
221 break;
222 case FF_OPT_TYPE_DOUBLE:
223 case FF_OPT_TYPE_FLOAT:
224 - val.f = o->default_val;
225 + val.f = o->default_val.dbl;
226 idp_type = IDP_FLOAT;
227 break;
228 case FF_OPT_TYPE_STRING:
229 diff -urN blender-2.49b.orig//source/blender/src/hddaudio.c blender-2.49b/source/blender/src/hddaudio.c
230 --- blender-2.49b.orig//source/blender/src/hddaudio.c 2009-09-01 17:21:45.000000000 +0200
231 +++ blender-2.49b/source/blender/src/hddaudio.c 2011-11-13 06:27:23.000000000 +0100
232 @@ -126,7 +126,7 @@
233 audioStream=-1;
234 for(i=0; i<pFormatCtx->nb_streams; i++)
235 if(get_codec_from_stream(pFormatCtx->streams[i])
236 - ->codec_type == CODEC_TYPE_AUDIO)
237 + ->codec_type == AVMEDIA_TYPE_AUDIO)
238 {
239 audioStream=i;
240 break;
241 @@ -382,39 +382,30 @@
242 continue;
243 }
244
245 - audio_pkt_data = packet.data;
246 - audio_pkt_size = packet.size;
247 -
248 - while (audio_pkt_size > 0) {
249 - data_size=AVCODEC_MAX_AUDIO_FRAME_SIZE;
250 - len = avcodec_decode_audio2(
251 - hdaudio->pCodecCtx,
252 - hdaudio->decode_cache
253 - + decode_pos
254 - * hdaudio->decode_sample_format_size,
255 - &data_size,
256 - audio_pkt_data,
257 - audio_pkt_size);
258 - if (len <= 0) {
259 - audio_pkt_size = 0;
260 - break;
261 - }
262 -
263 - audio_pkt_size -= len;
264 - audio_pkt_data += len;
265 -
266 - if (data_size <= 0) {
267 - continue;
268 - }
269 -
270 - decode_pos += data_size
271 - / hdaudio->decode_sample_format_size;
272 - if (decode_pos + data_size
273 - / hdaudio->decode_sample_format_size
274 - > hdaudio->decode_cache_size) {
275 - break;
276 - }
277 - }
278 + data_size=AVCODEC_MAX_AUDIO_FRAME_SIZE;
279 + len = avcodec_decode_audio3(
280 + hdaudio->pCodecCtx,
281 + hdaudio->decode_cache
282 + + decode_pos
283 + * hdaudio->decode_sample_format_size,
284 + &data_size,
285 + &packet);
286 + if (len <= 0) {
287 + audio_pkt_size = 0;
288 + break;
289 + }
290 +
291 + if (data_size <= 0) {
292 + continue;
293 + }
294 +
295 + decode_pos += data_size
296 + / hdaudio->decode_sample_format_size;
297 + if (decode_pos + data_size
298 + / hdaudio->decode_sample_format_size
299 + > hdaudio->decode_cache_size) {
300 + break;
301 + }
302 av_free_packet(&packet);
303
304 if (decode_pos + data_size / hdaudio->decode_sample_format_size
305 @@ -534,36 +525,29 @@
306 decode_cache_zero_init = 1;
307 }
308
309 - while (audio_pkt_size > 0) {
310 - data_size=AVCODEC_MAX_AUDIO_FRAME_SIZE;
311 - len = avcodec_decode_audio2(
312 - hdaudio->pCodecCtx,
313 - hdaudio->decode_cache
314 - + decode_pos
315 - * hdaudio->decode_sample_format_size,
316 - &data_size,
317 - audio_pkt_data,
318 - audio_pkt_size);
319 - if (len <= 0) {
320 - audio_pkt_size = 0;
321 - break;
322 - }
323 -
324 - audio_pkt_size -= len;
325 - audio_pkt_data += len;
326 -
327 - if (data_size <= 0) {
328 - continue;
329 - }
330 -
331 - decode_pos += data_size
332 - / hdaudio->decode_sample_format_size;
333 - if (decode_pos + data_size
334 - / hdaudio->decode_sample_format_size
335 - > hdaudio->decode_cache_size) {
336 - break;
337 - }
338 - }
339 + data_size=AVCODEC_MAX_AUDIO_FRAME_SIZE;
340 + len = avcodec_decode_audio3(
341 + hdaudio->pCodecCtx,
342 + hdaudio->decode_cache
343 + + decode_pos
344 + * hdaudio->decode_sample_format_size,
345 + &data_size,
346 + &packet);
347 + if (len <= 0) {
348 + break;
349 + }
350 +
351 + if (data_size <= 0) {
352 + continue;
353 + }
354 +
355 + decode_pos += data_size
356 + / hdaudio->decode_sample_format_size;
357 + if (decode_pos + data_size
358 + / hdaudio->decode_sample_format_size
359 + > hdaudio->decode_cache_size) {
360 + break;
361 + }
362
363 av_free_packet(&packet);
364
365 diff -urN blender-2.49b.orig//source/gameengine/VideoTexture/VideoFFmpeg.cpp blender-2.49b/source/gameengine/VideoTexture/VideoFFmpeg.cpp
366 --- blender-2.49b.orig//source/gameengine/VideoTexture/VideoFFmpeg.cpp 2009-09-01 17:20:53.000000000 +0200
367 +++ blender-2.49b/source/gameengine/VideoTexture/VideoFFmpeg.cpp 2011-11-13 07:56:56.000000000 +0100
368 @@ -26,7 +26,6 @@
369 #define __STDC_CONSTANT_MACROS
370 #include <stdint.h>
371
372 -
373 #include "MEM_guardedalloc.h"
374 #include "PIL_time.h"
375
376 @@ -177,7 +176,7 @@
377 {
378 if(formatCtx->streams[i] &&
379 get_codec_from_stream(formatCtx->streams[i]) &&
380 - (get_codec_from_stream(formatCtx->streams[i])->codec_type==CODEC_TYPE_VIDEO))
381 + (get_codec_from_stream(formatCtx->streams[i])->codec_type==AVMEDIA_TYPE_VIDEO))
382 {
383 videoStream=i;
384 break;
385 @@ -358,9 +357,9 @@
386 BLI_remlink(&video->m_packetCacheBase, cachePacket);
387 // use m_frame because when caching, it is not used in main thread
388 // we can't use currentFrame directly because we need to convert to RGB first
389 - avcodec_decode_video(video->m_codecCtx,
390 + avcodec_decode_video2(video->m_codecCtx,
391 video->m_frame, &frameFinished,
392 - cachePacket->packet.data, cachePacket->packet.size);
393 + &cachePacket->packet);
394 if(frameFinished)
395 {
396 AVFrame * input = video->m_frame;
397 @@ -628,7 +627,7 @@
398 if (m_captRate <= 0.f)
399 m_captRate = defFrameRate;
400 sprintf(rateStr, "%f", m_captRate);
401 - av_parse_video_frame_rate(&frameRate, rateStr);
402 + av_parse_video_rate(&frameRate, rateStr);
403 // populate format parameters
404 // need to specify the time base = inverse of rate
405 formatParams.time_base.num = frameRate.den;
406 @@ -887,10 +886,10 @@
407 {
408 if (packet.stream_index == m_videoStream)
409 {
410 - avcodec_decode_video(
411 + avcodec_decode_video2(
412 m_codecCtx,
413 m_frame, &frameFinished,
414 - packet.data, packet.size);
415 + &packet);
416 if (frameFinished)
417 m_curPosition++;
418 }
419 @@ -966,9 +965,9 @@
420 {
421 if(packet.stream_index == m_videoStream)
422 {
423 - avcodec_decode_video(m_codecCtx,
424 + avcodec_decode_video2(m_codecCtx,
425 m_frame, &frameFinished,
426 - packet.data, packet.size);
427 + &packet);
428
429 if (frameFinished && !posFound)
430 {
431 diff -urN blender-2.49b.orig//source/gameengine/VideoTexture/VideoFFmpeg.h blender-2.49b/source/gameengine/VideoTexture/VideoFFmpeg.h
432 --- blender-2.49b.orig//source/gameengine/VideoTexture/VideoFFmpeg.h 2009-09-01 17:20:53.000000000 +0200
433 +++ blender-2.49b/source/gameengine/VideoTexture/VideoFFmpeg.h 2011-11-13 08:03:51.000000000 +0100
434 @@ -28,6 +28,7 @@
435 #include <libavformat/avformat.h>
436 #include <libavcodec/avcodec.h>
437 #include <libavutil/rational.h>
438 +#include <libavutil/parseutils.h>
439 #include <libswscale/swscale.h>
440 #include "DNA_listBase.h"
441 #include "BLI_threads.h"