diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2011-11-13 07:19:54 +0000 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2011-11-13 07:19:54 +0000 |
commit | 08fd459619eafb5bc01d394ed2cf9893aab40ac7 (patch) | |
tree | 5cc3ffb2c2c8d4f288477a12dec7f4cd79947763 /media-gfx | |
parent | Fix LICENSE (yelp.m4 is GPL2 or freedist). (diff) | |
download | gentoo-2-08fd459619eafb5bc01d394ed2cf9893aab40ac7.tar.gz gentoo-2-08fd459619eafb5bc01d394ed2cf9893aab40ac7.tar.bz2 gentoo-2-08fd459619eafb5bc01d394ed2cf9893aab40ac7.zip |
Update blender-2.49b to support libav-0.7
(Portage version: 2.1.10.34/cvs/Linux x86_64)
Diffstat (limited to 'media-gfx')
-rw-r--r-- | media-gfx/blender/ChangeLog | 6 | ||||
-rw-r--r-- | media-gfx/blender/blender-2.49b-r2.ebuild | 3 | ||||
-rw-r--r-- | media-gfx/blender/files/blender-2.49b-libav-0.7.patch | 425 |
3 files changed, 432 insertions, 2 deletions
diff --git a/media-gfx/blender/ChangeLog b/media-gfx/blender/ChangeLog index ee1559e7db58..8cd577bddecd 100644 --- a/media-gfx/blender/ChangeLog +++ b/media-gfx/blender/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for media-gfx/blender # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/media-gfx/blender/ChangeLog,v 1.208 2011/11/07 21:51:39 lu_zero Exp $ +# $Header: /var/cvsroot/gentoo-x86/media-gfx/blender/ChangeLog,v 1.209 2011/11/13 07:19:54 lu_zero Exp $ + + 13 Nov 2011; Luca Barbato <lu_zero@gentoo.org> blender-2.49b-r2.ebuild, + +files/blender-2.49b-libav-0.7.patch: + Update blender-2.49b to support libav-0.7 07 Nov 2011; Luca Barbato <lu_zero@gentoo.org> blender-2.57-r1.ebuild, +files/blender-2.57-enable_site_module.patch, diff --git a/media-gfx/blender/blender-2.49b-r2.ebuild b/media-gfx/blender/blender-2.49b-r2.ebuild index a90f561e148c..268980045140 100644 --- a/media-gfx/blender/blender-2.49b-r2.ebuild +++ b/media-gfx/blender/blender-2.49b-r2.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/media-gfx/blender/blender-2.49b-r2.ebuild,v 1.11 2011/10/30 12:59:41 sping Exp $ +# $Header: /var/cvsroot/gentoo-x86/media-gfx/blender/blender-2.49b-r2.ebuild,v 1.12 2011/11/13 07:19:54 lu_zero Exp $ EAPI=2 @@ -59,6 +59,7 @@ src_prepare() { epatch "${FILESDIR}"/${PN}-2.49b-CVE-2009-3850-v4.patch epatch "${FILESDIR}"/${PN}-2.57-linux-3.patch # Bug #381099 epatch "${FILESDIR}"/${PN}-2.49b-subversion-1.7.patch + epatch "${FILESDIR}"/${P}-libav-0.7.patch rm -f "${S}/release/scripts/bpymodules/"*.pyc } diff --git a/media-gfx/blender/files/blender-2.49b-libav-0.7.patch b/media-gfx/blender/files/blender-2.49b-libav-0.7.patch new file mode 100644 index 000000000000..d0661add703c --- /dev/null +++ b/media-gfx/blender/files/blender-2.49b-libav-0.7.patch @@ -0,0 +1,425 @@ +diff -urN blender-2.49b.orig//source/blender/blenkernel/intern/writeffmpeg.c blender-2.49b/source/blender/blenkernel/intern/writeffmpeg.c +--- blender-2.49b.orig//source/blender/blenkernel/intern/writeffmpeg.c 2009-09-01 17:21:17.000000000 +0200 ++++ blender-2.49b/source/blender/blenkernel/intern/writeffmpeg.c 2011-11-13 05:36:23.000000000 +0100 +@@ -32,6 +32,7 @@ + #include <libavformat/avformat.h> + #include <libavcodec/avcodec.h> + #include <libavutil/rational.h> ++#include <libavutil/mathematics.h> + #include <libswscale/swscale.h> + #include <libavcodec/opt.h> + +@@ -149,10 +150,9 @@ + #else + pkt.pts = c->coded_frame->pts; + #endif +- fprintf(stderr, "Audio Frame PTS: %lld\n", pkt.pts); + + pkt.stream_index = audio_stream->index; +- pkt.flags |= PKT_FLAG_KEY; ++ pkt.flags |= AV_PKT_FLAG_KEY; + if (av_interleaved_write_frame(outfile, &pkt) != 0) { + error("Error writing audio packet"); + return -1; +@@ -271,7 +271,7 @@ + fprintf(stderr, "Video Frame PTS: not set\n"); + } + if (c->coded_frame->key_frame) +- packet.flags |= PKT_FLAG_KEY; ++ packet.flags |= AV_PKT_FLAG_KEY; + packet.stream_index = video_stream->index; + packet.data = video_buffer; + packet.size = outsize; +@@ -373,7 +373,7 @@ + switch(prop->type) { + case IDP_STRING: + fprintf(stderr, "%s.\n", IDP_String(prop)); +- rv = av_set_string(c, prop->name, IDP_String(prop)); ++ av_set_string3(c, prop->name, IDP_String(prop), 0, &rv); + break; + case IDP_FLOAT: + fprintf(stderr, "%g.\n", IDP_Float(prop)); +@@ -384,12 +384,12 @@ + + if (param) { + if (IDP_Int(prop)) { +- rv = av_set_string(c, name, param); ++ av_set_string3(c, name, param, 0, &rv); + } else { + return; + } + } else { +- rv = av_set_int(c, prop->name, IDP_Int(prop)); ++ av_set_int(c, prop->name, IDP_Int(prop)); + } + break; + } +@@ -438,7 +438,7 @@ + + c = get_codec_from_stream(st); + c->codec_id = codec_id; +- c->codec_type = CODEC_TYPE_VIDEO; ++ c->codec_type = AVMEDIA_TYPE_VIDEO; + + + /* Get some values from the current render settings */ +@@ -496,7 +496,7 @@ + c->pix_fmt = PIX_FMT_YUV422P; + } + +- if (codec_id == CODEC_ID_XVID) { ++ if (codec_id == CODEC_ID_MPEG4) { + /* arghhhh ... */ + c->pix_fmt = PIX_FMT_YUV420P; + } +@@ -557,7 +557,7 @@ + + c = get_codec_from_stream(st); + c->codec_id = codec_id; +- c->codec_type = CODEC_TYPE_AUDIO; ++ c->codec_type = AVMEDIA_TYPE_AUDIO; + + c->sample_rate = G.scene->audio.mixrate; + c->bit_rate = ffmpeg_audio_bitrate*1000; +@@ -652,14 +652,14 @@ + error("No valid formats found"); + return; + } +- fmt = guess_format(NULL, exts[0], NULL); ++ fmt = av_guess_format(NULL, exts[0], NULL); + if (!fmt) { + G.afbreek = 1; /* Abort render */ + error("No valid formats found"); + return; + } + +- of = av_alloc_format_context(); ++ of = avformat_alloc_context(); + if (!of) { + G.afbreek = 1; + error("Error opening output file"); +@@ -699,7 +699,7 @@ + fmt->video_codec = CODEC_ID_H264; + break; + case FFMPEG_XVID: +- fmt->video_codec = CODEC_ID_XVID; ++ fmt->video_codec = CODEC_ID_MPEG4; + break; + case FFMPEG_FLV: + fmt->video_codec = CODEC_ID_FLV1; +diff -urN blender-2.49b.orig//source/blender/imbuf/intern/anim.c blender-2.49b/source/blender/imbuf/intern/anim.c +--- blender-2.49b.orig//source/blender/imbuf/intern/anim.c 2009-09-01 17:21:50.000000000 +0200 ++++ blender-2.49b/source/blender/imbuf/intern/anim.c 2011-11-13 06:21:37.000000000 +0100 +@@ -550,7 +550,7 @@ + videoStream=-1; + for(i=0; i<pFormatCtx->nb_streams; i++) + if(get_codec_from_stream(pFormatCtx->streams[i])->codec_type +- == CODEC_TYPE_VIDEO) { ++ == AVMEDIA_TYPE_VIDEO) { + videoStream=i; + break; + } +@@ -683,10 +683,10 @@ + && position - (anim->curposition + 1) < anim->preseek) { + while(av_read_frame(anim->pFormatCtx, &packet)>=0) { + if (packet.stream_index == anim->videoStream) { +- avcodec_decode_video( ++ avcodec_decode_video2( + anim->pCodecCtx, + anim->pFrame, &frameFinished, +- packet.data, packet.size); ++ &packet); + + if (frameFinished) { + anim->curposition++; +@@ -741,9 +741,9 @@ + + while(av_read_frame(anim->pFormatCtx, &packet)>=0) { + if(packet.stream_index == anim->videoStream) { +- avcodec_decode_video(anim->pCodecCtx, ++ avcodec_decode_video2(anim->pCodecCtx, + anim->pFrame, &frameFinished, +- packet.data, packet.size); ++ &packet); + + if (frameFinished && !pos_found) { + if (packet.dts >= pts_to_search) { +diff -urN blender-2.49b.orig//source/blender/imbuf/intern/util.c blender-2.49b/source/blender/imbuf/intern/util.c +--- blender-2.49b.orig//source/blender/imbuf/intern/util.c 2009-09-01 17:21:50.000000000 +0200 ++++ blender-2.49b/source/blender/imbuf/intern/util.c 2011-11-13 04:37:27.000000000 +0100 +@@ -324,7 +324,7 @@ + return 0; + } + +- if(UTIL_DEBUG) dump_format(pFormatCtx, 0, filename, 0); ++ if(UTIL_DEBUG) av_dump_format(pFormatCtx, 0, filename, 0); + + + /* Find the first video stream */ +@@ -332,7 +332,7 @@ + for(i=0; i<pFormatCtx->nb_streams; i++) + if(pFormatCtx->streams[i] && + get_codec_from_stream(pFormatCtx->streams[i]) && +- (get_codec_from_stream(pFormatCtx->streams[i])->codec_type==CODEC_TYPE_VIDEO)) ++ (get_codec_from_stream(pFormatCtx->streams[i])->codec_type==AVMEDIA_TYPE_VIDEO)) + { + videoStream=i; + break; +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 +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 +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 +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 +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 +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 +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 +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 +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 +diff -urN blender-2.49b.orig//source/blender/src/buttons_scene.c blender-2.49b/source/blender/src/buttons_scene.c +--- blender-2.49b.orig//source/blender/src/buttons_scene.c 2009-09-01 17:21:46.000000000 +0200 ++++ blender-2.49b/source/blender/src/buttons_scene.c 2011-11-13 05:38:04.000000000 +0100 +@@ -2169,7 +2169,7 @@ + "Quicktime", FFMPEG_MOV, + "DV", FFMPEG_DV, + "H264", FFMPEG_H264, +- "XVid", FFMPEG_XVID, ++ "XVID", FFMPEG_XVID, + #if 0 + /* ifdef WITH_OGG, disabled, since broken within ffmpeg bundled with blender */ + "OGG", FFMPEG_OGG, +@@ -2212,7 +2212,7 @@ + "HuffYUV", CODEC_ID_HUFFYUV, + "DV", CODEC_ID_DVVIDEO, + "H264", CODEC_ID_H264, +- "XVid", CODEC_ID_XVID, ++ "XVid", CODEC_ID_MPEG4, + #ifdef WITH_OGG + "Theora", CODEC_ID_THEORA, + #endif +@@ -2723,12 +2723,12 @@ + switch (o->type) { + case FF_OPT_TYPE_INT: + case FF_OPT_TYPE_INT64: +- val.i = o->default_val; ++ val.i = o->default_val.dbl; + idp_type = IDP_INT; + break; + case FF_OPT_TYPE_DOUBLE: + case FF_OPT_TYPE_FLOAT: +- val.f = o->default_val; ++ val.f = o->default_val.dbl; + idp_type = IDP_FLOAT; + break; + case FF_OPT_TYPE_STRING: +diff -urN blender-2.49b.orig//source/blender/src/hddaudio.c blender-2.49b/source/blender/src/hddaudio.c +--- blender-2.49b.orig//source/blender/src/hddaudio.c 2009-09-01 17:21:45.000000000 +0200 ++++ blender-2.49b/source/blender/src/hddaudio.c 2011-11-13 06:27:23.000000000 +0100 +@@ -126,7 +126,7 @@ + audioStream=-1; + for(i=0; i<pFormatCtx->nb_streams; i++) + if(get_codec_from_stream(pFormatCtx->streams[i]) +- ->codec_type == CODEC_TYPE_AUDIO) ++ ->codec_type == AVMEDIA_TYPE_AUDIO) + { + audioStream=i; + break; +@@ -382,39 +382,30 @@ + continue; + } + +- audio_pkt_data = packet.data; +- audio_pkt_size = packet.size; +- +- while (audio_pkt_size > 0) { +- data_size=AVCODEC_MAX_AUDIO_FRAME_SIZE; +- len = avcodec_decode_audio2( +- hdaudio->pCodecCtx, +- hdaudio->decode_cache +- + decode_pos +- * hdaudio->decode_sample_format_size, +- &data_size, +- audio_pkt_data, +- audio_pkt_size); +- if (len <= 0) { +- audio_pkt_size = 0; +- break; +- } +- +- audio_pkt_size -= len; +- audio_pkt_data += len; +- +- if (data_size <= 0) { +- continue; +- } +- +- decode_pos += data_size +- / hdaudio->decode_sample_format_size; +- if (decode_pos + data_size +- / hdaudio->decode_sample_format_size +- > hdaudio->decode_cache_size) { +- break; +- } +- } ++ data_size=AVCODEC_MAX_AUDIO_FRAME_SIZE; ++ len = avcodec_decode_audio3( ++ hdaudio->pCodecCtx, ++ hdaudio->decode_cache ++ + decode_pos ++ * hdaudio->decode_sample_format_size, ++ &data_size, ++ &packet); ++ if (len <= 0) { ++ audio_pkt_size = 0; ++ break; ++ } ++ ++ if (data_size <= 0) { ++ continue; ++ } ++ ++ decode_pos += data_size ++ / hdaudio->decode_sample_format_size; ++ if (decode_pos + data_size ++ / hdaudio->decode_sample_format_size ++ > hdaudio->decode_cache_size) { ++ break; ++ } + av_free_packet(&packet); + + if (decode_pos + data_size / hdaudio->decode_sample_format_size +@@ -534,36 +525,29 @@ + decode_cache_zero_init = 1; + } + +- while (audio_pkt_size > 0) { +- data_size=AVCODEC_MAX_AUDIO_FRAME_SIZE; +- len = avcodec_decode_audio2( +- hdaudio->pCodecCtx, +- hdaudio->decode_cache +- + decode_pos +- * hdaudio->decode_sample_format_size, +- &data_size, +- audio_pkt_data, +- audio_pkt_size); +- if (len <= 0) { +- audio_pkt_size = 0; +- break; +- } +- +- audio_pkt_size -= len; +- audio_pkt_data += len; +- +- if (data_size <= 0) { +- continue; +- } +- +- decode_pos += data_size +- / hdaudio->decode_sample_format_size; +- if (decode_pos + data_size +- / hdaudio->decode_sample_format_size +- > hdaudio->decode_cache_size) { +- break; +- } +- } ++ data_size=AVCODEC_MAX_AUDIO_FRAME_SIZE; ++ len = avcodec_decode_audio3( ++ hdaudio->pCodecCtx, ++ hdaudio->decode_cache ++ + decode_pos ++ * hdaudio->decode_sample_format_size, ++ &data_size, ++ &packet); ++ if (len <= 0) { ++ break; ++ } ++ ++ if (data_size <= 0) { ++ continue; ++ } ++ ++ decode_pos += data_size ++ / hdaudio->decode_sample_format_size; ++ if (decode_pos + data_size ++ / hdaudio->decode_sample_format_size ++ > hdaudio->decode_cache_size) { ++ break; ++ } + + av_free_packet(&packet); + +diff -urN blender-2.49b.orig//source/gameengine/VideoTexture/VideoFFmpeg.cpp blender-2.49b/source/gameengine/VideoTexture/VideoFFmpeg.cpp +--- blender-2.49b.orig//source/gameengine/VideoTexture/VideoFFmpeg.cpp 2009-09-01 17:20:53.000000000 +0200 ++++ blender-2.49b/source/gameengine/VideoTexture/VideoFFmpeg.cpp 2011-11-13 07:56:56.000000000 +0100 +@@ -26,7 +26,6 @@ + #define __STDC_CONSTANT_MACROS + #include <stdint.h> + +- + #include "MEM_guardedalloc.h" + #include "PIL_time.h" + +@@ -177,7 +176,7 @@ + { + if(formatCtx->streams[i] && + get_codec_from_stream(formatCtx->streams[i]) && +- (get_codec_from_stream(formatCtx->streams[i])->codec_type==CODEC_TYPE_VIDEO)) ++ (get_codec_from_stream(formatCtx->streams[i])->codec_type==AVMEDIA_TYPE_VIDEO)) + { + videoStream=i; + break; +@@ -358,9 +357,9 @@ + BLI_remlink(&video->m_packetCacheBase, cachePacket); + // use m_frame because when caching, it is not used in main thread + // we can't use currentFrame directly because we need to convert to RGB first +- avcodec_decode_video(video->m_codecCtx, ++ avcodec_decode_video2(video->m_codecCtx, + video->m_frame, &frameFinished, +- cachePacket->packet.data, cachePacket->packet.size); ++ &cachePacket->packet); + if(frameFinished) + { + AVFrame * input = video->m_frame; +@@ -628,7 +627,7 @@ + if (m_captRate <= 0.f) + m_captRate = defFrameRate; + sprintf(rateStr, "%f", m_captRate); +- av_parse_video_frame_rate(&frameRate, rateStr); ++ av_parse_video_rate(&frameRate, rateStr); + // populate format parameters + // need to specify the time base = inverse of rate + formatParams.time_base.num = frameRate.den; +@@ -887,10 +886,10 @@ + { + if (packet.stream_index == m_videoStream) + { +- avcodec_decode_video( ++ avcodec_decode_video2( + m_codecCtx, + m_frame, &frameFinished, +- packet.data, packet.size); ++ &packet); + if (frameFinished) + m_curPosition++; + } +@@ -966,9 +965,9 @@ + { + if(packet.stream_index == m_videoStream) + { +- avcodec_decode_video(m_codecCtx, ++ avcodec_decode_video2(m_codecCtx, + m_frame, &frameFinished, +- packet.data, packet.size); ++ &packet); + + if (frameFinished && !posFound) + { +diff -urN blender-2.49b.orig//source/gameengine/VideoTexture/VideoFFmpeg.h blender-2.49b/source/gameengine/VideoTexture/VideoFFmpeg.h +--- blender-2.49b.orig//source/gameengine/VideoTexture/VideoFFmpeg.h 2009-09-01 17:20:53.000000000 +0200 ++++ blender-2.49b/source/gameengine/VideoTexture/VideoFFmpeg.h 2011-11-13 08:03:51.000000000 +0100 +@@ -28,6 +28,7 @@ + #include <libavformat/avformat.h> + #include <libavcodec/avcodec.h> + #include <libavutil/rational.h> ++#include <libavutil/parseutils.h> + #include <libswscale/swscale.h> + #include "DNA_listBase.h" + #include "BLI_threads.h" |