Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=ryuotesting8.git;a=commitdiff;h=ffa66aabd85cd18bf604a8415ec8701d0e1af6a6

commit ffa66aabd85cd18bf604a8415ec8701d0e1af6a6
Author: James Buren <[email protected]>
Date:   Tue Oct 30 01:32:53 2012 -0500

blender-2.63a-2-x86_64
* rebuild with ffmpeg

diff --git a/source/xapps-extra/blender/FrugalBuild 
b/source/xapps-extra/blender/FrugalBuild
index 6e738ae..69933b9 100644
--- a/source/xapps-extra/blender/FrugalBuild
+++ b/source/xapps-extra/blender/FrugalBuild
@@ -7,7 +7,7 @@
pkgname=blender
pkgver=2.63a
pkgextraver=
-pkgrel=1
+pkgrel=2
pkgdesc="A 3D modeling/rendering/animation/gaming application"
url="http://blender.org";
_F_gnome_iconcache="y"
@@ -16,16 +16,18 @@ Finclude gnome-scriptlet python cmake
depends=('libjpeg>=8a' 'libpng>=1.4.1' 'freetype2' \
'freealut>=1.1.0-3' 'openexr>=1.7.0' 'openal>=1.7.411' \
"python-3.0" 'libtiff' 'sdl>=1.2.13-2' 'libxi' 'glew' \
-       'libsamplerate' 'ffmpeg' 'libboost')
+       'libsamplerate' 'ffmpeg>=1.0' 'libboost')
groups=('xapps-extra')
archs=('i686' 'x86_64')
makedepends=('cmake' 'ftgl' 'subversion' 'boost')
up2date="Flasttar http://www.blender.org/download/source-code/";
-source=(http://download.blender.org/source/$pkgname-$pkgver$pkgextraver.tar.gz)
-sha1sums=('b097dce9f3738917d43bf5fde8ef7c014223114c')
+source=(http://download.blender.org/source/$pkgname-$pkgver$pkgextraver.tar.gz 
ffmpeg.patch)
+sha1sums=('b097dce9f3738917d43bf5fde8ef7c014223114c' \
+          '71a4246bbac9a3fd96803bbbcfc14dfb242424ea')

build() {
Fcd $pkgname-$pkgver
+        Fpatchall
mkdir -p ../build || Fdie
cd ../build || Fdie

diff --git a/source/xapps-extra/blender/ffmpeg.patch 
b/source/xapps-extra/blender/ffmpeg.patch
new file mode 100644
index 0000000..e4789d1
--- /dev/null
+++ b/source/xapps-extra/blender/ffmpeg.patch
@@ -0,0 +1,561 @@
+diff -urNb blender-2.63a.old//intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp 
blender-2.63a.new//intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp
+--- blender-2.63a.old//intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp    
2012-05-10 16:45:40.000000000 +0200
++++ blender-2.63a.new//intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp    
2012-07-13 22:10:47.615293287 +0200
+@@ -107,7 +107,7 @@
+       m_position = 0;
+       m_pkgbuf_left = 0;
+
+-      if(av_find_stream_info(m_formatCtx)<0)
++      if(avformat_find_stream_info(m_formatCtx, NULL)<0)
+               AUD_THROW(AUD_ERROR_FFMPEG, streaminfo_error);
+
+       // find audio stream and codec
+@@ -133,7 +133,7 @@
+       if(!aCodec)
+               AUD_THROW(AUD_ERROR_FFMPEG, nodecoder_error);
+
+-      if(avcodec_open(m_codecCtx, aCodec)<0)
++      if(avcodec_open2(m_codecCtx, aCodec, NULL)<0)
+               AUD_THROW(AUD_ERROR_FFMPEG, codecopen_error);
+
+       // XXX this prints file information to stdout:
+@@ -143,23 +143,23 @@
+
+       switch(m_codecCtx->sample_fmt)
+       {
+-      case SAMPLE_FMT_U8:
++      case AV_SAMPLE_FMT_U8:
+               m_convert = AUD_convert_u8_float;
+               m_specs.format = AUD_FORMAT_U8;
+               break;
+-      case SAMPLE_FMT_S16:
++      case AV_SAMPLE_FMT_S16:
+               m_convert = AUD_convert_s16_float;
+               m_specs.format = AUD_FORMAT_S16;
+               break;
+-      case SAMPLE_FMT_S32:
++      case AV_SAMPLE_FMT_S32:
+               m_convert = AUD_convert_s32_float;
+               m_specs.format = AUD_FORMAT_S32;
+               break;
+-      case SAMPLE_FMT_FLT:
++      case AV_SAMPLE_FMT_FLT:
+               m_convert = AUD_convert_copy<float>;
+               m_specs.format = AUD_FORMAT_FLOAT32;
+               break;
+-      case SAMPLE_FMT_DBL:
++      case AV_SAMPLE_FMT_DBL:
+               m_convert = AUD_convert_double_float;
+               m_specs.format = AUD_FORMAT_FLOAT64;
+               break;
+@@ -189,7 +189,7 @@
+       }
+       catch(AUD_Exception&)
+       {
+-              av_close_input_file(m_formatCtx);
++              avformat_close_input(&m_formatCtx);
+               throw;
+       }
+ }
+@@ -227,8 +227,7 @@
+       }
+       catch(AUD_Exception&)
+       {
+-              av_close_input_stream(m_formatCtx);
+-              av_free(m_aviocontext);
++              avformat_close_input(&m_formatCtx);
+               throw;
+       }
+ }
+@@ -237,13 +236,7 @@
+ {
+       avcodec_close(m_codecCtx);
+
+-      if(m_aviocontext)
+-      {
+-              av_close_input_stream(m_formatCtx);
+-              av_free(m_aviocontext);
+-      }
+-      else
+-              av_close_input_file(m_formatCtx);
++      avformat_close_input(&m_formatCtx);
+ }
+
+ int AUD_FFMPEGReader::read_packet(void* opaque, uint8_t* buf, int buf_size)
+diff -urNb blender-2.63a.old//intern/audaspace/ffmpeg/AUD_FFMPEGWriter.cpp 
blender-2.63a.new//intern/audaspace/ffmpeg/AUD_FFMPEGWriter.cpp
+--- blender-2.63a.old//intern/audaspace/ffmpeg/AUD_FFMPEGWriter.cpp    
2012-05-10 16:45:40.000000000 +0200
++++ blender-2.63a.new//intern/audaspace/ffmpeg/AUD_FFMPEGWriter.cpp    
2012-07-13 22:11:17.910292184 +0200
+@@ -38,6 +38,8 @@
+ #include <libavcodec/avcodec.h>
+ #include <libavformat/avformat.h>
+ #include <libavformat/avio.h>
++#include <libavutil/mathematics.h>
++#include <libavutil/avstring.h>
+ #include "ffmpeg_compat.h"
+ }
+
+@@ -55,10 +57,15 @@
+ {
+       static const char* formats[] = { NULL, "ac3", "flac", "matroska", 
"mp2", "mp3", "ogg", "wav" };
+
+-      if(avformat_alloc_output_context2(&m_formatCtx, NULL, formats[format], 
filename.c_str()))
+-              AUD_THROW(AUD_ERROR_FFMPEG, context_error);
++      m_formatCtx = avformat_alloc_context();
++        if (!m_formatCtx) AUD_THROW(AUD_ERROR_FFMPEG, context_error);
+
+-      m_outputFmt = m_formatCtx->oformat;
++      av_strlcpy(m_formatCtx->filename, filename.c_str(), 
sizeof(m_formatCtx->filename));
++      m_outputFmt = m_formatCtx->oformat = av_guess_format(formats[format], 
filename.c_str(), NULL);
++      if (!m_outputFmt) {
++            avformat_free_context(m_formatCtx);
++            AUD_THROW(AUD_ERROR_FFMPEG, context_error);
++        }
+
+       switch(codec)
+       {
+@@ -116,7 +123,7 @@
+               if(m_outputFmt->audio_codec == CODEC_ID_NONE)
+                       AUD_THROW(AUD_ERROR_SPECS, codec_error);
+
+-              m_stream = av_new_stream(m_formatCtx, 0);
++              m_stream = avformat_new_stream(m_formatCtx, NULL);
+               if(!m_stream)
+                       AUD_THROW(AUD_ERROR_FFMPEG, stream_error);
+
+@@ -133,23 +140,23 @@
+               {
+               case AUD_FORMAT_U8:
+                       m_convert = AUD_convert_float_u8;
+-                      m_codecCtx->sample_fmt = SAMPLE_FMT_U8;
++                      m_codecCtx->sample_fmt = AV_SAMPLE_FMT_U8;
+                       break;
+               case AUD_FORMAT_S16:
+                       m_convert = AUD_convert_float_s16;
+-                      m_codecCtx->sample_fmt = SAMPLE_FMT_S16;
++                      m_codecCtx->sample_fmt = AV_SAMPLE_FMT_S16;
+                       break;
+               case AUD_FORMAT_S32:
+                       m_convert = AUD_convert_float_s32;
+-                      m_codecCtx->sample_fmt = SAMPLE_FMT_S32;
++                      m_codecCtx->sample_fmt = AV_SAMPLE_FMT_S32;
+                       break;
+               case AUD_FORMAT_FLOAT32:
+                       m_convert = AUD_convert_copy<float>;
+-                      m_codecCtx->sample_fmt = SAMPLE_FMT_FLT;
++                      m_codecCtx->sample_fmt = AV_SAMPLE_FMT_FLT;
+                       break;
+               case AUD_FORMAT_FLOAT64:
+                       m_convert = AUD_convert_float_double;
+-                      m_codecCtx->sample_fmt = SAMPLE_FMT_DBL;
++                      m_codecCtx->sample_fmt = AV_SAMPLE_FMT_DBL;
+                       break;
+               default:
+                       AUD_THROW(AUD_ERROR_FFMPEG, format_error);
+@@ -164,7 +171,7 @@
+                       if(!codec)
+                               AUD_THROW(AUD_ERROR_FFMPEG, codec_error);
+
+-                      if(avcodec_open(m_codecCtx, codec))
++                      if(avcodec_open2(m_codecCtx, codec, NULL))
+                               AUD_THROW(AUD_ERROR_FFMPEG, codec_error);
+
+                       m_output_buffer.resize(FF_MIN_BUFFER_SIZE);
+diff -urNb blender-2.63a.old//intern/ffmpeg/ffmpeg_compat.h 
blender-2.63a.new//intern/ffmpeg/ffmpeg_compat.h
+--- blender-2.63a.old//intern/ffmpeg/ffmpeg_compat.h   2012-05-10 
16:46:17.000000000 +0200
++++ blender-2.63a.new//intern/ffmpeg/ffmpeg_compat.h   2012-07-13 
21:22:36.462398523 +0200
+@@ -40,7 +40,6 @@
+ #endif
+
+ #include <libswscale/swscale.h>
+-#include <libavcodec/opt.h>
+
+ #if (LIBAVFORMAT_VERSION_MAJOR > 52) || ((LIBAVFORMAT_VERSION_MAJOR >= 52) && 
(LIBAVFORMAT_VERSION_MINOR >= 105))
+ #define FFMPEG_HAVE_AVIO 1
+diff -urNb blender-2.63a.old//source/blender/blenkernel/intern/writeffmpeg.c 
blender-2.63a.new//source/blender/blenkernel/intern/writeffmpeg.c
+--- blender-2.63a.old//source/blender/blenkernel/intern/writeffmpeg.c  
2012-05-10 16:50:20.000000000 +0200
++++ blender-2.63a.new//source/blender/blenkernel/intern/writeffmpeg.c  
2012-07-13 22:54:42.429197382 +0200
+@@ -37,7 +37,6 @@
+ #include <libavcodec/avcodec.h>
+ #include <libavutil/rational.h>
+ #include <libswscale/swscale.h>
+-#include <libavcodec/opt.h>
+
+ #include "MEM_guardedalloc.h"
+
+@@ -449,7 +448,7 @@
+       AVStream* st;
+       AVCodecContext* c;
+       AVCodec* codec;
+-      st = av_new_stream(of, 0);
++      st = avformat_new_stream(of, NULL);
+       if (!st) return NULL;
+
+       /* Set up the codec context */
+@@ -515,24 +514,11 @@
+       }
+
+       // Keep lossless encodes in the RGB domain.
+-      if (codec_id == CODEC_ID_HUFFYUV) {
++      if (codec_id == CODEC_ID_HUFFYUV || codec_id == CODEC_ID_FFV1) {
+               /* HUFFYUV was PIX_FMT_YUV422P before */
+               c->pix_fmt = PIX_FMT_RGB32;
+       }
+
+-      if (codec_id == CODEC_ID_FFV1) {
+-#ifdef FFMPEG_FFV1_ALPHA_SUPPORTED
+-              if (rd->im_format.planes ==  R_IMF_PLANES_RGBA) {
+-                      c->pix_fmt = PIX_FMT_RGB32;
+-              }
+-              else {
+-                      c->pix_fmt = PIX_FMT_BGR0;
+-              }
+-#else
+-              c->pix_fmt = PIX_FMT_RGB32;
+-#endif
+-      }
+-
+       if (codec_id == CODEC_ID_QTRLE ) {
+               if (rd->im_format.planes ==  R_IMF_PLANES_RGBA) {
+                       c->pix_fmt = PIX_FMT_ARGB;
+@@ -562,7 +548,7 @@
+
+       set_ffmpeg_properties(rd, c, "video");
+
+-      if (avcodec_open(c, codec) < 0) {
++      if (avcodec_open2(c, codec, NULL) < 0) {
+               //
+               //XXX error("Couldn't initialize codec");
+               return NULL;
+@@ -603,7 +589,7 @@
+       AVCodecContext* c;
+       AVCodec* codec;
+
+-      st = av_new_stream(of, 1);
++      st = avformat_new_stream(of, NULL);
+       if (!st) return NULL;
+
+       c = st->codec;
+@@ -612,7 +598,7 @@
+
+       c->sample_rate = rd->ffcodecdata.audio_mixrate;
+       c->bit_rate = ffmpeg_audio_bitrate*1000;
+-      c->sample_fmt = SAMPLE_FMT_S16;
++      c->sample_fmt = AV_SAMPLE_FMT_S16;
+       c->channels = rd->ffcodecdata.audio_channels;
+       codec = avcodec_find_encoder(c->codec_id);
+       if (!codec) {
+@@ -622,7 +608,7 @@
+
+       set_ffmpeg_properties(rd, c, "audio");
+
+-      if (avcodec_open(c, codec) < 0) {
++      if (avcodec_open2(c, codec, NULL) < 0) {
+               //XXX error("Couldn't initialize audio codec");
+               return NULL;
+       }
+@@ -704,13 +690,10 @@
+       of->oformat = fmt;
+       of->packet_size= rd->ffcodecdata.mux_packet_size;
+       if (ffmpeg_audio_codec != CODEC_ID_NONE) {
+-              of->mux_rate = rd->ffcodecdata.mux_rate;
+-      }
+-      else {
+-              of->mux_rate = 0;
++              av_opt_set_int(of, "muxrate", rd->ffcodecdata.mux_rate, 0);
+       }
+
+-      of->preload = (int)(0.5*AV_TIME_BASE);
++      av_opt_set_int(of, "preload", (int)(0.5*AV_TIME_BASE), 0);
+       of->max_delay = (int)(0.7*AV_TIME_BASE);
+
+       fmt->audio_codec = ffmpeg_audio_codec;
+@@ -793,10 +776,6 @@
+                       return 0;
+               }
+       }
+-      if (av_set_parameters(of, NULL) < 0) {
+-              BKE_report(reports, RPT_ERROR, "Error setting output 
parameters.");
+-              return 0;
+-      }
+       if (!(fmt->flags & AVFMT_NOFILE)) {
+               if (avio_open(&of->pb, name, AVIO_FLAG_WRITE) < 0) {
+                       BKE_report(reports, RPT_ERROR, "Could not open file for 
writing.");
+@@ -804,7 +783,7 @@
+               }
+       }
+
+-      if (av_write_header(of) < 0) {
++      if (avformat_write_header(of, NULL) < 0) {
+               BKE_report(reports, RPT_ERROR, "Could not initialize streams. 
Probably unsupported codec combination.");
+               return 0;
+       }
+@@ -1102,7 +1081,7 @@
+
+       val.i = 0;
+
+-      avcodec_get_context_defaults(&c);
++      avcodec_get_context_defaults3(&c, NULL);
+
+       o = c.av_class->option + opt_index;
+       parent = c.av_class->option + parent_index;
+@@ -1190,7 +1169,7 @@
+       char * param;
+       IDProperty * prop;
+
+-      avcodec_get_context_defaults(&c);
++      avcodec_get_context_defaults3(&c, NULL);
+
+       strncpy(name_, str, sizeof(name_));
+
+diff -urNb blender-2.63a.old//source/blender/imbuf/intern/anim_movie.c 
blender-2.63a.new//source/blender/imbuf/intern/anim_movie.c
+--- blender-2.63a.old//source/blender/imbuf/intern/anim_movie.c        
2012-05-10 16:50:59.000000000 +0200
++++ blender-2.63a.new//source/blender/imbuf/intern/anim_movie.c        
2012-07-14 00:12:49.157026789 +0200
+@@ -455,12 +455,12 @@
+
+       do_init_ffmpeg();
+
+-      if (av_open_input_file(&pFormatCtx, anim->name, NULL, 0, NULL)!=0) {
++      if (avformat_open_input(&pFormatCtx, anim->name, NULL, NULL)!=0) {
+               return -1;
+       }
+
+-      if (av_find_stream_info(pFormatCtx)<0) {
+-              av_close_input_file(pFormatCtx);
++      if (avformat_find_stream_info(pFormatCtx, NULL)<0) {
++              avformat_close_input(&pFormatCtx);
+               return -1;
+       }
+
+@@ -482,7 +482,7 @@
+               }
+
+       if (videoStream==-1) {
+-              av_close_input_file(pFormatCtx);
++              avformat_close_input(&pFormatCtx);
+               return -1;
+       }
+
+@@ -497,7 +497,7 @@
+
+       pCodecCtx->workaround_bugs = 1;
+
+-      if (avcodec_open(pCodecCtx, pCodec) < 0) {
++      if (avcodec_open2(pCodecCtx, pCodec, NULL) < 0) {
+               av_close_input_file(pFormatCtx);
+               return -1;
+       }
+@@ -990,7 +990,6 @@
+                               ret = av_seek_frame(anim->pFormatCtx,
+                                                   -1,
+                                                   pos, AVSEEK_FLAG_BYTE);
+-                              av_update_cur_dts(anim->pFormatCtx, v_st, dts);
+                       }
+                       else {
+                               av_log(anim->pFormatCtx, AV_LOG_DEBUG,
+diff -urNb blender-2.63a.old//source/blender/imbuf/intern/indexer.c 
blender-2.63a.new//source/blender/imbuf/intern/indexer.c
+--- blender-2.63a.old//source/blender/imbuf/intern/indexer.c   2012-05-10 
16:50:59.000000000 +0200
++++ blender-2.63a.new//source/blender/imbuf/intern/indexer.c   2012-07-14 
00:23:44.775002926 +0200
+@@ -491,7 +491,7 @@
+
+       fprintf(stderr, "Starting work on proxy: %s\n", rv->of->filename);
+
+-      rv->st = av_new_stream(rv->of, 0);
++      rv->st = avformat_new_stream(rv->of, NULL);
+       rv->c = rv->st->codec;
+       rv->c->codec_type = AVMEDIA_TYPE_VIDEO;
+       rv->c->codec_id = CODEC_ID_MJPEG;
+@@ -533,13 +533,6 @@
+               rv->c->flags |= CODEC_FLAG_GLOBAL_HEADER;
+       }
+
+-      if (av_set_parameters(rv->of, NULL) < 0) {
+-              fprintf(stderr, "Couldn't set output parameters? "
+-                      "Proxy not built!\n");
+-              av_free(rv->of);
+-              return 0;
+-      }
+-
+       if (avio_open(&rv->of->pb, fname, AVIO_FLAG_WRITE) < 0) {
+               fprintf(stderr, "Couldn't open outputfile! "
+                       "Proxy not built!\n");
+@@ -547,7 +540,7 @@
+               return 0;
+       }
+
+-      avcodec_open(rv->c, rv->codec);
++      avcodec_open2(rv->c, rv->codec, NULL);
+
+       rv->video_buffersize = 2000000;
+       rv->video_buffer = (uint8_t*)MEM_mallocN(
+@@ -576,7 +569,7 @@
+                       NULL, NULL, NULL);
+       }
+
+-      av_write_header(rv->of);
++      avformat_write_header(rv->of, NULL);
+
+       return rv;
+ }
+@@ -739,12 +732,12 @@
+       memset(context->proxy_ctx, 0, sizeof(context->proxy_ctx));
+       memset(context->indexer, 0, sizeof(context->indexer));
+
+-      if (av_open_input_file(&context->iFormatCtx, anim->name, NULL, 0, NULL) 
!= 0) {
++      if (avformat_open_input(&context->iFormatCtx, anim->name, NULL, NULL) 
!= 0) {
+               MEM_freeN(context);
+               return NULL;
+       }
+
+-      if (av_find_stream_info(context->iFormatCtx) < 0) {
++      if (avformat_find_stream_info(context->iFormatCtx, NULL) < 0) {
+               av_close_input_file(context->iFormatCtx);
+               MEM_freeN(context);
+               return NULL;
+@@ -784,7 +777,7 @@
+
+       context->iCodecCtx->workaround_bugs = 1;
+
+-      if (avcodec_open(context->iCodecCtx, context->iCodec) < 0) {
++      if (avcodec_open2(context->iCodecCtx, context->iCodec, NULL) < 0) {
+               av_close_input_file(context->iFormatCtx);
+               MEM_freeN(context);
+               return NULL;
+diff -urNb blender-2.63a.old//source/blender/imbuf/intern/util.c 
blender-2.63a.new//source/blender/imbuf/intern/util.c
+--- blender-2.63a.old//source/blender/imbuf/intern/util.c      2012-05-10 
16:50:59.000000000 +0200
++++ blender-2.63a.new//source/blender/imbuf/intern/util.c      2012-07-14 
01:07:31.213907334 +0200
+@@ -261,14 +261,14 @@
+               BLI_testextensie(filename, ".cin") ||
+               BLI_testextensie(filename, ".wav")) return 0;
+
+-      if (av_open_input_file(&pFormatCtx, filename, NULL, 0, NULL)!=0) {
++      if (avformat_open_input(&pFormatCtx, filename, NULL, NULL)!=0) {
+               if (UTIL_DEBUG) fprintf(stderr, "isffmpeg: av_open_input_file 
failed\n");
+               return 0;
+       }
+
+-      if (av_find_stream_info(pFormatCtx)<0) {
++      if (avformat_find_stream_info(pFormatCtx, NULL)<0) {
+               if (UTIL_DEBUG) fprintf(stderr, "isffmpeg: av_find_stream_info 
failed\n");
+-              av_close_input_file(pFormatCtx);
++              avformat_close_input(&pFormatCtx);
+               return 0;
+       }
+
+@@ -300,7 +300,7 @@
+               return 0;
+       }
+
+-      if (avcodec_open(pCodecCtx, pCodec)<0) {
++      if (avcodec_open2(pCodecCtx, pCodec, NULL)<0) {
+               av_close_input_file(pFormatCtx);
+               return 0;
+       }
+diff -urNb blender-2.63a.old//source/gameengine/VideoTexture/VideoFFmpeg.cpp 
blender-2.63a.new//source/gameengine/VideoTexture/VideoFFmpeg.cpp
+--- blender-2.63a.old//source/gameengine/VideoTexture/VideoFFmpeg.cpp  
2012-05-10 16:48:50.000000000 +0200
++++ blender-2.63a.new//source/gameengine/VideoTexture/VideoFFmpeg.cpp  
2012-07-13 21:22:36.464398523 +0200
+@@ -162,19 +162,19 @@
+ }
+
+
+-int VideoFFmpeg::openStream(const char *filename, AVInputFormat *inputFormat, 
AVFormatParameters *formatParams)
++int VideoFFmpeg::openStream(const char *filename, AVInputFormat *inputFormat, 
AVDictionary *opts)
+ {
+       AVFormatContext *formatCtx;
+       int                             i, videoStream;
+       AVCodec                 *codec;
+       AVCodecContext  *codecCtx;
+
+-      if (av_open_input_file(&formatCtx, filename, inputFormat, 0, 
formatParams)!=0)
++      if (avformat_open_input(&formatCtx, filename, inputFormat, &opts)!=0)
+               return -1;
+
+-      if (av_find_stream_info(formatCtx)<0)
++      if (avformat_find_stream_info(formatCtx, &opts)<0)
+       {
+-              av_close_input_file(formatCtx);
++              avformat_close_input(&formatCtx);
+               return -1;
+       }
+
+@@ -203,13 +203,13 @@
+       codec=avcodec_find_decoder(codecCtx->codec_id);
+       if (codec==NULL)
+       {
+-              av_close_input_file(formatCtx);
++              avformat_close_input(&formatCtx);
+               return -1;
+       }
+       codecCtx->workaround_bugs = 1;
+-      if (avcodec_open(codecCtx, codec)<0)
++      if (avcodec_open2(codecCtx, codec, &opts)<0)
+       {
+-              av_close_input_file(formatCtx);
++              avformat_close_input(&formatCtx);
+               return -1;
+       }
+
+@@ -546,7 +546,7 @@
+               // It would be good to find this information from the context 
but there are no simple indication
+               !strncmp(filename, "http://";, 7) ||
+ #ifdef FFMPEG_PB_IS_POINTER
+-              (m_formatCtx->pb && m_formatCtx->pb->is_streamed)
++              (m_formatCtx->pb && m_formatCtx->pb->seekable)
+ #else
+               m_formatCtx->pb.is_streamed
+ #endif
+@@ -586,13 +586,12 @@
+ {
+       // open camera source
+       AVInputFormat           *inputFormat;
+-      AVFormatParameters      formatParams;
++      AVDictionary            *opts = NULL;
+       AVRational                      frameRate;
+-      char                            *p, filename[28], rateStr[20];
++      char                            *p, filename[28], videoStr[20], 
rateStr[20];
+
+       do_init_ffmpeg();
+
+-      memset(&formatParams, 0, sizeof(formatParams));
+ #ifdef WIN32
+       // video capture on windows only through Video For Windows driver
+       inputFormat = av_find_input_format("vfwcap");
+@@ -637,21 +636,18 @@
+                       *p = 0;
+       }
+       if (file && (p = strchr(file, ':')) != NULL)
+-              formatParams.standard = p+1;
++              av_dict_set(&opts, "standard", p+1, 0);
+ #endif
+       //frame rate
+       if (m_captRate <= 0.f)
+               m_captRate = defFrameRate;
+       sprintf(rateStr, "%f", m_captRate);
+-      av_parse_video_rate(&frameRate, rateStr);
+-      // populate format parameters
+-      // need to specify the time base = inverse of rate
+-      formatParams.time_base.num = frameRate.den;
+-      formatParams.time_base.den = frameRate.num;
+-      formatParams.width = m_captWidth;
+-      formatParams.height = m_captHeight;
++      av_dict_set(&opts, "framerate", rateStr, 0);
++
++        sprintf(videoStr, "%dx%d", m_captWidth, m_captHeight);
++        av_dict_set(&opts, "video_size", videoStr, 0);
+
+-      if (openStream(filename, inputFormat, &formatParams) != 0)
++      if (openStream(filename, inputFormat, opts) != 0)
+               return;
+
+       // for video capture it is important to do non blocking read
+diff -urNb blender-2.63a.old//source/gameengine/VideoTexture/VideoFFmpeg.h 
blender-2.63a.new//source/gameengine/VideoTexture/VideoFFmpeg.h
+--- blender-2.63a.old//source/gameengine/VideoTexture/VideoFFmpeg.h    
2012-05-10 16:48:50.000000000 +0200
++++ blender-2.63a.new//source/gameengine/VideoTexture/VideoFFmpeg.h    
2012-07-13 21:22:36.463398523 +0200
+@@ -172,7 +172,7 @@
+       double actFrameRate (void) { return m_frameRate * m_baseFrameRate; }
+
+       /// common function to video file and capture
+-      int openStream(const char *filename, AVInputFormat *inputFormat, 
AVFormatParameters *formatParams);
++      int openStream(const char *filename, AVInputFormat *inputFormat, 
AVDictionary *opts);
+
+       /// check if a frame is available and load it in pFrame, return true if 
a frame could be retrieved
+       AVFrame* grabFrame(long frame);
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to