changeset 1930:dab5629c3361

upgrade package ffmpeg
author Mark Brand <mabrand@mabrand.nl>
date Mon, 11 Jul 2011 11:19:48 +0200
parents 278aa9fe8d7a
children f6a463c144b1
files src/ffmpeg.mk src/openscenegraph-2-ffmpeg-0.8.patch src/xine-lib-3-ffmpeg-0.8.patch
diffstat 3 files changed, 184 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/ffmpeg.mk	Mon Jul 11 07:53:17 2011 +0200
+++ b/src/ffmpeg.mk	Mon Jul 11 11:19:48 2011 +0200
@@ -4,8 +4,8 @@
 # ffmpeg
 PKG             := ffmpeg
 $(PKG)_IGNORE   :=
-$(PKG)_VERSION  := 0.7-rc1
-$(PKG)_CHECKSUM := d15c005f46483fbfc3b678cb1c89123762b56b82
+$(PKG)_VERSION  := 0.8
+$(PKG)_CHECKSUM := 461f87c4fc080e10ac0acc48287aaa706021bbc4
 $(PKG)_SUBDIR   := $(PKG)-$($(PKG)_VERSION)
 $(PKG)_FILE     := $(PKG)-$($(PKG)_VERSION).tar.bz2
 $(PKG)_WEBSITE  := http://www.ffmpeg.org/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/openscenegraph-2-ffmpeg-0.8.patch	Mon Jul 11 11:19:48 2011 +0200
@@ -0,0 +1,73 @@
+This file is part of mingw-cross-env.
+See doc/index.html for further information.
+
+Contains ad hoc patches for cross building.
+
+From 96c2a9b9f909399adde17e6851e08eb182c37e37 Mon Sep 17 00:00:00 2001
+From: mingw-cross-env
+Date: Mon, 11 Jul 2011 10:02:48 +0200
+Subject: [PATCH] Fix for compiling OSG with the latest FFmpeg
+
+Patch taken from:
+
+http://lists.openscenegraph.org/pipermail/osg-submissions-openscenegraph.org/2011-July/008462.html
+
+Hi Robert,
+
+I've found that the latest ffmpeg made some functions and macros
+deprecated, which led to compilation errors in the OSG plugin. I tried
+fixing them and tested with the version ffmpeg-git-5d4fd1d (ffmpeg
+version > 0.8, libavcodec = 53.7.0) under Windows.
+
+Cheers,
+
+Wang Rui
+
+diff --git a/src/osgPlugins/ffmpeg/FFmpegDecoder.cpp b/src/osgPlugins/ffmpeg/FFmpegDecoder.cpp
+index bd13085..1aa45fc 100644
+--- a/src/osgPlugins/ffmpeg/FFmpegDecoder.cpp
++++ b/src/osgPlugins/ffmpeg/FFmpegDecoder.cpp
+@@ -11,6 +11,20 @@
+ #include <string.h>
+ #include <iostream>
+ 
++// Changes for FFMpeg version greater than 0.6
++#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52, 64, 0)
++#define CODEC_TYPE_AUDIO AVMEDIA_TYPE_AUDIO
++#define CODEC_TYPE_VIDEO AVMEDIA_TYPE_VIDEO
++#endif
++
++#ifdef AVERROR
++#define AVERROR_IO AVERROR(EIO)
++#define AVERROR_NUMEXPECTED AVERROR(EDOM)
++#define AVERROR_NOMEM AVERROR(ENOMEM)
++#define AVERROR_NOFMT AVERROR(EILSEQ)
++#define AVERROR_NOTSUPP AVERROR(ENOSYS)
++#define AVERROR_NOENT AVERROR(ENOENT)
++#endif
+ 
+ namespace osgFFmpeg {
+ 
+diff --git a/src/osgPlugins/ffmpeg/FFmpegParameters.cpp b/src/osgPlugins/ffmpeg/FFmpegParameters.cpp
+index bfa1819..db1736b 100644
+--- a/src/osgPlugins/ffmpeg/FFmpegParameters.cpp
++++ b/src/osgPlugins/ffmpeg/FFmpegParameters.cpp
+@@ -5,6 +5,15 @@
+ #include <iostream>
+ #include <sstream>
+ 
++#if LIBAVCODEC_VERSION_MAJOR >= 53
++extern "C"
++{
++    #include <parseutils.h>
++}
++#define av_parse_video_frame_size av_parse_video_size
++#define av_parse_video_frame_rate av_parse_video_rate
++#endif
++
+ #if LIBAVCODEC_VERSION_MAJOR >= 53 || \
+     (LIBAVCODEC_VERSION_MAJOR==52 && LIBAVCODEC_VERSION_MINOR>=49)
+ 
+-- 
+1.7.6
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/xine-lib-3-ffmpeg-0.8.patch	Mon Jul 11 11:19:48 2011 +0200
@@ -0,0 +1,109 @@
+This file is part of mingw-cross-env.
+See doc/index.html for further information.
+
+This patch taken from:
+http://www.nntpnews.info/threads/20303026-packages-xine-lib-xine-lib.spec-xine-lib-xine-lib-ffmpeg-0.8.patch-%28NEW%29-UTF-8-Q-20-...
+
+diff -urN a/src/combined/ffmpeg/ff_audio_decoder.c b/src/combined/ffmpeg/ff_audio_decoder.c
+--- a/src/combined/ffmpeg/ff_audio_decoder.c	2010-03-23 16:41:49.000000000 +0100
++++ b/src/combined/ffmpeg/ff_audio_decoder.c	2011-07-11 10:48:48.967401526 +0200
+@@ -255,6 +255,7 @@
+       buf->decoder_info[2]);
+ 
+   } else if (!(buf->decoder_flags & BUF_FLAG_SPECIAL)) {
++ AVPacket avpkt;
+ 
+     if( !this->decoder_ok ) {
+       if ( ! this->context || ! this->codec ) {
+@@ -286,11 +287,13 @@
+     if (!this->output_open) {
+       if (!this->audio_bits || !this->audio_sample_rate || !this->audio_channels) {
+         decode_buffer_size = AVCODEC_MAX_AUDIO_FRAME_SIZE;
+-        avcodec_decode_audio2 (this->context,
+-                              (int16_t *)this->decode_buffer,
+-                              &decode_buffer_size,
+-                              &this->buf[0],
+-                              this->size);
++ av_init_packet(&avpkt);
++ avpkt.data = (uint8_t *)&this->buf[0];
++ avpkt.size = this->size;
++ avpkt.flags = AV_PKT_FLAG_KEY;
++ avcodec_decode_audio3 (this->context,
++ (int16_t *)this->decode_buffer,
++ &decode_buffer_size, &avpkt);
+ 	this->audio_bits = this->context->bits_per_sample;
+ 	this->audio_sample_rate = this->context->sample_rate;
+ 	this->audio_channels = this->context->channels;
+@@ -311,11 +314,13 @@
+       offset = 0;
+       while (this->size>0) {
+         decode_buffer_size = AVCODEC_MAX_AUDIO_FRAME_SIZE;
+-        bytes_consumed = avcodec_decode_audio2 (this->context,
+-                                               (int16_t *)this->decode_buffer,
+-                                               &decode_buffer_size,
+-                                               &this->buf[offset],
+-                                               this->size);
++ av_init_packet(&avpkt);
++ avpkt.data = (uint8_t *)&this->buf[offset];
++ avpkt.size = this->size;
++ avpkt.flags = AV_PKT_FLAG_KEY;
++ bytes_consumed = avcodec_decode_audio3 (this->context,
++ (int16_t *)this->decode_buffer,
++ &decode_buffer_size, &avpkt);
+ 
+         if (bytes_consumed<0) {
+           xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG,
+diff -urN a/src/combined/ffmpeg/ff_video_decoder.c b/src/combined/ffmpeg/ff_video_decoder.c
+--- a/src/combined/ffmpeg/ff_video_decoder.c	2010-03-10 20:07:15.000000000 +0100
++++ b/src/combined/ffmpeg/ff_video_decoder.c	2011-07-11 10:48:48.967401526 +0200
+@@ -1055,12 +1055,16 @@
+     }
+ 
+     /* skip decoding b frames if too late */
+-    this->context->hurry_up = (this->skipframes > 0);
++ this->context->skip_frame = (this->skipframes > 0) ? AVDISCARD_NONREF : AVDISCARD_DEFAULT;
+ 
+     lprintf("avcodec_decode_video: size=%d\n", this->mpeg_parser->buffer_size);
+-    len = avcodec_decode_video (this->context, this->av_frame,
+-                                &got_picture, this->mpeg_parser->chunk_buffer,
+-                                this->mpeg_parser->buffer_size);
++ AVPacket avpkt;
++ av_init_packet(&avpkt);
++ avpkt.data = (uint8_t *)this->mpeg_parser->chunk_buffer;
++ avpkt.size = this->mpeg_parser->buffer_size;
++ avpkt.flags = AV_PKT_FLAG_KEY;
++ len = avcodec_decode_video2 (this->context, this->av_frame,
++ &got_picture, &avpkt);
+     lprintf("avcodec_decode_video: decoded_size=%d, got_picture=%d\n",
+             len, got_picture);
+     len = current - buf->content - offset;
+@@ -1112,7 +1116,7 @@
+ 
+     } else {
+ 
+-      if (this->context->hurry_up) {
++ if (this->context->skip_frame != AVDISCARD_DEFAULT) {
+         /* skipped frame, output a bad frame */
+         img = this->stream->video_out->get_frame (this->stream->video_out,
+                                                   this->bih.biWidth,
+@@ -1304,12 +1308,16 @@
+         got_picture = 0;
+       } else {
+         /* skip decoding b frames if too late */
+-        this->context->hurry_up = (this->skipframes > 0);
++ this->context->skip_frame = (this->skipframes > 0) ? AVDISCARD_NONREF : AVDISCARD_DEFAULT;
+ 
+         lprintf("buffer size: %d\n", this->size);
+-        len = avcodec_decode_video (this->context, this->av_frame,
+-                                    &got_picture, &chunk_buf[offset],
+-                                    this->size);
++ AVPacket avpkt;
++ av_init_packet(&avpkt);
++ avpkt.data = (uint8_t *)&chunk_buf[offset];
++ avpkt.size = this->size;
++ avpkt.flags = AV_PKT_FLAG_KEY;
++ len = avcodec_decode_video2 (this->context, this->av_frame,
++ &got_picture, &avpkt);
+ 
+ #ifdef AVCODEC_HAS_REORDERED_OPAQUE
+         /* reset consumed pts value */