diff --git a/srcpkgs/xbmc/patches/010_all_ffmpeg-0.10.2-update.patch b/srcpkgs/xbmc/patches/010_all_ffmpeg-0.10.2-update.patch new file mode 100644 index 0000000000..19d3245b75 --- /dev/null +++ b/srcpkgs/xbmc/patches/010_all_ffmpeg-0.10.2-update.patch @@ -0,0 +1,728 @@ +commit 2836f95ad7d9425fc27c2de62b5c51e7829032f6 +Author: elupus +Date: Sun Mar 25 23:27:29 2012 +0200 + + Update ffmpeg to n0.10.2 (f139838d6473c7b5152178f602cb953a824c2ff9) + + xbmc ffmpeg 05f8b5549c5e20cf9a417069838edd6841d7bd40 + +diff --git a/lib/DllAvCodec.h b/lib/DllAvCodec.h +index 463ab48..0802236 100644 +--- a/lib/DllAvCodec.h ++++ b/lib/DllAvCodec.h +@@ -24,7 +24,7 @@ + #include "config.h" + #endif + #include "DynamicDll.h" +-#include "DllAvCore.h" ++#include "DllAvUtil.h" + #include "utils/log.h" + + extern "C" { +@@ -339,7 +339,7 @@ class DllAvCodec : public DllDynamic, DllAvCodecInterface + END_METHOD_RESOLVE() + + /* dependencies of libavcodec */ +- DllAvCore m_dllAvCore; ++ DllAvUtil m_dllAvUtil; + // DllAvUtil loaded implicitely by m_dllAvCore + + public: +@@ -361,7 +361,7 @@ public: + } + virtual bool Load() + { +- if (!m_dllAvCore.Load()) ++ if (!m_dllAvUtil.Load()) + return false; + return DllDynamic::Load(); + } +diff --git a/lib/DllAvCore.h b/lib/DllAvCore.h +deleted file mode 100644 +index 92a7ab7..0000000 +--- a/lib/DllAvCore.h ++++ /dev/null +@@ -1,182 +0,0 @@ +-#pragma once +-/* +- * Copyright (C) 2005-2010 Team XBMC +- * http://www.xbmc.org +- * +- * This Program is free software; you can redistribute it and/or modify +- * it under the terms of the GNU General Public License as published by +- * the Free Software Foundation; either version 2, or (at your option) +- * any later version. +- * +- * This Program is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- * GNU General Public License for more details. +- * +- * You should have received a copy of the GNU General Public License +- * along with XBMC; see the file COPYING. If not, write to the Free +- * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +- * Boston, MA 02110-1301, USA. +- * http://www.gnu.org/copyleft/gpl.html +- * +- */ +- +-#if (defined HAVE_CONFIG_H) && (!defined WIN32) +- #include "config.h" +-#endif +-#include "DynamicDll.h" +-#include "DllAvUtil.h" +-#include "utils/log.h" +- +-extern "C" { +-#ifdef USE_EXTERNAL_FFMPEG +- #ifdef HAVE_LIBAVUTIL_SAMPLEFMT_H +- // libavcore was merged to libavutil on 2010-02-15 +- #include +- #include +- #endif +- +- #ifdef HAVE_LIBAVCORE_AVCORE_H +- #include +- #endif +- #ifdef HAVE_LIBAVCORE_SAMPLEFMT_H +- #include +- #endif +- +- /* Needed for old FFmpeg versions as used below */ +- #ifdef HAVE_LIBAVCODEC_AVCODEC_H +- #include +- #else +- #include +- #endif +-#else +- #include "libavcore/avcore.h" +- #include "libavcore/samplefmt.h" +-#endif +-} +- +-/* Compatibility for old external FFmpeg versions. */ +- +-#ifdef USE_EXTERNAL_FFMPEG +- +-#ifndef LIBAVCORE_VERSION_INT +-// API added on: 2010-07-21, removed on 2010-02-15 +-#define LIBAVCORE_VERSION_INT 0 +-#endif +- +-#ifndef AV_SAMPLE_FMT_NONE +-// API added on: 2010-11-02 +-#define AVSampleFormat SampleFormat +-#define AV_SAMPLE_FMT_NONE SAMPLE_FMT_NONE +-#define AV_SAMPLE_FMT_U8 SAMPLE_FMT_U8 +-#define AV_SAMPLE_FMT_S16 SAMPLE_FMT_S16 +-#define AV_SAMPLE_FMT_S32 SAMPLE_FMT_S32 +-#define AV_SAMPLE_FMT_FLT SAMPLE_FMT_FLT +-#define AV_SAMPLE_FMT_DBL SAMPLE_FMT_DBL +-#endif +- +-#ifndef AV_CH_FRONT_LEFT +-// API added on: 2010-11-21 +-#define AV_CH_FRONT_LEFT CH_FRONT_LEFT +-#define AV_CH_FRONT_RIGHT CH_FRONT_RIGHT +-#define AV_CH_FRONT_CENTER CH_FRONT_CENTER +-#define AV_CH_LOW_FREQUENCY CH_LOW_FREQUENCY +-#define AV_CH_BACK_LEFT CH_BACK_LEFT +-#define AV_CH_BACK_RIGHT CH_BACK_RIGHT +-#define AV_CH_FRONT_LEFT_OF_CENTER CH_FRONT_LEFT_OF_CENTER +-#define AV_CH_FRONT_RIGHT_OF_CENTER CH_FRONT_RIGHT_OF_CENTER +-#define AV_CH_BACK_CENTER CH_BACK_CENTER +-#define AV_CH_SIDE_LEFT CH_SIDE_LEFT +-#define AV_CH_SIDE_RIGHT CH_SIDE_RIGHT +-#define AV_CH_TOP_CENTER CH_TOP_CENTER +-#define AV_CH_TOP_FRONT_LEFT CH_TOP_FRONT_LEFT +-#define AV_CH_TOP_FRONT_CENTER CH_TOP_FRONT_CENTER +-#define AV_CH_TOP_FRONT_RIGHT CH_TOP_FRONT_RIGHT +-#define AV_CH_TOP_BACK_LEFT CH_TOP_BACK_LEFT +-#define AV_CH_TOP_BACK_CENTER CH_TOP_BACK_CENTER +-#define AV_CH_TOP_BACK_RIGHT CH_TOP_BACK_RIGHT +-#define AV_CH_STEREO_LEFT CH_STEREO_LEFT +-#define AV_CH_STEREO_RIGHT CH_STEREO_RIGHT +- +-#define AV_CH_LAYOUT_NATIVE CH_LAYOUT_NATIVE +- +-#define AV_CH_LAYOUT_MONO CH_LAYOUT_MONO +-#define AV_CH_LAYOUT_STEREO CH_LAYOUT_STEREO +-#define AV_CH_LAYOUT_2_1 CH_LAYOUT_2_1 +-#define AV_CH_LAYOUT_SURROUND CH_LAYOUT_SURROUND +-#define AV_CH_LAYOUT_4POINT0 CH_LAYOUT_4POINT0 +-#define AV_CH_LAYOUT_2_2 CH_LAYOUT_2_2 +-#define AV_CH_LAYOUT_QUAD CH_LAYOUT_QUAD +-#define AV_CH_LAYOUT_5POINT0 CH_LAYOUT_5POINT0 +-#define AV_CH_LAYOUT_5POINT1 CH_LAYOUT_5POINT1 +-#define AV_CH_LAYOUT_5POINT0_BACK CH_LAYOUT_5POINT0_BACK +-#define AV_CH_LAYOUT_5POINT1_BACK CH_LAYOUT_5POINT1_BACK +-#define AV_CH_LAYOUT_7POINT0 CH_LAYOUT_7POINT0 +-#define AV_CH_LAYOUT_7POINT1 CH_LAYOUT_7POINT1 +-#define AV_CH_LAYOUT_7POINT1_WIDE CH_LAYOUT_7POINT1_WIDE +-#define AV_CH_LAYOUT_STEREO_DOWNMIX CH_LAYOUT_STEREO_DOWNMIX +-#endif +- +-#endif // USE_EXTERNAL_FFMPEG +- +-class DllAvCoreInterface +-{ +-public: +- virtual ~DllAvCoreInterface() {} +- virtual int av_get_bits_per_sample_fmt(enum AVSampleFormat sample_fmt) = 0; +-}; +- +-#if (defined USE_EXTERNAL_FFMPEG) +- +-// Use direct layer +-class DllAvCore : public DllDynamic, DllAvCoreInterface +-{ +-public: +- virtual ~DllAvCore() {} +-#if LIBAVCORE_VERSION_INT >= AV_VERSION_INT(0,12,0) || LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(50,38,0) +- // API added on: 2010-11-02, moved to libavutil on 2010-02-15 +- virtual int av_get_bits_per_sample_fmt(enum AVSampleFormat sample_fmt) { return ::av_get_bits_per_sample_fmt(sample_fmt); } +-#else +- // from avcodec.h +- virtual int av_get_bits_per_sample_fmt(enum AVSampleFormat sample_fmt) { return ::av_get_bits_per_sample_format(sample_fmt); } +-#endif +- +- // DLL faking. +- virtual bool ResolveExports() { return true; } +- virtual bool Load() { +-#if LIBAVCORE_VERSION_INT > 0 +- CLog::Log(LOGDEBUG, "DllAvCore: Using libavcore system library"); +-#endif +- return true; +- } +- virtual void Unload() {} +-}; +- +-#else +- +-class DllAvCore : public DllDynamic, DllAvCoreInterface +-{ +- DECLARE_DLL_WRAPPER(DllAvCore, DLL_PATH_LIBAVCORE) +- +- LOAD_SYMBOLS() +- +- DEFINE_METHOD1(int, av_get_bits_per_sample_fmt, (enum AVSampleFormat p1)) +- +- BEGIN_METHOD_RESOLVE() +- RESOLVE_METHOD(av_get_bits_per_sample_fmt) +- END_METHOD_RESOLVE() +- +- /* dependency of libavcore */ +- DllAvUtil m_dllAvUtil; +- +-public: +- virtual bool Load() +- { +- if (!m_dllAvUtil.Load()) +- return false; +- return DllDynamic::Load(); +- } +-}; +- +-#endif +- +diff --git a/lib/DllAvFilter.h b/lib/DllAvFilter.h +index 302e35c..1e308ac 100644 +--- a/lib/DllAvFilter.h ++++ b/lib/DllAvFilter.h +@@ -24,8 +24,8 @@ + #include "config.h" + #endif + #include "DynamicDll.h" +-#include "DllAvCore.h" + #include "DllAvCodec.h" ++#include "DllSwResample.h" + #include "utils/log.h" + + extern "C" { +@@ -61,6 +61,7 @@ extern "C" { + #endif + #else + #include "libavfilter/avfiltergraph.h" ++#define HAVE_AVFILTERBUFFERREFVIDEOPROPS_SAMPLE_ASPECT_RATIO + #endif + } + +@@ -264,6 +265,7 @@ class DllAvFilter : public DllDynamic, DllAvFilterInterface + + /* dependencies of libavfilter */ + DllAvUtil m_dllAvUtil; ++ DllSwResample m_dllSwResample; + + public: + int avfilter_open(AVFilterContext **filter_ctx, AVFilter *filter, const char *inst_name) +@@ -333,6 +335,8 @@ public: + { + if (!m_dllAvUtil.Load()) + return false; ++ if (!m_dllSwResample.Load()) ++ return false; + return DllDynamic::Load(); + } + }; + +diff --git a/lib/DllAvFormat.h b/lib/DllAvFormat.h +index 46a7481..0563486 100644 +--- a/lib/DllAvFormat.h ++++ b/lib/DllAvFormat.h +@@ -278,7 +278,7 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface + RESOLVE_METHOD(av_read_frame) + RESOLVE_METHOD(av_read_play) + RESOLVE_METHOD(av_read_pause) +- RESOLVE_METHOD_RENAME(ff_read_frame_flush, av_read_frame_flush) ++ RESOLVE_METHOD(av_read_frame_flush) + RESOLVE_METHOD(av_seek_frame) + RESOLVE_METHOD_RENAME(av_find_stream_info, av_find_stream_info_dont_call) + RESOLVE_METHOD(av_open_input_file) +@@ -319,7 +319,6 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface + + /* dependencies of libavformat */ + DllAvCodec m_dllAvCodec; +- // DllAvCore loaded implicitely by m_dllAvCodec + // DllAvUtil loaded implicitely by m_dllAvCodec + + public: +diff --git a/lib/DllAvUtil.h b/lib/DllAvUtil.h +index e882cac..f907834 100644 +--- a/lib/DllAvUtil.h ++++ b/lib/DllAvUtil.h +@@ -65,6 +65,7 @@ extern "C" { + #include "libavutil/opt.h" + #include "libavutil/mem.h" + #include "libavutil/fifo.h" ++ #include "libavutil/samplefmt.h" + #endif + } + +@@ -97,6 +98,7 @@ public: + virtual int av_fifo_generic_read(AVFifoBuffer *f, void *dest, int buf_size, void (*func)(void*, void*, int)) = 0; + virtual int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size, int (*func)(void*, void*, int)) = 0; + virtual char *av_strdup(const char *s)=0; ++ virtual int av_get_bits_per_sample_fmt(enum AVSampleFormat p1) = 0; + }; + + #if (defined USE_EXTERNAL_FFMPEG) +@@ -132,6 +134,8 @@ public: + virtual int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size, int (*func)(void*, void*, int)) + { return ::av_fifo_generic_write(f, src, size, func); } + virtual char *av_strdup(const char *s) { return ::av_strdup(s); } ++ virtual int av_get_bits_per_sample_fmt(enum AVSampleFormat p1) ++ { return ::av_get_bits_per_sample_fmt(p1); } + + // DLL faking. + virtual bool ResolveExports() { return true; } +@@ -168,6 +172,7 @@ class DllAvUtilBase : public DllDynamic, DllAvUtilInterface + DEFINE_METHOD4(int, av_fifo_generic_read, (AVFifoBuffer *p1, void *p2, int p3, void (*p4)(void*, void*, int))) + DEFINE_METHOD4(int, av_fifo_generic_write, (AVFifoBuffer *p1, void *p2, int p3, int (*p4)(void*, void*, int))) + DEFINE_METHOD1(char*, av_strdup, (const char *p1)) ++ DEFINE_METHOD1(int, av_get_bits_per_sample_fmt, (enum AVSampleFormat p1)) + + public: + BEGIN_METHOD_RESOLVE() +@@ -189,6 +194,7 @@ class DllAvUtilBase : public DllDynamic, DllAvUtilInterface + RESOLVE_METHOD(av_fifo_generic_read) + RESOLVE_METHOD(av_fifo_generic_write) + RESOLVE_METHOD(av_strdup) ++ RESOLVE_METHOD(av_get_bits_per_sample_fmt) + END_METHOD_RESOLVE() + }; + +diff --git a/lib/DllSwResample.h b/lib/DllSwResample.h +new file mode 100644 +index 0000000..a097387 +--- /dev/null ++++ b/lib/DllSwResample.h +@@ -0,0 +1,87 @@ ++#pragma once ++/* ++ * Copyright (C) 2005-2010 Team XBMC ++ * http://www.xbmc.org ++ * ++ * This Program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2, or (at your option) ++ * any later version. ++ * ++ * This Program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with XBMC; see the file COPYING. If not, write to ++ * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. ++ * http://www.gnu.org/copyleft/gpl.html ++ * ++ */ ++ ++#if (defined HAVE_CONFIG_H) && (!defined WIN32) ++ #include "config.h" ++#endif ++#include "DynamicDll.h" ++ ++extern "C" { ++#ifndef HAVE_MMX ++#define HAVE_MMX ++#endif ++#ifndef __STDC_CONSTANT_MACROS ++#define __STDC_CONSTANT_MACROS ++#endif ++#ifndef __GNUC__ ++#pragma warning(disable:4244) ++#endif ++#if (defined USE_EXTERNAL_FFMPEG) ++ #include ++#else ++ #include "libswresample/swresample.h" ++#endif ++} ++ ++ ++#if (defined USE_EXTERNAL_FFMPEG) ++ ++// Use direct mapping ++class DllSwResample : public DllDynamic ++{ ++public: ++ virtual ~DllSwResample() {} ++ ++ // DLL faking. ++ virtual bool ResolveExports() { return true; } ++ virtual bool Load() { ++ CLog::Log(LOGDEBUG, "DllAvFormat: Using libswresample system library"); ++ return true; ++ } ++ virtual void Unload() {} ++}; ++ ++#else ++ ++class DllSwResample : public DllDynamic ++{ ++ DECLARE_DLL_WRAPPER(DllSwResample, DLL_PATH_LIBSWRESAMPLE) ++ ++ LOAD_SYMBOLS() ++ ++ BEGIN_METHOD_RESOLVE() ++ END_METHOD_RESOLVE() ++ ++ /* dependencies of libavformat */ ++ DllAvUtil m_dllAvUtil; ++ ++public: ++ ++ virtual bool Load() ++ { ++ if (!m_dllAvUtil.Load()) ++ return false; ++ return DllDynamic::Load(); ++ } ++}; ++ ++#endif +diff --git a/lib/Makefile.in b/lib/Makefile.in +index 3550582..6b3da12 100644 +--- a/lib/Makefile.in ++++ b/lib/Makefile.in +@@ -17,6 +17,14 @@ SYSDIR=@abs_top_srcdir@/system/players/dvdplayer + WRAPPER=@abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper.o + WRAPPER_MACH_ALIAS=@abs_top_srcdir@/xbmc/cores/DllLoader/exports/wrapper_mach_alias + ++AVFORMAT_SO=avformat-53-$(ARCH).so ++AVCODEC_SO=avcodec-53-$(ARCH).so ++AVUTIL_SO=avutil-51-$(ARCH).so ++AVFILTER_SO=avfilter-2-$(ARCH).so ++SWSCALE_SO=swscale-2-$(ARCH).so ++POSTPROC_SO=postproc-52-$(ARCH).so ++SWRESAMPLE_SO=swresample-0-$(ARCH).so ++ + DIRS= + ifneq (@USE_EXTERNAL_FFMPEG@,1) + DIRS+=ffmpeg +@@ -24,13 +32,13 @@ endif + + LIBS= + ifneq (@USE_EXTERNAL_FFMPEG@,1) +- LIBS+=avutil-50-$(ARCH).so \ +- avcodec-52-$(ARCH).so \ +- avcore-0-$(ARCH).so \ +- avformat-52-$(ARCH).so \ +- postproc-51-$(ARCH).so \ +- avfilter-1-$(ARCH).so \ +- swscale-0-$(ARCH).so ++ LIBS+=$(AVUTIL_SO) \ ++ $(AVCODEC_SO) \ ++ $(AVFORMAT_SO) \ ++ $(POSTPROC_SO) \ ++ $(AVFILTER_SO) \ ++ $(SWSCALE_SO) \ ++ $(SWRESAMPLE_SO) + endif + + ifneq (,$(findstring powerpc,$(ARCH))) +@@ -54,90 +62,90 @@ ifeq ($(ARCH), powerpc-osx) + BUNDLE1_O = -lbundle1.o + endif + +-$(SYSDIR)/avutil-50-$(ARCH).so: $(WRAPPER) ffmpeg/libavutil/libavutil.dylib ++$(SYSDIR)/$(AVUTIL_SO): $(WRAPPER) ffmpeg/libavutil/libavutil.dylib + $(LD) $(LDFLAGS) -alias_list $(WRAPPER_MACH_ALIAS) -o $@ \ + $(WRAPPER) ffmpeg/libavutil/*.o \ + ffmpeg/libavutil/$(ARCH_DIR)/*.o $(BUNDLE1_O) + +-$(SYSDIR)/avcodec-52-$(ARCH).so: $(WRAPPER) ffmpeg/libavcodec/libavcodec.dylib ++$(SYSDIR)/$(AVCODEC_SO): $(WRAPPER) ffmpeg/libavcodec/libavcodec.dylib + $(LD) $(LDFLAGS) -alias_list $(WRAPPER_MACH_ALIAS) -o $@ \ + $(WRAPPER) ffmpeg/libavcodec/*.o \ + ffmpeg/libavcodec/$(ARCH_DIR)/*.o $(BUNDLE1_O) + +-$(SYSDIR)/avcore-0-$(ARCH).so: $(WRAPPER) ffmpeg/libavcore/libavcore.dylib +- $(LD) $(LDFLAGS) -alias_list $(WRAPPER_MACH_ALIAS) -o $@ \ +- $(WRAPPER) ffmpeg/libavcore/*.o $(BUNDLE1_O) +- +-$(SYSDIR)/avformat-52-$(ARCH).so: $(WRAPPER) ffmpeg/libavformat/libavformat.dylib ++$(SYSDIR)/$(AVFORMAT_SO): $(WRAPPER) ffmpeg/libavformat/libavformat.dylib + $(LD) $(LDFLAGS) -alias_list $(WRAPPER_MACH_ALIAS) -o $@ \ + $(WRAPPER) ffmpeg/libavformat/*.o $(BUNDLE1_O) + + ifeq ($(findstring x86,$(ARCH_DIR)), x86) +-$(SYSDIR)/avfilter-1-$(ARCH).so: $(WRAPPER) ffmpeg/libavfilter/libavfilter.dylib ++$(SYSDIR)/$(AVFILTER_SO): $(WRAPPER) ffmpeg/libavfilter/libavfilter.dylib + $(LD) $(LDFLAGS) -alias_list $(WRAPPER_MACH_ALIAS) -o $@ \ + $(WRAPPER) ffmpeg/libavfilter/$(ARCH_DIR)/*.o \ + ffmpeg/libavfilter/*.o $(BUNDLE1_O) + else # No libavfilter/ppc or libavfilter/arm +-$(SYSDIR)/avfilter-1-$(ARCH).so: $(WRAPPER) ffmpeg/libavfilter/libavfilter.dylib ++$(SYSDIR)/$(AVFILTER_SO): $(WRAPPER) ffmpeg/libavfilter/libavfilter.dylib + $(LD) $(LDFLAGS) -alias_list $(WRAPPER_MACH_ALIAS) -o $@ \ + $(WRAPPER) ffmpeg/libavfilter/*.o $(BUNDLE1_O) + endif + + ifneq ($(findstring arm,$(ARCH)), arm) +-$(SYSDIR)/swscale-0-$(ARCH).so: $(WRAPPER) ffmpeg/libswscale/libswscale.dylib ++$(SYSDIR)/$(SWSCALE_SO): $(WRAPPER) ffmpeg/libswscale/libswscale.dylib + $(LD) $(LDFLAGS) -alias_list $(WRAPPER_MACH_ALIAS) -o $@ \ + $(WRAPPER) ffmpeg/libswscale/*.o \ + ffmpeg/libswscale/$(ARCH_DIR)/*.o $(BUNDLE1_O) + else # No ARM version of swscale available yet. +-$(SYSDIR)/swscale-0-$(ARCH).so: $(WRAPPER) ffmpeg/libswscale/libswscale.dylib ++$(SYSDIR)/$(SWSCALE_SO): $(WRAPPER) ffmpeg/libswscale/libswscale.dylib + $(LD) $(LDFLAGS) -alias_list $(WRAPPER_MACH_ALIAS) -o $@ \ + $(WRAPPER) ffmpeg/libswscale/*.o + endif + +-$(SYSDIR)/postproc-51-$(ARCH).so: $(WRAPPER) ffmpeg/libpostproc/libpostproc.dylib ++$(SYSDIR)/$(POSTPROC_SO): $(WRAPPER) ffmpeg/libpostproc/libpostproc.dylib + $(LD) $(LDFLAGS) -alias_list $(WRAPPER_MACH_ALIAS) -o $@ \ + $(WRAPPER) ffmpeg/libpostproc/*.o $(BUNDLE1_O) + ++$(SYSDIR)/$(SWRESAMPLE_SO): $(WRAPPER) ffmpeg/libswresample/libswresample.dylib ++ $(LD) $(LDFLAGS) -alias_list $(WRAPPER_MACH_ALIAS) -o $@ \ ++ $(WRAPPER) ffmpeg/libswresample/*.o $(BUNDLE1_O) ++ + ffmpeg/libavutil/libavutil.dylib : ffmpeg; + ffmpeg/libavcodec/libavcodec.dylib : ffmpeg; +-ffmpeg/libavcore/libavcore.dylib : ffmpeg; + ffmpeg/libavformat/libavformat.dylib : ffmpeg; + ffmpeg/libavformat/libavfilter.dylib : ffmpeg; + ffmpeg/libswscale/libswscale.dylib : ffmpeg; + ffmpeg/libpostproc/libpostproc.dylib : ffmpeg; ++ffmpeg/libswresample/libswresample.dylib : ffmpeg; + ffmpeg: + $(MAKE) -C $@ + + else + +-$(SYSDIR)/avutil-50-$(ARCH).so: ffmpeg/libavutil/libavutil.so ++$(SYSDIR)/$(AVUTIL_SO): ffmpeg/libavutil/libavutil.so + cp ffmpeg/libavutil/libavutil.so $@ + +-$(SYSDIR)/avcodec-52-$(ARCH).so: $(WRAPPER) ffmpeg/libavcodec/libavcodec.so ++$(SYSDIR)/$(AVCODEC_SO): $(WRAPPER) ffmpeg/libavcodec/libavcodec.so + cp ffmpeg/libavcodec/libavcodec.so $@ + +-$(SYSDIR)/avcore-0-$(ARCH).so: $(WRAPPER) ffmpeg/libavcore/libavcore.so +- cp ffmpeg/libavcore/libavcore.so $@ +- +-$(SYSDIR)/avformat-52-$(ARCH).so: $(WRAPPER) ffmpeg/libavformat/libavformat.so ++$(SYSDIR)/$(AVFORMAT_SO): $(WRAPPER) ffmpeg/libavformat/libavformat.so + cp ffmpeg/libavformat/libavformat.so $@ + +-$(SYSDIR)/avfilter-1-$(ARCH).so: $(WRAPPER) ffmpeg/libavfilter/libavfilter.so ++$(SYSDIR)/$(AVFILTER_SO): $(WRAPPER) ffmpeg/libavfilter/libavfilter.so + cp ffmpeg/libavfilter/libavfilter.so $@ + +-$(SYSDIR)/swscale-0-$(ARCH).so: $(WRAPPER) ffmpeg/libswscale/libswscale.so ++$(SYSDIR)/$(SWSCALE_SO): $(WRAPPER) ffmpeg/libswscale/libswscale.so + cp ffmpeg/libswscale/libswscale.so $@ + +-$(SYSDIR)/postproc-51-$(ARCH).so: $(WRAPPER) ffmpeg/libpostproc/libpostproc.so ++$(SYSDIR)/$(POSTPROC_SO): $(WRAPPER) ffmpeg/libpostproc/libpostproc.so + cp ffmpeg/libpostproc/libpostproc.so $@ + ++$(SYSDIR)/$(SWRESAMPLE_SO): $(WRAPPER) ffmpeg/libswresample/libswresample.so ++ cp ffmpeg/libswresample/libswresample.so $@ ++ + ffmpeg/libavutil/libavutil.so : ffmpeg; + ffmpeg/libavcodec/libavcodec.so : ffmpeg; +-ffmpeg/libavcore/libavcore.so : ffmpeg; + ffmpeg/libavformat/libavformat.so : ffmpeg; + ffmpeg/libavfilter/libavfilter.so : ffmpeg; + ffmpeg/libswscale/libswscale.so : ffmpeg; + ffmpeg/libpostproc/libpostproc.so : ffmpeg; ++ffmpeg/libswresample/libswresample.so : ffmpeg; + ffmpeg: + $(MAKE) -C $@ + +diff --git a/project/Win32BuildSetup/buildmingwlibs.sh b/project/Win32BuildSetup/buildmingwlibs.sh +index 14ffb10..6fdb9a5 100644 +--- a/project/Win32BuildSetup/buildmingwlibs.sh ++++ b/project/Win32BuildSetup/buildmingwlibs.sh +@@ -64,7 +64,7 @@ echo "##### building ffmpeg dlls #####" + cd /xbmc/lib/ffmpeg/ + sh ./build_xbmc_win32.sh $MAKECLEAN + setfilepath /xbmc/system/players/dvdplayer +-checkfiles avcodec-52.dll avcore-0.dll avformat-52.dll avutil-50.dll postproc-51.dll swscale-0.dll avfilter-1.dll ++checkfiles avcodec-53.dll avformat-53.dll avutil-51.dll postproc-52.dll swscale-2.dll avfilter-2.dll swresample-0.dll + echo "##### building of ffmpeg dlls done #####" + + echo "##### building libdvd dlls #####" +diff --git a/xbmc/DllPaths_generated.h.in b/xbmc/DllPaths_generated.h.in +index a84dd52..10a7d87 100644 +--- a/xbmc/DllPaths_generated.h.in ++++ b/xbmc/DllPaths_generated.h.in +@@ -74,13 +74,13 @@ + #define DLL_PATH_LIBMAD "@MAD_SONAME@" + + /* ffmpeg */ +-#define DLL_PATH_LIBAVCODEC "special://xbmcbin/system/players/dvdplayer/avcodec-52-@ARCH@.so" +-#define DLL_PATH_LIBAVCORE "special://xbmcbin/system/players/dvdplayer/avcore-0-@ARCH@.so" +-#define DLL_PATH_LIBAVFORMAT "special://xbmcbin/system/players/dvdplayer/avformat-52-@ARCH@.so" +-#define DLL_PATH_LIBAVUTIL "special://xbmcbin/system/players/dvdplayer/avutil-50-@ARCH@.so" +-#define DLL_PATH_LIBPOSTPROC "special://xbmcbin/system/players/dvdplayer/postproc-51-@ARCH@.so" +-#define DLL_PATH_LIBSWSCALE "special://xbmcbin/system/players/dvdplayer/swscale-0-@ARCH@.so" +-#define DLL_PATH_LIBAVFILTER "special://xbmcbin/system/players/dvdplayer/avfilter-1-@ARCH@.so" ++#define DLL_PATH_LIBAVCODEC "special://xbmcbin/system/players/dvdplayer/avcodec-53-@ARCH@.so" ++#define DLL_PATH_LIBAVFORMAT "special://xbmcbin/system/players/dvdplayer/avformat-53-@ARCH@.so" ++#define DLL_PATH_LIBAVUTIL "special://xbmcbin/system/players/dvdplayer/avutil-51-@ARCH@.so" ++#define DLL_PATH_LIBPOSTPROC "special://xbmcbin/system/players/dvdplayer/postproc-52-@ARCH@.so" ++#define DLL_PATH_LIBSWSCALE "special://xbmcbin/system/players/dvdplayer/swscale-2-@ARCH@.so" ++#define DLL_PATH_LIBAVFILTER "special://xbmcbin/system/players/dvdplayer/avfilter-2-@ARCH@.so" ++#define DLL_PATH_LIBSWRESAMPLE "special://xbmcbin/system/players/dvdplayer/swresample-0-@ARCH@.so" + + /* cdrip */ + #if defined(_LINUX) && !defined(__APPLE__) +diff --git a/xbmc/DllPaths_win32.h b/xbmc/DllPaths_win32.h +index d39e2ea..fbd75a4 100644 +--- a/xbmc/DllPaths_win32.h ++++ b/xbmc/DllPaths_win32.h +@@ -58,13 +58,13 @@ + #define DLL_PATH_LIBRTMP "special://xbmcbin/system/players/dvdplayer/librtmp.dll" + + /* ffmpeg */ +-#define DLL_PATH_LIBAVCODEC "special://xbmcbin/system/players/dvdplayer/avcodec-52.dll" +-#define DLL_PATH_LIBAVCORE "special://xbmcbin/system/players/dvdplayer/avcore-0.dll" +-#define DLL_PATH_LIBAVFORMAT "special://xbmcbin/system/players/dvdplayer/avformat-52.dll" +-#define DLL_PATH_LIBAVUTIL "special://xbmcbin/system/players/dvdplayer/avutil-50.dll" +-#define DLL_PATH_LIBAVFILTER "special://xbmcbin/system/players/dvdplayer/avfilter-1.dll" +-#define DLL_PATH_LIBPOSTPROC "special://xbmcbin/system/players/dvdplayer/postproc-51.dll" +-#define DLL_PATH_LIBSWSCALE "special://xbmcbin/system/players/dvdplayer/swscale-0.dll" ++#define DLL_PATH_LIBAVCODEC "special://xbmcbin/system/players/dvdplayer/avcodec-53.dll" ++#define DLL_PATH_LIBAVFORMAT "special://xbmcbin/system/players/dvdplayer/avformat-53.dll" ++#define DLL_PATH_LIBAVUTIL "special://xbmcbin/system/players/dvdplayer/avutil-51.dll" ++#define DLL_PATH_LIBAVFILTER "special://xbmcbin/system/players/dvdplayer/avfilter-2.dll" ++#define DLL_PATH_LIBPOSTPROC "special://xbmcbin/system/players/dvdplayer/postproc-52.dll" ++#define DLL_PATH_LIBSWSCALE "special://xbmcbin/system/players/dvdplayer/swscale-2.dll" ++#define DLL_PATH_LIBSWRESAMPLE "special://xbmcbin/system/players/dvdplayer/swresample-0.dll" + + /* cdrip */ + #define DLL_PATH_LAME_ENC "special://xbmcbin/system/cdrip/lame_enc.dll" +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp +index cebba1c..6037781 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp +@@ -59,7 +59,7 @@ bool CDVDAudioCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options + AVCodec* pCodec; + m_bOpenedCodec = false; + +- if (!m_dllAvCore.Load() || !m_dllAvUtil.Load() || !m_dllAvCodec.Load()) ++ if (!m_dllAvUtil.Load() || !m_dllAvCodec.Load()) + return false; + + m_dllAvCodec.avcodec_register_all(); +@@ -186,7 +186,7 @@ int CDVDAudioCodecFFmpeg::Decode(BYTE* pData, int iSize) + + const void *ibuf[6] = { m_pBuffer1 }; + void *obuf[6] = { m_pBuffer2 }; +- int istr[6] = { m_dllAvCore.av_get_bits_per_sample_fmt(m_pCodecContext->sample_fmt)/8 }; ++ int istr[6] = { m_dllAvUtil.av_get_bits_per_sample_fmt(m_pCodecContext->sample_fmt)/8 }; + int ostr[6] = { 2 }; + int len = m_iBufferSize1 / istr[0]; + if(m_dllAvCodec.av_audio_convert(m_pConvert, obuf, ostr, ibuf, istr, len) < 0) +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.h b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.h +index dbd4948..0446213 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.h ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.h +@@ -23,7 +23,6 @@ + + #include "DVDAudioCodec.h" + #include "DllAvCodec.h" +-#include "DllAvCore.h" + #include "DllAvFormat.h" + #include "DllAvUtil.h" + +@@ -64,7 +63,6 @@ protected: + int64_t m_layout; + + DllAvCodec m_dllAvCodec; +- DllAvCore m_dllAvCore; + DllAvUtil m_dllAvUtil; + + void BuildChannelMap(); +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Audio/Encoders/DVDAudioEncoderFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Audio/Encoders/DVDAudioEncoderFFmpeg.cpp +index 77d4b64..6f30e11 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Audio/Encoders/DVDAudioEncoderFFmpeg.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Audio/Encoders/DVDAudioEncoderFFmpeg.cpp +@@ -55,7 +55,7 @@ CDVDAudioEncoderFFmpeg::~CDVDAudioEncoderFFmpeg() + bool CDVDAudioEncoderFFmpeg::Initialize(unsigned int channels, enum PCMChannels *channelMap, unsigned int bitsPerSample, unsigned int sampleRate) + { + Reset(); +- if (!channelMap || !m_dllAvUtil.Load() || !m_dllAvCore.Load() || !m_dllAvCodec.Load()) ++ if (!channelMap || !m_dllAvUtil.Load() || !m_dllAvCodec.Load()) + return false; + + m_dllAvCodec.avcodec_register_all(); +@@ -149,7 +149,7 @@ bool CDVDAudioEncoderFFmpeg::Initialize(unsigned int channels, enum PCMChannels + + if (m_AudioConvert) + m_TmpBuffer2 = new uint8_t[m_NeededFrames * m_CodecCtx->channels * +- m_dllAvCore.av_get_bits_per_sample_fmt(m_CodecCtx->sample_fmt) / 8]; ++ m_dllAvUtil.av_get_bits_per_sample_fmt(m_CodecCtx->sample_fmt) / 8]; + + return true; + } +@@ -186,7 +186,7 @@ int CDVDAudioEncoderFFmpeg::Encode(uint8_t *data, int size) + void *convInBuf[] = { m_TmpBuffer }; + int convInStr[] = { m_BitsPerSample / 8 }; + void *convOutBuf[] = { m_TmpBuffer2 }; +- int convOutStr[] = { m_dllAvCore.av_get_bits_per_sample_fmt(m_CodecCtx->sample_fmt) / 8 }; ++ int convOutStr[] = { m_dllAvUtil.av_get_bits_per_sample_fmt(m_CodecCtx->sample_fmt) / 8 }; + if (m_dllAvCodec.av_audio_convert(m_AudioConvert, convOutBuf, convOutStr, + convInBuf, convInStr, m_NeededFrames * m_CodecCtx->channels) < 0) { + CLog::Log(LOGERROR, "CDVDAudioEncoderFFmpeg: Audio conversion failed"); +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Audio/Encoders/DVDAudioEncoderFFmpeg.h b/xbmc/cores/dvdplayer/DVDCodecs/Audio/Encoders/DVDAudioEncoderFFmpeg.h +index 93bd2c7..40be42b 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Audio/Encoders/DVDAudioEncoderFFmpeg.h ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Audio/Encoders/DVDAudioEncoderFFmpeg.h +@@ -43,7 +43,6 @@ public: + virtual int GetData(uint8_t **data); + private: + DllAvCodec m_dllAvCodec; +- DllAvCore m_dllAvCore; + DllAvUtil m_dllAvUtil; + + AVCodecContext *m_CodecCtx; diff --git a/srcpkgs/xbmc/patches/020_all_thread_init.patch b/srcpkgs/xbmc/patches/020_all_thread_init.patch new file mode 100644 index 0000000000..fcfb0c166b --- /dev/null +++ b/srcpkgs/xbmc/patches/020_all_thread_init.patch @@ -0,0 +1,55 @@ +commit 4ee00c7c664e2fb1a3ea7f9969b1f89c4ce1f6dc +Author: elupus +Date: Tue Nov 1 20:36:59 2011 +0100 + + Don't use depreciated avcodec_thread_init + +diff --git a/lib/DllAvCodec.h b/lib/DllAvCodec.h +index 0802236..05edcb7 100644 +--- a/lib/DllAvCodec.h ++++ b/lib/DllAvCodec.h +@@ -137,7 +137,6 @@ public: + virtual enum PixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum PixelFormat *fmt)=0; + virtual int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic)=0; + virtual void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic)=0; +- virtual int avcodec_thread_init(AVCodecContext *s, int thread_count)=0; + virtual AVCodec *av_codec_next(AVCodec *c)=0; + virtual AVAudioConvert *av_audio_convert_alloc(enum AVSampleFormat out_fmt, int out_channels, + enum AVSampleFormat in_fmt , int in_channels, +@@ -225,7 +224,6 @@ public: + virtual int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic) { return ::avcodec_default_get_buffer(s, pic); } + virtual void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic) { ::avcodec_default_release_buffer(s, pic); } + virtual enum PixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum PixelFormat *fmt) { return ::avcodec_default_get_format(s, fmt); } +- virtual int avcodec_thread_init(AVCodecContext *s, int thread_count) { return ::avcodec_thread_init(s, thread_count); } + virtual AVCodec *av_codec_next(AVCodec *c) { return ::av_codec_next(c); } + virtual AVAudioConvert *av_audio_convert_alloc(enum AVSampleFormat out_fmt, int out_channels, + enum AVSampleFormat in_fmt , int in_channels, +@@ -290,7 +288,6 @@ class DllAvCodec : public DllDynamic, DllAvCodecInterface + DEFINE_METHOD2(void, avcodec_default_release_buffer, (AVCodecContext *p1, AVFrame *p2)) + DEFINE_METHOD2(enum PixelFormat, avcodec_default_get_format, (struct AVCodecContext *p1, const enum PixelFormat *p2)) + +- DEFINE_METHOD2(int, avcodec_thread_init, (AVCodecContext *p1, int p2)) + DEFINE_METHOD1(AVCodec*, av_codec_next, (AVCodec *p1)) + DEFINE_METHOD6(AVAudioConvert*, av_audio_convert_alloc, (enum AVSampleFormat p1, int p2, + enum AVSampleFormat p3, int p4, +@@ -328,7 +325,6 @@ class DllAvCodec : public DllDynamic, DllAvCodecInterface + RESOLVE_METHOD(avcodec_default_get_buffer) + RESOLVE_METHOD(avcodec_default_release_buffer) + RESOLVE_METHOD(avcodec_default_get_format) +- RESOLVE_METHOD(avcodec_thread_init) + RESOLVE_METHOD(av_codec_next) + RESOLVE_METHOD(av_audio_convert_alloc) + RESOLVE_METHOD(av_audio_convert_free) +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +index 9c8ff66..26bdb3a 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +@@ -279,7 +279,7 @@ bool CDVDVideoCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options + if( num_threads > 1 && !hints.software && m_pHardware == NULL // thumbnail extraction fails when run threaded + && ( pCodec->id == CODEC_ID_H264 + || pCodec->id == CODEC_ID_MPEG4 )) +- m_dllAvCodec.avcodec_thread_init(m_pCodecContext, num_threads); ++ m_pCodecContext->thread_count = num_threads; + + if (m_dllAvCodec.avcodec_open(m_pCodecContext, pCodec) < 0) + { diff --git a/srcpkgs/xbmc/patches/030_all_av_open_input.patch b/srcpkgs/xbmc/patches/030_all_av_open_input.patch new file mode 100644 index 0000000000..73880d111f --- /dev/null +++ b/srcpkgs/xbmc/patches/030_all_av_open_input.patch @@ -0,0 +1,87 @@ +commit 75eff0dd705d5afda3d39fa1ba9eb140b571b662 +Author: elupus +Date: Sat Sep 10 17:27:15 2011 +0200 + + replace depreciated av_open_input_stream/file with new avformat_open_input + +diff --git a/lib/DllAvFormat.h b/lib/DllAvFormat.h +index 0563486..9008cab 100644 +--- a/lib/DllAvFormat.h ++++ b/lib/DllAvFormat.h +@@ -74,9 +74,8 @@ public: + #if (!defined USE_EXTERNAL_FFMPEG) + virtual int av_find_stream_info_dont_call(AVFormatContext *ic)=0; + #endif +- virtual int av_open_input_file(AVFormatContext **ic_ptr, const char *filename, AVInputFormat *fmt, int buf_size, AVFormatParameters *ap)=0; + virtual void url_set_interrupt_cb(URLInterruptCB *interrupt_cb)=0; +- virtual int av_open_input_stream(AVFormatContext **ic_ptr, ByteIOContext *pb, const char *filename, AVInputFormat *fmt, AVFormatParameters *ap)=0; ++ virtual int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputFormat *fmt, AVDictionary **options)=0; + virtual int init_put_byte(ByteIOContext *s, unsigned char *buffer, int buffer_size, int write_flag, void *opaque, + int (*read_packet)(void *opaque, uint8_t *buf, int buf_size), + int (*write_packet)(void *opaque, uint8_t *buf, int buf_size), +@@ -145,9 +144,9 @@ public: + CSingleLock lock(DllAvCodec::m_critSection); + return ::av_find_stream_info(ic); + } +- virtual int av_open_input_file(AVFormatContext **ic_ptr, const char *filename, AVInputFormat *fmt, int buf_size, AVFormatParameters *ap) { return ::av_open_input_file(ic_ptr, filename, fmt, buf_size, ap); } + virtual void url_set_interrupt_cb(URLInterruptCB *interrupt_cb) { ::url_set_interrupt_cb(interrupt_cb); } +- virtual int av_open_input_stream(AVFormatContext **ic_ptr, ByteIOContext *pb, const char *filename, AVInputFormat *fmt, AVFormatParameters *ap) { return ::av_open_input_stream(ic_ptr, pb, filename, fmt, ap); } ++ virtual int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputFormat *fmt, AVDictionary **options) ++ { return ::avformat_open_input(ps, filename, fmt, opt, ap); } + virtual int init_put_byte(ByteIOContext *s, unsigned char *buffer, int buffer_size, int write_flag, void *opaque, + int (*read_packet)(void *opaque, uint8_t *buf, int buf_size), + int (*write_packet)(void *opaque, uint8_t *buf, int buf_size), +@@ -228,8 +227,7 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface + DEFINE_FUNC_ALIGNED2(int, __cdecl, av_read_frame, AVFormatContext *, AVPacket *) + DEFINE_FUNC_ALIGNED4(int, __cdecl, av_seek_frame, AVFormatContext*, int, int64_t, int) + DEFINE_FUNC_ALIGNED1(int, __cdecl, av_find_stream_info_dont_call, AVFormatContext*) +- DEFINE_FUNC_ALIGNED5(int, __cdecl, av_open_input_file, AVFormatContext**, const char *, AVInputFormat *, int, AVFormatParameters *) +- DEFINE_FUNC_ALIGNED5(int,__cdecl, av_open_input_stream, AVFormatContext **, ByteIOContext *, const char *, AVInputFormat *, AVFormatParameters *) ++ DEFINE_FUNC_ALIGNED4(int, __cdecl, avformat_open_input, AVFormatContext **, const char *, AVInputFormat *, AVDictionary **) + DEFINE_FUNC_ALIGNED2(AVInputFormat*, __cdecl, av_probe_input_format, AVProbeData*, int) + DEFINE_FUNC_ALIGNED3(AVInputFormat*, __cdecl, av_probe_input_format2, AVProbeData*, int, int*) + DEFINE_FUNC_ALIGNED6(int, __cdecl, av_probe_input_buffer, ByteIOContext *, AVInputFormat **, const char *, void *, unsigned int, unsigned int) +@@ -281,9 +279,8 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface + RESOLVE_METHOD(av_read_frame_flush) + RESOLVE_METHOD(av_seek_frame) + RESOLVE_METHOD_RENAME(av_find_stream_info, av_find_stream_info_dont_call) +- RESOLVE_METHOD(av_open_input_file) + RESOLVE_METHOD(url_set_interrupt_cb) +- RESOLVE_METHOD(av_open_input_stream) ++ RESOLVE_METHOD(avformat_open_input) + RESOLVE_METHOD(init_put_byte) + RESOLVE_METHOD(av_probe_input_format) + RESOLVE_METHOD(av_probe_input_format2) +diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +index 46287a8..f0ce468 100644 +--- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp ++++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +@@ -284,14 +284,14 @@ bool CDVDDemuxFFmpeg::Open(CDVDInputStream* pInput) + // try mmsh, then mmst + CStdString strFile2; + strFile2.Format("mmsh://%s",strFile.substr(6,strFile.size()-6).c_str()); +- result = m_dllAvFormat.av_open_input_file(&m_pFormatContext, strFile2.c_str(), iformat, FFMPEG_FILE_BUFFER_SIZE, NULL); ++ result = m_dllAvFormat.avformat_open_input(&m_pFormatContext, strFile2.c_str(), iformat, NULL); + if (result < 0) + { + strFile = "mmst://"; + strFile += strFile2.Mid(7).c_str(); + } + } +- if (result < 0 && m_dllAvFormat.av_open_input_file(&m_pFormatContext, strFile.c_str(), iformat, FFMPEG_FILE_BUFFER_SIZE, NULL) < 0 ) ++ if (result < 0 && m_dllAvFormat.avformat_open_input(&m_pFormatContext, strFile.c_str(), iformat, NULL) < 0 ) + { + CLog::Log(LOGDEBUG, "Error, could not open file %s", strFile.c_str()); + Dispose(); +@@ -424,7 +424,10 @@ bool CDVDDemuxFFmpeg::Open(CDVDInputStream* pInput) + + + // open the demuxer +- if (m_dllAvFormat.av_open_input_stream(&m_pFormatContext, m_ioContext, strFile.c_str(), iformat, NULL) < 0) ++ m_pFormatContext = m_dllAvFormat.avformat_alloc_context(); ++ m_pFormatContext->pb = m_ioContext; ++ ++ if (m_dllAvFormat.avformat_open_input(&m_pFormatContext, strFile.c_str(), iformat, NULL) < 0) + { + CLog::Log(LOGERROR, "%s - Error, could not open file %s", __FUNCTION__, strFile.c_str()); + Dispose(); diff --git a/srcpkgs/xbmc/patches/040_all_aviocontext.patch b/srcpkgs/xbmc/patches/040_all_aviocontext.patch new file mode 100644 index 0000000000..701c80e74b --- /dev/null +++ b/srcpkgs/xbmc/patches/040_all_aviocontext.patch @@ -0,0 +1,208 @@ +commit 564d77c6a6773388e0c1e0b5a44a25bfe49dfb3d +Author: elupus +Date: Sat Sep 10 17:29:45 2011 +0200 + + replace depreciated ByteIOContext with AVIOContext + +diff --git a/lib/DllAvFormat.h b/lib/DllAvFormat.h +index 9008cab..dc036c7 100644 +--- a/lib/DllAvFormat.h ++++ b/lib/DllAvFormat.h +@@ -62,7 +62,7 @@ public: + virtual ~DllAvFormatInterface() {} + virtual void av_register_all_dont_call(void)=0; + virtual AVInputFormat *av_find_input_format(const char *short_name)=0; +- virtual int url_feof(ByteIOContext *s)=0; ++ virtual int url_feof(AVIOContext *s)=0; + virtual AVMetadataTag *av_metadata_get(AVMetadata *m, const char *key, const AVMetadataTag *prev, int flags)=0; + virtual void av_close_input_file(AVFormatContext *s)=0; + virtual void av_close_input_stream(AVFormatContext *s)=0; +@@ -76,32 +76,32 @@ public: + #endif + virtual void url_set_interrupt_cb(URLInterruptCB *interrupt_cb)=0; + virtual int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputFormat *fmt, AVDictionary **options)=0; +- virtual int init_put_byte(ByteIOContext *s, unsigned char *buffer, int buffer_size, int write_flag, void *opaque, ++ virtual int init_put_byte(AVIOContext *s, unsigned char *buffer, int buffer_size, int write_flag, void *opaque, + int (*read_packet)(void *opaque, uint8_t *buf, int buf_size), + int (*write_packet)(void *opaque, uint8_t *buf, int buf_size), + offset_t (*seek)(void *opaque, offset_t offset, int whence))=0; + virtual AVInputFormat *av_probe_input_format(AVProbeData *pd, int is_opened)=0; + virtual AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score_max)=0; +- virtual int av_probe_input_buffer(ByteIOContext *pb, AVInputFormat **fmt, const char *filename, void *logctx, unsigned int offset, unsigned int max_probe_size)=0; ++ virtual int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt, const char *filename, void *logctx, unsigned int offset, unsigned int max_probe_size)=0; + virtual void dump_format(AVFormatContext *ic, int index, const char *url, int is_output)=0; +- virtual int url_fdopen(ByteIOContext **s, URLContext *h)=0; +- virtual int url_fopen(ByteIOContext **s, const char *filename, int flags)=0; +- virtual int url_fclose(ByteIOContext *s)=0; +- virtual int url_open_dyn_buf(ByteIOContext **s)=0; +- virtual int url_close_dyn_buf(ByteIOContext *s, uint8_t **pbuffer)=0; +- virtual offset_t url_fseek(ByteIOContext *s, offset_t offset, int whence)=0; +- virtual int get_buffer(ByteIOContext *s, unsigned char *buf, int size)=0; +- virtual int get_partial_buffer(ByteIOContext *s, unsigned char *buf, int size)=0; +- virtual void put_byte(ByteIOContext *s, int b)=0; +- virtual void put_buffer(ByteIOContext *s, const unsigned char *buf, int size)=0; +- virtual void put_be24(ByteIOContext *s, unsigned int val)=0; +- virtual void put_be32(ByteIOContext *s, unsigned int val)=0; +- virtual void put_be16(ByteIOContext *s, unsigned int val)=0; ++ virtual int url_fdopen(AVIOContext **s, URLContext *h)=0; ++ virtual int url_fopen(AVIOContext **s, const char *filename, int flags)=0; ++ virtual int url_fclose(AVIOContext *s)=0; ++ virtual int url_open_dyn_buf(AVIOContext **s)=0; ++ virtual int url_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer)=0; ++ virtual offset_t url_fseek(AVIOContext *s, offset_t offset, int whence)=0; ++ virtual int get_buffer(AVIOContext *s, unsigned char *buf, int size)=0; ++ virtual int get_partial_buffer(AVIOContext *s, unsigned char *buf, int size)=0; ++ virtual void put_byte(AVIOContext *s, int b)=0; ++ virtual void put_buffer(AVIOContext *s, const unsigned char *buf, int size)=0; ++ virtual void put_be24(AVIOContext *s, unsigned int val)=0; ++ virtual void put_be32(AVIOContext *s, unsigned int val)=0; ++ virtual void put_be16(AVIOContext *s, unsigned int val)=0; + virtual AVFormatContext *avformat_alloc_context(void)=0; + virtual AVStream *av_new_stream(AVFormatContext *s, int id)=0; + virtual AVOutputFormat *av_guess_format(const char *short_name, const char *filename, const char *mime_type)=0; + virtual int av_set_parameters(AVFormatContext *s, AVFormatParameters *ap)=0; +- virtual ByteIOContext *av_alloc_put_byte(unsigned char *buffer, int buffer_size, int write_flag, void *opaque, ++ virtual AVIOContext *av_alloc_put_byte(unsigned char *buffer, int buffer_size, int write_flag, void *opaque, + int (*read_packet)(void *opaque, uint8_t *buf, int buf_size), + int (*write_packet)(void *opaque, uint8_t *buf, int buf_size), + offset_t (*seek)(void *opaque, offset_t offset, int whence))=0; +@@ -125,7 +125,7 @@ public: + } + virtual void av_register_all_dont_call() { *(int* )0x0 = 0; } + virtual AVInputFormat *av_find_input_format(const char *short_name) { return ::av_find_input_format(short_name); } +- virtual int url_feof(ByteIOContext *s) { return ::url_feof(s); } ++ virtual int url_feof(AVIOContext *s) { return ::url_feof(s); } + #if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(52,31,0) + // API added on: 2009-03-01 + virtual AVMetadataTag *av_metadata_get(AVMetadata *m, const char *key, const AVMetadataTag *prev, int flags){ return ::av_metadata_get(m, key, prev, flags); } +@@ -147,7 +147,7 @@ public: + virtual void url_set_interrupt_cb(URLInterruptCB *interrupt_cb) { ::url_set_interrupt_cb(interrupt_cb); } + virtual int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputFormat *fmt, AVDictionary **options) + { return ::avformat_open_input(ps, filename, fmt, opt, ap); } +- virtual int init_put_byte(ByteIOContext *s, unsigned char *buffer, int buffer_size, int write_flag, void *opaque, ++ virtual int init_put_byte(AVIOContext *s, unsigned char *buffer, int buffer_size, int write_flag, void *opaque, + int (*read_packet)(void *opaque, uint8_t *buf, int buf_size), + int (*write_packet)(void *opaque, uint8_t *buf, int buf_size), + offset_t (*seek)(void *opaque, offset_t offset, int whence)) { return ::init_put_byte(s, buffer, buffer_size, write_flag, opaque, read_packet, write_packet, seek); } +@@ -155,24 +155,24 @@ public: + virtual AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score_max) {*score_max = 100; return ::av_probe_input_format(pd, is_opened); } // Use av_probe_input_format, this is not exported by ffmpeg's headers + #if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(52,98,0) + // API added on: 2010-02-08 +- virtual int av_probe_input_buffer(ByteIOContext *pb, AVInputFormat **fmt, const char *filename, void *logctx, unsigned int offset, unsigned int max_probe_size) { return ::av_probe_input_buffer(pb, fmt, filename, logctx, offset, max_probe_size); } ++ virtual int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt, const char *filename, void *logctx, unsigned int offset, unsigned int max_probe_size) { return ::av_probe_input_buffer(pb, fmt, filename, logctx, offset, max_probe_size); } + #else +- virtual int av_probe_input_buffer(ByteIOContext *pb, AVInputFormat **fmt, const char *filename, void *logctx, unsigned int offset, unsigned int max_probe_size) { return -1; } ++ virtual int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt, const char *filename, void *logctx, unsigned int offset, unsigned int max_probe_size) { return -1; } + #endif + virtual void dump_format(AVFormatContext *ic, int index, const char *url, int is_output) { ::dump_format(ic, index, url, is_output); } +- virtual int url_fdopen(ByteIOContext **s, URLContext *h) { return ::url_fdopen(s, h); } +- virtual int url_fopen(ByteIOContext **s, const char *filename, int flags) { return ::url_fopen(s, filename, flags); } +- virtual int url_fclose(ByteIOContext *s) { return ::url_fclose(s); } +- virtual int url_open_dyn_buf(ByteIOContext **s) { return ::url_open_dyn_buf(s); } +- virtual int url_close_dyn_buf(ByteIOContext *s, uint8_t **pbuffer) { return ::url_close_dyn_buf(s, pbuffer); } +- virtual offset_t url_fseek(ByteIOContext *s, offset_t offset, int whence) { return ::url_fseek(s, offset, whence); } +- virtual int get_buffer(ByteIOContext *s, unsigned char *buf, int size) { return ::get_buffer(s, buf, size); } +- virtual int get_partial_buffer(ByteIOContext *s, unsigned char *buf, int size) { return ::get_partial_buffer(s, buf, size); } +- virtual void put_byte(ByteIOContext *s, int b) { ::put_byte(s, b); } +- virtual void put_buffer(ByteIOContext *s, const unsigned char *buf, int size) { ::put_buffer(s, buf, size); } +- virtual void put_be24(ByteIOContext *s, unsigned int val) { ::put_be24(s, val); } +- virtual void put_be32(ByteIOContext *s, unsigned int val) { ::put_be32(s, val); } +- virtual void put_be16(ByteIOContext *s, unsigned int val) { ::put_be16(s, val); } ++ virtual int url_fdopen(AVIOContext **s, URLContext *h) { return ::url_fdopen(s, h); } ++ virtual int url_fopen(AVIOContext **s, const char *filename, int flags) { return ::url_fopen(s, filename, flags); } ++ virtual int url_fclose(AVIOContext *s) { return ::url_fclose(s); } ++ virtual int url_open_dyn_buf(AVIOContext **s) { return ::url_open_dyn_buf(s); } ++ virtual int url_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer) { return ::url_close_dyn_buf(s, pbuffer); } ++ virtual offset_t url_fseek(AVIOContext *s, offset_t offset, int whence) { return ::url_fseek(s, offset, whence); } ++ virtual int get_buffer(AVIOContext *s, unsigned char *buf, int size) { return ::get_buffer(s, buf, size); } ++ virtual int get_partial_buffer(AVIOContext *s, unsigned char *buf, int size) { return ::get_partial_buffer(s, buf, size); } ++ virtual void put_byte(AVIOContext *s, int b) { ::put_byte(s, b); } ++ virtual void put_buffer(AVIOContext *s, const unsigned char *buf, int size) { ::put_buffer(s, buf, size); } ++ virtual void put_be24(AVIOContext *s, unsigned int val) { ::put_be24(s, val); } ++ virtual void put_be32(AVIOContext *s, unsigned int val) { ::put_be32(s, val); } ++ virtual void put_be16(AVIOContext *s, unsigned int val) { ::put_be16(s, val); } + virtual AVFormatContext *avformat_alloc_context() { return ::avformat_alloc_context(); } + virtual AVStream *av_new_stream(AVFormatContext *s, int id) { return ::av_new_stream(s, id); } + #if LIBAVFORMAT_VERSION_INT < (52<<16 | 45<<8) +@@ -181,7 +181,7 @@ public: + virtual AVOutputFormat *av_guess_format(const char *short_name, const char *filename, const char *mime_type) { return ::av_guess_format(short_name, filename, mime_type); } + #endif + virtual int av_set_parameters(AVFormatContext *s, AVFormatParameters *ap) { return ::av_set_parameters(s, ap); } +- virtual ByteIOContext *av_alloc_put_byte(unsigned char *buffer, int buffer_size, int write_flag, void *opaque, ++ virtual AVIOContext *av_alloc_put_byte(unsigned char *buffer, int buffer_size, int write_flag, void *opaque, + int (*read_packet)(void *opaque, uint8_t *buf, int buf_size), + int (*write_packet)(void *opaque, uint8_t *buf, int buf_size), + offset_t (*seek)(void *opaque, offset_t offset, int whence)) { return ::av_alloc_put_byte(buffer, buffer_size, write_flag, opaque, read_packet, write_packet, seek); } +@@ -217,7 +217,7 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface + + DEFINE_METHOD0(void, av_register_all_dont_call) + DEFINE_METHOD1(AVInputFormat*, av_find_input_format, (const char *p1)) +- DEFINE_METHOD1(int, url_feof, (ByteIOContext *p1)) ++ DEFINE_METHOD1(int, url_feof, (AVIOContext *p1)) + DEFINE_METHOD4(AVMetadataTag*, av_metadata_get, (AVMetadata *p1, const char *p2, const AVMetadataTag *p3, int p4)) + DEFINE_METHOD1(void, av_close_input_file, (AVFormatContext *p1)) + DEFINE_METHOD1(void, av_close_input_stream, (AVFormatContext *p1)) +@@ -230,26 +230,26 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface + DEFINE_FUNC_ALIGNED4(int, __cdecl, avformat_open_input, AVFormatContext **, const char *, AVInputFormat *, AVDictionary **) + DEFINE_FUNC_ALIGNED2(AVInputFormat*, __cdecl, av_probe_input_format, AVProbeData*, int) + DEFINE_FUNC_ALIGNED3(AVInputFormat*, __cdecl, av_probe_input_format2, AVProbeData*, int, int*) +- DEFINE_FUNC_ALIGNED6(int, __cdecl, av_probe_input_buffer, ByteIOContext *, AVInputFormat **, const char *, void *, unsigned int, unsigned int) +- DEFINE_FUNC_ALIGNED3(int, __cdecl, get_buffer, ByteIOContext*, unsigned char *, int) +- DEFINE_FUNC_ALIGNED3(int, __cdecl, get_partial_buffer, ByteIOContext*, unsigned char *, int) +- DEFINE_FUNC_ALIGNED2(void, __cdecl, put_byte, ByteIOContext*, int) +- DEFINE_FUNC_ALIGNED3(void, __cdecl, put_buffer, ByteIOContext*, const unsigned char *, int) +- DEFINE_FUNC_ALIGNED2(void, __cdecl, put_be24, ByteIOContext*, unsigned int) +- DEFINE_FUNC_ALIGNED2(void, __cdecl, put_be32, ByteIOContext*, unsigned int) +- DEFINE_FUNC_ALIGNED2(void, __cdecl, put_be16, ByteIOContext*, unsigned int) ++ DEFINE_FUNC_ALIGNED6(int, __cdecl, av_probe_input_buffer, AVIOContext *, AVInputFormat **, const char *, void *, unsigned int, unsigned int) ++ DEFINE_FUNC_ALIGNED3(int, __cdecl, get_buffer, AVIOContext*, unsigned char *, int) ++ DEFINE_FUNC_ALIGNED3(int, __cdecl, get_partial_buffer, AVIOContext*, unsigned char *, int) ++ DEFINE_FUNC_ALIGNED2(void, __cdecl, put_byte, AVIOContext*, int) ++ DEFINE_FUNC_ALIGNED3(void, __cdecl, put_buffer, AVIOContext*, const unsigned char *, int) ++ DEFINE_FUNC_ALIGNED2(void, __cdecl, put_be24, AVIOContext*, unsigned int) ++ DEFINE_FUNC_ALIGNED2(void, __cdecl, put_be32, AVIOContext*, unsigned int) ++ DEFINE_FUNC_ALIGNED2(void, __cdecl, put_be16, AVIOContext*, unsigned int) + DEFINE_METHOD1(void, url_set_interrupt_cb, (URLInterruptCB *p1)) +- DEFINE_METHOD8(int, init_put_byte, (ByteIOContext *p1, unsigned char *p2, int p3, int p4, void *p5, ++ DEFINE_METHOD8(int, init_put_byte, (AVIOContext *p1, unsigned char *p2, int p3, int p4, void *p5, + int (*p6)(void *opaque, uint8_t *buf, int buf_size), + int (*p7)(void *opaque, uint8_t *buf, int buf_size), + offset_t (*p8)(void *opaque, offset_t offset, int whence))) + DEFINE_METHOD4(void, dump_format, (AVFormatContext *p1, int p2, const char *p3, int p4)) +- DEFINE_METHOD2(int, url_fdopen, (ByteIOContext **p1, URLContext *p2)) +- DEFINE_METHOD3(int, url_fopen, (ByteIOContext **p1, const char *p2, int p3)) +- DEFINE_METHOD1(int, url_fclose, (ByteIOContext *p1)) +- DEFINE_METHOD1(int, url_open_dyn_buf, (ByteIOContext **p1)) +- DEFINE_METHOD2(int, url_close_dyn_buf, (ByteIOContext *p1, uint8_t **p2)) +- DEFINE_METHOD3(offset_t, url_fseek, (ByteIOContext *p1, offset_t p2, int p3)) ++ DEFINE_METHOD2(int, url_fdopen, (AVIOContext **p1, URLContext *p2)) ++ DEFINE_METHOD3(int, url_fopen, (AVIOContext **p1, const char *p2, int p3)) ++ DEFINE_METHOD1(int, url_fclose, (AVIOContext *p1)) ++ DEFINE_METHOD1(int, url_open_dyn_buf, (AVIOContext **p1)) ++ DEFINE_METHOD2(int, url_close_dyn_buf, (AVIOContext *p1, uint8_t **p2)) ++ DEFINE_METHOD3(offset_t, url_fseek, (AVIOContext *p1, offset_t p2, int p3)) + DEFINE_METHOD0(AVFormatContext *, avformat_alloc_context) + DEFINE_METHOD2(AVStream *, av_new_stream, (AVFormatContext *p1, int p2)) + #if LIBAVFORMAT_VERSION_INT < (52<<16 | 45<<8) +@@ -258,7 +258,7 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface + DEFINE_METHOD3(AVOutputFormat *, av_guess_format, (const char *p1, const char *p2, const char *p3)) + #endif + DEFINE_METHOD2(int, av_set_parameters, (AVFormatContext *p1, AVFormatParameters *p2)); +- DEFINE_METHOD7(ByteIOContext *, av_alloc_put_byte, (unsigned char *p1, int p2, int p3, void *p4, ++ DEFINE_METHOD7(AVIOContext *, av_alloc_put_byte, (unsigned char *p1, int p2, int p3, void *p4, + int(*p5)(void *opaque, uint8_t *buf, int buf_size), + int(*p6)(void *opaque, uint8_t *buf, int buf_size), + offset_t(*p7)(void *opaque, offset_t offset, int whence))) +diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.h b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.h +index 018d9b3..84ea4b7 100644 +--- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.h ++++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.h +@@ -128,7 +128,7 @@ protected: + #define MAX_STREAMS 100 + CDemuxStream* m_streams[MAX_STREAMS]; // maximum number of streams that ffmpeg can handle + +- ByteIOContext* m_ioContext; ++ AVIOContext* m_ioContext; + + DllAvFormat m_dllAvFormat; + DllAvCodec m_dllAvCodec; diff --git a/srcpkgs/xbmc/patches/050_all_avdict.patch b/srcpkgs/xbmc/patches/050_all_avdict.patch new file mode 100644 index 0000000000..5e00e7cb92 --- /dev/null +++ b/srcpkgs/xbmc/patches/050_all_avdict.patch @@ -0,0 +1,105 @@ +commit fb3b3a2e36aa88b312b5519295ee59040ebed986 +Author: elupus +Date: Sat Sep 10 17:33:33 2011 +0200 + + replace depreciated AVMetadata(Tag) with AVDictionary(Entry) + +diff --git a/lib/DllAvFormat.h b/lib/DllAvFormat.h +index dc036c7..9acdae7 100644 +--- a/lib/DllAvFormat.h ++++ b/lib/DllAvFormat.h +@@ -63,7 +63,7 @@ public: + virtual void av_register_all_dont_call(void)=0; + virtual AVInputFormat *av_find_input_format(const char *short_name)=0; + virtual int url_feof(AVIOContext *s)=0; +- virtual AVMetadataTag *av_metadata_get(AVMetadata *m, const char *key, const AVMetadataTag *prev, int flags)=0; ++ virtual AVDictionaryEntry *av_metadata_get(AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)=0; + virtual void av_close_input_file(AVFormatContext *s)=0; + virtual void av_close_input_stream(AVFormatContext *s)=0; + virtual int av_read_frame(AVFormatContext *s, AVPacket *pkt)=0; +@@ -108,7 +108,7 @@ public: + virtual int av_write_header (AVFormatContext *s)=0; + virtual int av_write_trailer(AVFormatContext *s)=0; + virtual int av_write_frame (AVFormatContext *s, AVPacket *pkt)=0; +- virtual int av_metadata_set2(AVMetadata **pm, const char *key, const char *value, int flags)=0; ++ virtual int av_metadata_set2(AVDictionary **pm, const char *key, const char *value, int flags)=0; + }; + + #if (defined USE_EXTERNAL_FFMPEG) +@@ -128,9 +128,9 @@ public: + virtual int url_feof(AVIOContext *s) { return ::url_feof(s); } + #if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(52,31,0) + // API added on: 2009-03-01 +- virtual AVMetadataTag *av_metadata_get(AVMetadata *m, const char *key, const AVMetadataTag *prev, int flags){ return ::av_metadata_get(m, key, prev, flags); } ++ virtual AVDictionaryEntry *av_metadata_get(AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags){ return ::av_metadata_get(m, key, prev, flags); } + #else +- virtual AVMetadataTag *av_metadata_get(AVMetadata *m, const char *key, const AVMetadataTag *prev, int flags){ return NULL; } ++ virtual AVDictionaryEntry *av_metadata_get(AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags){ return NULL; } + #endif + virtual void av_close_input_file(AVFormatContext *s) { ::av_close_input_file(s); } + virtual void av_close_input_stream(AVFormatContext *s) { ::av_close_input_stream(s); } +@@ -190,12 +190,12 @@ public: + virtual int av_write_frame (AVFormatContext *s, AVPacket *pkt) { return ::av_write_frame(s, pkt); } + #if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(52,43,0) + // API added on: 2009-12-13 +- virtual int av_metadata_set2(AVMetadata **pm, const char *key, const char *value, int flags) { return ::av_metadata_set2(pm, key, value, flags); } ++ virtual int av_metadata_set2(AVDictionary **pm, const char *key, const char *value, int flags) { return ::av_metadata_set2(pm, key, value, flags); } + #elif LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(52,31,0) + // API added on: 2009-03-01 +- virtual int av_metadata_set2(AVMetadata **pm, const char *key, const char *value, int flags) { return ::av_metadata_set(pm, key, value); } ++ virtual int av_metadata_set2(AVDictionary **pm, const char *key, const char *value, int flags) { return ::av_metadata_set(pm, key, value); } + #else +- virtual int av_metadata_set2(AVMetadata **pm, const char *key, const char *value, int flags) { return -1; } ++ virtual int av_metadata_set2(AVDictionary **pm, const char *key, const char *value, int flags) { return -1; } + #endif + + // DLL faking. +@@ -218,7 +218,7 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface + DEFINE_METHOD0(void, av_register_all_dont_call) + DEFINE_METHOD1(AVInputFormat*, av_find_input_format, (const char *p1)) + DEFINE_METHOD1(int, url_feof, (AVIOContext *p1)) +- DEFINE_METHOD4(AVMetadataTag*, av_metadata_get, (AVMetadata *p1, const char *p2, const AVMetadataTag *p3, int p4)) ++ DEFINE_METHOD4(AVDictionaryEntry*, av_metadata_get, (AVDictionary *p1, const char *p2, const AVDictionaryEntry *p3, int p4)) + DEFINE_METHOD1(void, av_close_input_file, (AVFormatContext *p1)) + DEFINE_METHOD1(void, av_close_input_stream, (AVFormatContext *p1)) + DEFINE_METHOD1(int, av_read_play, (AVFormatContext *p1)) +@@ -265,7 +265,7 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface + DEFINE_METHOD1(int, av_write_header , (AVFormatContext *p1)) + DEFINE_METHOD1(int, av_write_trailer, (AVFormatContext *p1)) + DEFINE_METHOD2(int, av_write_frame , (AVFormatContext *p1, AVPacket *p2)) +- DEFINE_METHOD4(int, av_metadata_set2, (AVMetadata **p1, const char *p2, const char *p3, int p4)); ++ DEFINE_METHOD4(int, av_metadata_set2, (AVDictionary **p1, const char *p2, const char *p3, int p4)); + BEGIN_METHOD_RESOLVE() + RESOLVE_METHOD_RENAME(av_register_all, av_register_all_dont_call) + RESOLVE_METHOD(av_find_input_format) +diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +index f0ce468..489c85c 100644 +--- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp ++++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +@@ -1092,7 +1092,7 @@ void CDVDDemuxFFmpeg::AddStream(int iId) + { + std::string fileName = "special://temp/fonts/"; + XFILE::CDirectory::Create(fileName); +- AVMetadataTag *nameTag = m_dllAvFormat.av_metadata_get(pStream->metadata, "filename", NULL, 0); ++ AVDictionaryEntry *nameTag = m_dllAvFormat.av_metadata_get(pStream->metadata, "filename", NULL, 0); + if (!nameTag) { + CLog::Log(LOGERROR, "%s: TTF attachment has no name", __FUNCTION__); + break; +@@ -1141,7 +1141,7 @@ void CDVDDemuxFFmpeg::AddStream(int iId) + // API added on: 2010-10-15 + // (Note that while the function was available earlier, the generic + // metadata tags were not populated by default) +- AVMetadataTag *langTag = m_dllAvFormat.av_metadata_get(pStream->metadata, "language", NULL, 0); ++ AVDictionaryEntry *langTag = m_dllAvFormat.av_metadata_get(pStream->metadata, "language", NULL, 0); + if (langTag) + strncpy(m_streams[iId]->language, langTag->value, 3); + #else +@@ -1251,7 +1251,7 @@ void CDVDDemuxFFmpeg::GetChapterName(std::string& strChapterName) + // API added on: 2010-10-15 + // (Note that while the function was available earlier, the generic + // metadata tags were not populated by default) +- AVMetadataTag *titleTag = m_dllAvFormat.av_metadata_get(m_pFormatContext->chapters[chapterIdx-1]->metadata, ++ AVDictionaryEntry *titleTag = m_dllAvFormat.av_metadata_get(m_pFormatContext->chapters[chapterIdx-1]->metadata, + "title", NULL, 0); + if (titleTag) + strChapterName = titleTag->value; diff --git a/srcpkgs/xbmc/patches/060_all_find_stram_info.patch b/srcpkgs/xbmc/patches/060_all_find_stram_info.patch new file mode 100644 index 0000000000..0aacc6e7af --- /dev/null +++ b/srcpkgs/xbmc/patches/060_all_find_stram_info.patch @@ -0,0 +1,78 @@ +commit ab76b8bbaba33433be8152eb65e4880a76bd9461 +Author: elupus +Date: Tue Nov 1 20:52:40 2011 +0100 + + Replace depreciated av_find_stream_info with avformat_find_stream_info + +diff --git a/lib/DllAvFormat.h b/lib/DllAvFormat.h +index 9acdae7..ed26a0b 100644 +--- a/lib/DllAvFormat.h ++++ b/lib/DllAvFormat.h +@@ -72,7 +72,7 @@ public: + virtual int av_read_pause(AVFormatContext *s)=0; + virtual int av_seek_frame(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)=0; + #if (!defined USE_EXTERNAL_FFMPEG) +- virtual int av_find_stream_info_dont_call(AVFormatContext *ic)=0; ++ virtual int avformat_find_stream_info_dont_call(AVFormatContext *ic, AVDictionary **options)=0; + #endif + virtual void url_set_interrupt_cb(URLInterruptCB *interrupt_cb)=0; + virtual int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputFormat *fmt, AVDictionary **options)=0; +@@ -139,10 +139,10 @@ public: + virtual int av_read_play(AVFormatContext *s) { return ::av_read_play(s); } + virtual int av_read_pause(AVFormatContext *s) { return ::av_read_pause(s); } + virtual int av_seek_frame(AVFormatContext *s, int stream_index, int64_t timestamp, int flags) { return ::av_seek_frame(s, stream_index, timestamp, flags); } +- virtual int av_find_stream_info(AVFormatContext *ic) ++ virtual int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options) + { + CSingleLock lock(DllAvCodec::m_critSection); +- return ::av_find_stream_info(ic); ++ return ::avformat_find_stream_info(ic, options); + } + virtual void url_set_interrupt_cb(URLInterruptCB *interrupt_cb) { ::url_set_interrupt_cb(interrupt_cb); } + virtual int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputFormat *fmt, AVDictionary **options) +@@ -226,7 +226,7 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface + DEFINE_METHOD1(void, av_read_frame_flush, (AVFormatContext *p1)) + DEFINE_FUNC_ALIGNED2(int, __cdecl, av_read_frame, AVFormatContext *, AVPacket *) + DEFINE_FUNC_ALIGNED4(int, __cdecl, av_seek_frame, AVFormatContext*, int, int64_t, int) +- DEFINE_FUNC_ALIGNED1(int, __cdecl, av_find_stream_info_dont_call, AVFormatContext*) ++ DEFINE_FUNC_ALIGNED2(int, __cdecl, avformat_find_stream_info_dont_call, AVFormatContext*, AVDictionary **) + DEFINE_FUNC_ALIGNED4(int, __cdecl, avformat_open_input, AVFormatContext **, const char *, AVInputFormat *, AVDictionary **) + DEFINE_FUNC_ALIGNED2(AVInputFormat*, __cdecl, av_probe_input_format, AVProbeData*, int) + DEFINE_FUNC_ALIGNED3(AVInputFormat*, __cdecl, av_probe_input_format2, AVProbeData*, int, int*) +@@ -278,7 +278,7 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface + RESOLVE_METHOD(av_read_pause) + RESOLVE_METHOD(av_read_frame_flush) + RESOLVE_METHOD(av_seek_frame) +- RESOLVE_METHOD_RENAME(av_find_stream_info, av_find_stream_info_dont_call) ++ RESOLVE_METHOD_RENAME(avformat_find_stream_info, avformat_find_stream_info_dont_call) + RESOLVE_METHOD(url_set_interrupt_cb) + RESOLVE_METHOD(avformat_open_input) + RESOLVE_METHOD(init_put_byte) +@@ -324,10 +324,10 @@ public: + CSingleLock lock(DllAvCodec::m_critSection); + av_register_all_dont_call(); + } +- int av_find_stream_info(AVFormatContext *ic) ++ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options) + { + CSingleLock lock(DllAvCodec::m_critSection); +- return(av_find_stream_info_dont_call(ic)); ++ return avformat_find_stream_info_dont_call(ic, options); + } + + virtual bool Load() +diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +index 489c85c..68f4358 100644 +--- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp ++++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +@@ -450,8 +450,8 @@ bool CDVDDemuxFFmpeg::Open(CDVDInputStream* pInput) + m_pFormatContext->max_analyze_duration = 500000; + + +- CLog::Log(LOGDEBUG, "%s - av_find_stream_info starting", __FUNCTION__); +- int iErr = m_dllAvFormat.av_find_stream_info(m_pFormatContext); ++ CLog::Log(LOGDEBUG, "%s - avformat_find_stream_info starting", __FUNCTION__); ++ int iErr = m_dllAvFormat.avformat_find_stream_info(m_pFormatContext, NULL); + if (iErr < 0) + { + CLog::Log(LOGWARNING,"could not find codec parameters for %s", strFile.c_str()); diff --git a/srcpkgs/xbmc/patches/070_all_deprecated_functions.patch b/srcpkgs/xbmc/patches/070_all_deprecated_functions.patch new file mode 100644 index 0000000000..3962e39ca4 --- /dev/null +++ b/srcpkgs/xbmc/patches/070_all_deprecated_functions.patch @@ -0,0 +1,340 @@ +commit 1aed04a52e753b5fd395b55d97a70226f62bc634 +Author: elupus +Date: Tue Nov 1 21:36:32 2011 +0100 + + Replace more depreciated ffmpeg functions + +diff --git a/lib/DllAvCodec.h b/lib/DllAvCodec.h +index 05edcb7..355b8b2 100644 +--- a/lib/DllAvCodec.h ++++ b/lib/DllAvCodec.h +@@ -106,7 +106,7 @@ public: + virtual ~DllAvCodecInterface() {} + virtual void avcodec_register_all(void)=0; + virtual void avcodec_flush_buffers(AVCodecContext *avctx)=0; +- virtual int avcodec_open_dont_call(AVCodecContext *avctx, AVCodec *codec)=0; ++ virtual int avcodec_open2_dont_call(AVCodecContext *avctx, AVCodec *codec, AVDictionary **options)=0; + virtual AVCodec *avcodec_find_decoder(enum CodecID id)=0; + virtual AVCodec *avcodec_find_encoder(enum CodecID id)=0; + virtual int avcodec_close_dont_call(AVCodecContext *avctx)=0; +@@ -117,9 +117,9 @@ public: + virtual int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub, int *got_sub_ptr, AVPacket *avpkt)=0; + virtual int avcodec_encode_audio(AVCodecContext *avctx, uint8_t *buf, int buf_size, const short *samples)=0; + virtual int avpicture_get_size(PixelFormat pix_fmt, int width, int height)=0; +- virtual AVCodecContext *avcodec_alloc_context(void)=0; ++ virtual AVCodecContext *avcodec_alloc_context3(AVCodec *codec)=0; + virtual void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)=0; +- virtual void avcodec_get_context_defaults(AVCodecContext *s)=0; ++ virtual void avcodec_get_context_defaults3(AVCodecContext *s, AVCodec *codec)=0; + virtual AVCodecParserContext *av_parser_init(int codec_id)=0; + virtual int av_parser_parse2(AVCodecParserContext *s,AVCodecContext *avctx, uint8_t **poutbuf, int *poutbuf_size, + const uint8_t *buf, int buf_size, +@@ -165,12 +165,12 @@ public: + ::avcodec_register_all(); + } + virtual void avcodec_flush_buffers(AVCodecContext *avctx) { ::avcodec_flush_buffers(avctx); } +- virtual int avcodec_open(AVCodecContext *avctx, AVCodec *codec) ++ virtual int avcodec_open2(AVCodecContext *avctx, AVCodec *codec, AVDictionary **options) + { + CSingleLock lock(DllAvCodec::m_critSection); +- return ::avcodec_open(avctx, codec); ++ return ::avcodec_open2(avctx, codec, options); + } +- virtual int avcodec_open_dont_call(AVCodecContext *avctx, AVCodec *codec) { *(int *)0x0 = 0; return 0; } ++ virtual int avcodec_open2_dont_call(AVCodecContext *avctx, AVCodec *codec, AVDictionary **options) { *(int *)0x0 = 0; return 0; } + virtual int avcodec_close_dont_call(AVCodecContext *avctx) { *(int *)0x0 = 0; return 0; } + virtual AVCodec *avcodec_find_decoder(enum CodecID id) { return ::avcodec_find_decoder(id); } + virtual AVCodec *avcodec_find_encoder(enum CodecID id) { return ::avcodec_find_encoder(id); } +@@ -193,9 +193,9 @@ public: + #endif + virtual int avcodec_encode_audio(AVCodecContext *avctx, uint8_t *buf, int buf_size, const short *samples) { return ::avcodec_encode_audio(avctx, buf, buf_size, samples); } + virtual int avpicture_get_size(PixelFormat pix_fmt, int width, int height) { return ::avpicture_get_size(pix_fmt, width, height); } +- virtual AVCodecContext *avcodec_alloc_context() { return ::avcodec_alloc_context(); } ++ virtual AVCodecContext *avcodec_alloc_context3(AVCodec *codec) { return ::avcodec_alloc_context3(codec); } + virtual void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode) { ::avcodec_string(buf, buf_size, enc, encode); } +- virtual void avcodec_get_context_defaults(AVCodecContext *s) { ::avcodec_get_context_defaults(s); } ++ virtual void avcodec_get_context_defaults3(AVCodecContext *s, AVCodec *codec) { ::avcodec_get_context_defaults3(s, codec); } + + virtual AVCodecParserContext *av_parser_init(int codec_id) { return ::av_parser_init(codec_id); } + virtual int av_parser_parse2(AVCodecParserContext *s,AVCodecContext *avctx, uint8_t **poutbuf, int *poutbuf_size, +@@ -254,12 +254,12 @@ class DllAvCodec : public DllDynamic, DllAvCodecInterface + { + DECLARE_DLL_WRAPPER(DllAvCodec, DLL_PATH_LIBAVCODEC) + DEFINE_FUNC_ALIGNED1(void, __cdecl, avcodec_flush_buffers, AVCodecContext*) +- DEFINE_FUNC_ALIGNED2(int, __cdecl, avcodec_open_dont_call, AVCodecContext*, AVCodec *) ++ DEFINE_FUNC_ALIGNED3(int, __cdecl, avcodec_open2_dont_call, AVCodecContext*, AVCodec *, AVDictionary **) + DEFINE_FUNC_ALIGNED4(int, __cdecl, avcodec_decode_video2, AVCodecContext*, AVFrame*, int*, AVPacket*) + DEFINE_FUNC_ALIGNED4(int, __cdecl, avcodec_decode_audio3, AVCodecContext*, int16_t*, int*, AVPacket*) + DEFINE_FUNC_ALIGNED4(int, __cdecl, avcodec_decode_subtitle2, AVCodecContext*, AVSubtitle*, int*, AVPacket*) + DEFINE_FUNC_ALIGNED4(int, __cdecl, avcodec_encode_audio, AVCodecContext*, uint8_t*, int, const short*) +- DEFINE_FUNC_ALIGNED0(AVCodecContext*, __cdecl, avcodec_alloc_context) ++ DEFINE_FUNC_ALIGNED1(AVCodecContext*, __cdecl, avcodec_alloc_context3, AVCodec *) + DEFINE_FUNC_ALIGNED1(AVCodecParserContext*, __cdecl, av_parser_init, int) + DEFINE_FUNC_ALIGNED9(int, __cdecl, av_parser_parse2, AVCodecParserContext*,AVCodecContext*, uint8_t**, int*, const uint8_t*, int, int64_t, int64_t, int64_t) + DEFINE_METHOD1(int, av_dup_packet, (AVPacket *p1)) +@@ -276,7 +276,7 @@ class DllAvCodec : public DllDynamic, DllAvCodecInterface + DEFINE_METHOD5(int, avpicture_fill, (AVPicture *p1, uint8_t *p2, PixelFormat p3, int p4, int p5)) + DEFINE_METHOD3(int, avpicture_get_size, (PixelFormat p1, int p2, int p3)) + DEFINE_METHOD4(void, avcodec_string, (char *p1, int p2, AVCodecContext *p3, int p4)) +- DEFINE_METHOD1(void, avcodec_get_context_defaults, (AVCodecContext *p1)) ++ DEFINE_METHOD2(void, avcodec_get_context_defaults3, (AVCodecContext *p1, AVCodec *p2)) + DEFINE_METHOD1(void, av_parser_close, (AVCodecParserContext *p1)) + DEFINE_METHOD1(void, avpicture_free, (AVPicture *p1)) + DEFINE_METHOD1(AVBitStreamFilterContext*, av_bitstream_filter_init, (const char *p1)) +@@ -298,7 +298,7 @@ class DllAvCodec : public DllDynamic, DllAvCodecInterface + const void * const p4[6], const int p5[6], int p6)) + BEGIN_METHOD_RESOLVE() + RESOLVE_METHOD(avcodec_flush_buffers) +- RESOLVE_METHOD_RENAME(avcodec_open,avcodec_open_dont_call) ++ RESOLVE_METHOD_RENAME(avcodec_open2,avcodec_open2_dont_call) + RESOLVE_METHOD_RENAME(avcodec_close,avcodec_close_dont_call) + RESOLVE_METHOD(avcodec_find_decoder) + RESOLVE_METHOD(avcodec_find_encoder) +@@ -310,9 +310,9 @@ class DllAvCodec : public DllDynamic, DllAvCodecInterface + RESOLVE_METHOD(avcodec_decode_subtitle2) + RESOLVE_METHOD(avcodec_encode_audio) + RESOLVE_METHOD(avpicture_get_size) +- RESOLVE_METHOD(avcodec_alloc_context) ++ RESOLVE_METHOD(avcodec_alloc_context3) + RESOLVE_METHOD(avcodec_string) +- RESOLVE_METHOD(avcodec_get_context_defaults) ++ RESOLVE_METHOD(avcodec_get_context_defaults3) + RESOLVE_METHOD(av_parser_init) + RESOLVE_METHOD(av_parser_parse2) + RESOLVE_METHOD(av_parser_close) +@@ -340,10 +340,10 @@ class DllAvCodec : public DllDynamic, DllAvCodecInterface + + public: + static CCriticalSection m_critSection; +- int avcodec_open(AVCodecContext *avctx, AVCodec *codec) ++ int avcodec_open2(AVCodecContext *avctx, AVCodec *codec, AVDictionary **options) + { + CSingleLock lock(DllAvCodec::m_critSection); +- return avcodec_open_dont_call(avctx,codec); ++ return avcodec_open2_dont_call(avctx,codec, options); + } + int avcodec_close(AVCodecContext *avctx) + { +diff --git a/lib/DllAvFormat.h b/lib/DllAvFormat.h +index ed26a0b..9b38c9c 100644 +--- a/lib/DllAvFormat.h ++++ b/lib/DllAvFormat.h +@@ -98,7 +98,7 @@ public: + virtual void put_be32(AVIOContext *s, unsigned int val)=0; + virtual void put_be16(AVIOContext *s, unsigned int val)=0; + virtual AVFormatContext *avformat_alloc_context(void)=0; +- virtual AVStream *av_new_stream(AVFormatContext *s, int id)=0; ++ virtual AVStream *avformat_new_stream(AVFormatContext *s, AVCodec *c)=0; + virtual AVOutputFormat *av_guess_format(const char *short_name, const char *filename, const char *mime_type)=0; + virtual int av_set_parameters(AVFormatContext *s, AVFormatParameters *ap)=0; + virtual AVIOContext *av_alloc_put_byte(unsigned char *buffer, int buffer_size, int write_flag, void *opaque, +@@ -146,7 +146,7 @@ public: + } + virtual void url_set_interrupt_cb(URLInterruptCB *interrupt_cb) { ::url_set_interrupt_cb(interrupt_cb); } + virtual int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputFormat *fmt, AVDictionary **options) +- { return ::avformat_open_input(ps, filename, fmt, opt, ap); } ++ { return ::avformat_open_input(ps, filename, fmt, options); } + virtual int init_put_byte(AVIOContext *s, unsigned char *buffer, int buffer_size, int write_flag, void *opaque, + int (*read_packet)(void *opaque, uint8_t *buf, int buf_size), + int (*write_packet)(void *opaque, uint8_t *buf, int buf_size), +@@ -174,7 +174,7 @@ public: + virtual void put_be32(AVIOContext *s, unsigned int val) { ::put_be32(s, val); } + virtual void put_be16(AVIOContext *s, unsigned int val) { ::put_be16(s, val); } + virtual AVFormatContext *avformat_alloc_context() { return ::avformat_alloc_context(); } +- virtual AVStream *av_new_stream(AVFormatContext *s, int id) { return ::av_new_stream(s, id); } ++ virtual AVStream *avformat_new_stream(AVFormatContext *s, AVCodec *c) { return ::avformat_new_stream(s, c); } + #if LIBAVFORMAT_VERSION_INT < (52<<16 | 45<<8) + virtual AVOutputFormat *av_guess_format(const char *short_name, const char *filename, const char *mime_type) { return ::guess_format(short_name, filename, mime_type); } + #else +@@ -251,7 +251,7 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface + DEFINE_METHOD2(int, url_close_dyn_buf, (AVIOContext *p1, uint8_t **p2)) + DEFINE_METHOD3(offset_t, url_fseek, (AVIOContext *p1, offset_t p2, int p3)) + DEFINE_METHOD0(AVFormatContext *, avformat_alloc_context) +- DEFINE_METHOD2(AVStream *, av_new_stream, (AVFormatContext *p1, int p2)) ++ DEFINE_METHOD2(AVStream *, avformat_new_stream, (AVFormatContext *p1, AVCodec *p2)) + #if LIBAVFORMAT_VERSION_INT < (52<<16 | 45<<8) + DEFINE_METHOD3(AVOutputFormat *, guess_format, (const char *p1, const char *p2, const char *p3)) + #else +@@ -300,7 +300,7 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface + RESOLVE_METHOD(put_be32) + RESOLVE_METHOD(put_be16) + RESOLVE_METHOD(avformat_alloc_context) +- RESOLVE_METHOD(av_new_stream) ++ RESOLVE_METHOD(avformat_new_stream) + #if LIBAVFORMAT_VERSION_INT < (52<<16 | 45<<8) + RESOLVE_METHOD(guess_format) + #else +diff --git a/xbmc/cdrip/EncoderFFmpeg.cpp b/xbmc/cdrip/EncoderFFmpeg.cpp +index 1ec9805..0b3ef76 100644 +--- a/xbmc/cdrip/EncoderFFmpeg.cpp ++++ b/xbmc/cdrip/EncoderFFmpeg.cpp +@@ -103,7 +103,7 @@ bool CEncoderFFmpeg::Init(const char* strFile, int iInChannels, int iInRate, int + } + + /* add a stream to it */ +- m_Stream = m_dllAvFormat.av_new_stream(m_Format, 1); ++ m_Stream = m_dllAvFormat.avformat_new_stream(m_Format, codec); + if (!m_Stream) + { + m_dllAvUtil.av_freep(&m_Format->pb); +@@ -144,7 +144,7 @@ bool CEncoderFFmpeg::Init(const char* strFile, int iInChannels, int iInRate, int + return false; + } + +- if (m_dllAvCodec.avcodec_open(m_CodecCtx, codec)) ++ if (m_dllAvCodec.avcodec_open2(m_CodecCtx, codec, NULL)) + { + CLog::Log(LOGERROR, "CEncoderFFmpeg::Init - Failed to open the codec"); + m_dllAvUtil.av_freep(&m_Stream); +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp +index 6037781..838a27f 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp +@@ -63,8 +63,6 @@ bool CDVDAudioCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options + return false; + + m_dllAvCodec.avcodec_register_all(); +- m_pCodecContext = m_dllAvCodec.avcodec_alloc_context(); +- m_dllAvCodec.avcodec_get_context_defaults(m_pCodecContext); + + pCodec = m_dllAvCodec.avcodec_find_decoder(hints.codec); + if (!pCodec) +@@ -73,6 +71,7 @@ bool CDVDAudioCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options + return false; + } + ++ m_pCodecContext = m_dllAvCodec.avcodec_alloc_context3(pCodec); + m_pCodecContext->debug_mv = 0; + m_pCodecContext->debug = 0; + m_pCodecContext->workaround_bugs = 1; +@@ -97,7 +96,7 @@ bool CDVDAudioCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options + memcpy(m_pCodecContext->extradata, hints.extradata, hints.extrasize); + } + +- if (m_dllAvCodec.avcodec_open(m_pCodecContext, pCodec) < 0) ++ if (m_dllAvCodec.avcodec_open2(m_pCodecContext, pCodec, NULL) < 0) + { + CLog::Log(LOGDEBUG,"CDVDAudioCodecFFmpeg::Open() Unable to open codec"); + Dispose(); +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthroughFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthroughFFmpeg.cpp +index 34e93a4..440b04b 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthroughFFmpeg.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthroughFFmpeg.cpp +@@ -149,7 +149,7 @@ bool CDVDAudioCodecPassthroughFFmpeg::SetupMuxer(CDVDStreamInfo &hints, CStdStri + } + + /* add a stream to it */ +- muxer.m_pStream = m_dllAvFormat.av_new_stream(muxer.m_pFormat, 1); ++ muxer.m_pStream = m_dllAvFormat.avformat_new_stream(muxer.m_pFormat, NULL); + if (!muxer.m_pStream) + { + CLog::Log(LOGERROR, "CDVDAudioCodecPassthroughFFmpeg::SetupMuxer - Failed to allocate AVStream context"); +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Audio/Encoders/DVDAudioEncoderFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Audio/Encoders/DVDAudioEncoderFFmpeg.cpp +index 6f30e11..6141982 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Audio/Encoders/DVDAudioEncoderFFmpeg.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Audio/Encoders/DVDAudioEncoderFFmpeg.cpp +@@ -65,7 +65,7 @@ bool CDVDAudioEncoderFFmpeg::Initialize(unsigned int channels, enum PCMChannels + return false; + + /* always assume 6 channels, 5.1... m_remap will give us what we want */ +- m_CodecCtx = m_dllAvCodec.avcodec_alloc_context(); ++ m_CodecCtx = m_dllAvCodec.avcodec_alloc_context3(codec); + m_CodecCtx->bit_rate = AC3_ENCODE_BITRATE; + m_CodecCtx->sample_rate = sampleRate; + m_CodecCtx->channels = 6; +@@ -104,7 +104,7 @@ bool CDVDAudioEncoderFFmpeg::Initialize(unsigned int channels, enum PCMChannels + } + } + +- if (m_dllAvCodec.avcodec_open(m_CodecCtx, codec)) ++ if (m_dllAvCodec.avcodec_open2(m_CodecCtx, codec, NULL)) + { + m_dllAvUtil.av_freep(&m_CodecCtx); + return false; +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Overlay/DVDOverlayCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Overlay/DVDOverlayCodecFFmpeg.cpp +index 563ce78..754169e 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Overlay/DVDOverlayCodecFFmpeg.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Overlay/DVDOverlayCodecFFmpeg.cpp +@@ -49,7 +49,14 @@ bool CDVDOverlayCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &optio + + m_dllAvCodec.avcodec_register_all(); + +- m_pCodecContext = m_dllAvCodec.avcodec_alloc_context(); ++ AVCodec* pCodec = m_dllAvCodec.avcodec_find_decoder(hints.codec); ++ if (!pCodec) ++ { ++ CLog::Log(LOGDEBUG,"%s - Unable to find codec %d", __FUNCTION__, hints.codec); ++ return false; ++ } ++ ++ m_pCodecContext = m_dllAvCodec.avcodec_alloc_context3(pCodec); + m_pCodecContext->debug_mv = 0; + m_pCodecContext->debug = 0; + m_pCodecContext->workaround_bugs = FF_BUG_AUTODETECT; +@@ -100,14 +107,7 @@ bool CDVDOverlayCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &optio + delete[] parse_extra; + } + +- AVCodec* pCodec = m_dllAvCodec.avcodec_find_decoder(hints.codec); +- if (!pCodec) +- { +- CLog::Log(LOGDEBUG,"%s - Unable to find codec %d", __FUNCTION__, hints.codec); +- return false; +- } +- +- if (m_dllAvCodec.avcodec_open(m_pCodecContext, pCodec) < 0) ++ if (m_dllAvCodec.avcodec_open2(m_pCodecContext, pCodec, NULL) < 0) + { + CLog::Log(LOGDEBUG,"CDVDVideoCodecFFmpeg::Open() Unable to open codec"); + return false; +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +index 26bdb3a..c792cfd 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +@@ -163,9 +163,9 @@ bool CDVDVideoCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options + m_dllAvFilter.avfilter_register_all(); + + m_bSoftware = hints.software; +- m_pCodecContext = m_dllAvCodec.avcodec_alloc_context(); + + pCodec = NULL; ++ m_pCodecContext = NULL; + + if (hints.codec == CODEC_ID_H264) + { +@@ -196,6 +196,7 @@ bool CDVDVideoCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options + + CLog::Log(LOGNOTICE,"CDVDVideoCodecFFmpeg::Open() Creating VDPAU(%ix%i, %d)",hints.width, hints.height, hints.codec); + CVDPAU* vdp = new CVDPAU(); ++ m_pCodecContext = m_dllAvCodec.avcodec_alloc_context3(pCodec); + m_pCodecContext->codec_id = hints.codec; + m_pCodecContext->width = hints.width; + m_pCodecContext->height = hints.height; +@@ -207,7 +208,7 @@ bool CDVDVideoCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options + m_pCodecContext->codec_id = CODEC_ID_NONE; // ffmpeg will complain if this has been set + break; + } +- m_pCodecContext->codec_id = CODEC_ID_NONE; // ffmpeg will complain if this has been set ++ m_dllAvUtil.av_freep(&m_pCodecContext); + CLog::Log(LOGNOTICE,"CDVDVideoCodecFFmpeg::Open() Failed to get VDPAU device"); + vdp->Release(); + } +@@ -226,6 +227,9 @@ bool CDVDVideoCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options + + CLog::Log(LOGNOTICE,"CDVDVideoCodecFFmpeg::Open() Using codec: %s",pCodec->long_name ? pCodec->long_name : pCodec->name); + ++ if(m_pCodecContext == NULL) ++ m_pCodecContext = m_dllAvCodec.avcodec_alloc_context3(pCodec); ++ + m_pCodecContext->opaque = (void*)this; + m_pCodecContext->debug_mv = 0; + m_pCodecContext->debug = 0; +@@ -281,7 +285,7 @@ bool CDVDVideoCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options + || pCodec->id == CODEC_ID_MPEG4 )) + m_pCodecContext->thread_count = num_threads; + +- if (m_dllAvCodec.avcodec_open(m_pCodecContext, pCodec) < 0) ++ if (m_dllAvCodec.avcodec_open2(m_pCodecContext, pCodec, NULL) < 0) + { + CLog::Log(LOGDEBUG,"CDVDVideoCodecFFmpeg::Open() Unable to open codec"); + return false; diff --git a/srcpkgs/xbmc/patches/080_all_drop_old.patch b/srcpkgs/xbmc/patches/080_all_drop_old.patch new file mode 100644 index 0000000000..84c020801e --- /dev/null +++ b/srcpkgs/xbmc/patches/080_all_drop_old.patch @@ -0,0 +1,553 @@ +commit bddad011d457ed59ab856d35a63efa390d9c2e73 +Author: elupus +Date: Tue Nov 1 21:46:36 2011 +0100 + + Drop support for ffmpeg version older than our built in version + +diff --git a/lib/DllAvCodec.h b/lib/DllAvCodec.h +index 355b8b2..7993408 100644 +--- a/lib/DllAvCodec.h ++++ b/lib/DllAvCodec.h +@@ -76,28 +76,6 @@ extern "C" { + #endif + } + +-/* Some convenience macros introduced at this particular revision of libavcodec. +- */ +-#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(52,25,0) +-#define CH_LAYOUT_5POINT0_BACK (CH_LAYOUT_SURROUND|CH_BACK_LEFT|CH_BACK_RIGHT) +-#define CH_LAYOUT_5POINT1_BACK (CH_LAYOUT_5POINT0_BACK|CH_LOW_FREQUENCY) +-#undef CH_LAYOUT_7POINT1_WIDE +-#define CH_LAYOUT_7POINT1_WIDE (CH_LAYOUT_5POINT1_BACK|\ +- CH_FRONT_LEFT_OF_CENTER|CH_FRONT_RIGHT_OF_CENTER) +-#endif +- +-#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(52,64,0) +-// API added on: 2010-03-31 +-#define AVMediaType CodecType +-#define AVMEDIA_TYPE_UNKNOWN CODEC_TYPE_UNKNOWN +-#define AVMEDIA_TYPE_VIDEO CODEC_TYPE_VIDEO +-#define AVMEDIA_TYPE_AUDIO CODEC_TYPE_AUDIO +-#define AVMEDIA_TYPE_DATA CODEC_TYPE_DATA +-#define AVMEDIA_TYPE_SUBTITLE CODEC_TYPE_SUBTITLE +-#define AVMEDIA_TYPE_ATTACHMENT CODEC_TYPE_ATTACHMENT +-#define AVMEDIA_TYPE_NB CODEC_TYPE_NB +-#endif +- + #include "threads/SingleLock.h" + + class DllAvCodecInterface +@@ -181,16 +159,9 @@ public: + } + virtual AVFrame *avcodec_alloc_frame() { return ::avcodec_alloc_frame(); } + virtual int avpicture_fill(AVPicture *picture, uint8_t *ptr, PixelFormat pix_fmt, int width, int height) { return ::avpicture_fill(picture, ptr, pix_fmt, width, height); } +-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52,23,0) +- // API added on: 2009-04-07 + virtual int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture, int *got_picture_ptr, AVPacket *avpkt) { return ::avcodec_decode_video2(avctx, picture, got_picture_ptr, avpkt); } + virtual int avcodec_decode_audio3(AVCodecContext *avctx, int16_t *samples, int *frame_size_ptr, AVPacket *avpkt) { return ::avcodec_decode_audio3(avctx, samples, frame_size_ptr, avpkt); } + virtual int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub, int *got_sub_ptr, AVPacket *avpkt) { return ::avcodec_decode_subtitle2(avctx, sub, got_sub_ptr, avpkt); } +-#else +- virtual int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture, int *got_picture_ptr, AVPacket *avpkt) { return ::avcodec_decode_video(avctx, picture, got_picture_ptr, avpkt->data, avpkt->size); } +- virtual int avcodec_decode_audio3(AVCodecContext *avctx, int16_t *samples, int *frame_size_ptr, AVPacket *avpkt) { return ::avcodec_decode_audio2(avctx, samples, frame_size_ptr, avpkt->data, avpkt->size); } +- virtual int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub, int *got_sub_ptr, AVPacket *avpkt) { return ::avcodec_decode_subtitle(avctx, sub, got_sub_ptr, avpkt->data, avpkt->size); } +-#endif + virtual int avcodec_encode_audio(AVCodecContext *avctx, uint8_t *buf, int buf_size, const short *samples) { return ::avcodec_encode_audio(avctx, buf, buf_size, samples); } + virtual int avpicture_get_size(PixelFormat pix_fmt, int width, int height) { return ::avpicture_get_size(pix_fmt, width, height); } + virtual AVCodecContext *avcodec_alloc_context3(AVCodec *codec) { return ::avcodec_alloc_context3(codec); } +@@ -202,12 +173,7 @@ public: + const uint8_t *buf, int buf_size, + int64_t pts, int64_t dts, int64_t pos) + { +-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52,21,0) +- // API added on : 2009-03-05 + return ::av_parser_parse2(s, avctx, poutbuf, poutbuf_size, buf, buf_size, pts, dts, pos); +-#else +- return ::av_parser_parse(s, avctx, poutbuf, poutbuf_size, buf, buf_size, pts, dts); +-#endif + } + virtual void av_parser_close(AVCodecParserContext *s) { ::av_parser_close(s); } + +diff --git a/lib/DllAvFilter.h b/lib/DllAvFilter.h +index 1e308ac..ea012e8 100644 +--- a/lib/DllAvFilter.h ++++ b/lib/DllAvFilter.h +@@ -46,22 +46,8 @@ extern "C" { + #elif (defined HAVE_FFMPEG_AVFILTER_H) + #include + #endif +- /* for av_vsrc_buffer_add_frame */ +- #if LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(2,8,0) +- #include +- #elif LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(2,7,0) +- int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, +- AVFrame *frame); +- #elif LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53,3,0) +- int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, +- AVFrame *frame, int64_t pts); +- #else +- int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, +- AVFrame *frame, int64_t pts, AVRational pixel_aspect); +- #endif + #else + #include "libavfilter/avfiltergraph.h" +-#define HAVE_AVFILTERBUFFERREFVIDEOPROPS_SAMPLE_ASPECT_RATIO + #endif + } + +@@ -83,15 +69,7 @@ public: + virtual int avfilter_graph_config(AVFilterGraph *graphctx, void *log_ctx)=0; + virtual int avfilter_poll_frame(AVFilterLink *link)=0; + virtual int avfilter_request_frame(AVFilterLink *link)=0; +-#if LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(2,13,0) + virtual int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, AVFrame *frame, int flags)=0; +-#elif LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(2,7,0) +- virtual int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, AVFrame *frame)=0; +-#elif LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53,3,0) +- virtual int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, AVFrame *frame, int64_t pts)=0; +-#else +- virtual int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, AVFrame *frame, int64_t pts, AVRational pixel_aspect)=0; +-#endif + virtual AVFilterBufferRef *avfilter_get_video_buffer(AVFilterLink *link, int perms, int w, int h)=0; + virtual void avfilter_unref_buffer(AVFilterBufferRef *ref)=0; + virtual int avfilter_link(AVFilterContext *src, unsigned srcpad, AVFilterContext *dst, unsigned dstpad)=0; +@@ -116,12 +94,7 @@ public: + virtual void avfilter_graph_free(AVFilterGraph **graph) + { + CSingleLock lock(DllAvCodec::m_critSection); +-#if LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(1,76,0) + ::avfilter_graph_free(graph); +-#else +- ::avfilter_graph_free(*graph); +- *graph = NULL; +-#endif + } + void avfilter_register_all() + { +@@ -134,53 +107,25 @@ public: + virtual AVFilterInOut *avfilter_inout_alloc() + { + CSingleLock lock(DllAvCodec::m_critSection); +-#if LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(2,17,0) + return ::avfilter_inout_alloc(); +-#else +- return (AVFilterInOut*)::av_mallocz(sizeof(AVFilterInOut)); +-#endif + } + virtual void avfilter_inout_free(AVFilterInOut **inout) + { + CSingleLock lock(DllAvCodec::m_critSection); +-#if LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(2,17,0) + ::avfilter_inout_free(inout); +-#else +- *inout = NULL; +-#endif + } + virtual int avfilter_graph_parse(AVFilterGraph *graph, const char *filters, AVFilterInOut **inputs, AVFilterInOut **outputs, void *log_ctx) + { + CSingleLock lock(DllAvCodec::m_critSection); +-#if ( LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(1,79,0) \ +- && LIBAVFILTER_VERSION_INT < AV_VERSION_INT(2,0,0) ) \ +- ||( LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(2,16,0)) + return ::avfilter_graph_parse(graph, filters, inputs, outputs, log_ctx); +-#elif LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(2,15,1) +- return ::avfilter_graph_parse(graph, filters, *inputs, *outputs, log_ctx); +-#else +- return ::avfilter_graph_parse(graph, filters, *inputs, *outputs, (AVClass*)log_ctx); +-#endif + } + virtual int avfilter_graph_config(AVFilterGraph *graphctx, void *log_ctx) + { +-#if LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(2,15,1) + return ::avfilter_graph_config(graphctx, log_ctx); +-#else +- return ::avfilter_graph_config(graphctx, (AVClass*)log_ctx); +-#endif + } + virtual int avfilter_poll_frame(AVFilterLink *link) { return ::avfilter_poll_frame(link); } + virtual int avfilter_request_frame(AVFilterLink *link) { return ::avfilter_request_frame(link); } +-#if LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(2,13,0) + virtual int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, AVFrame *frame, int flags) { return ::av_vsrc_buffer_add_frame(buffer_filter, frame, flags); } +-#elif LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(2,7,0) +- virtual int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, AVFrame *frame) { return ::av_vsrc_buffer_add_frame(buffer_filter, frame); } +-#elif LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53,3,0) +- virtual int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, AVFrame *frame, int64_t pts) { return ::av_vsrc_buffer_add_frame(buffer_filter, frame, pts); } +-#else +- virtual int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, AVFrame *frame, int64_t pts, AVRational pixel_aspect) { return ::av_vsrc_buffer_add_frame(buffer_filter, frame, pts, pixel_aspect); } +-#endif + virtual AVFilterBufferRef *avfilter_get_video_buffer(AVFilterLink *link, int perms, int w, int h) { return ::avfilter_get_video_buffer(link, perms, w, h); } + virtual void avfilter_unref_buffer(AVFilterBufferRef *ref) { ::avfilter_unref_buffer(ref); } + virtual int avfilter_link(AVFilterContext *src, unsigned srcpad, AVFilterContext *dst, unsigned dstpad) { return ::avfilter_link(src, srcpad, dst, dstpad); } +@@ -201,42 +146,18 @@ class DllAvFilter : public DllDynamic, DllAvFilterInterface + + DEFINE_METHOD3(int, avfilter_open_dont_call, (AVFilterContext **p1, AVFilter *p2, const char *p3)) + DEFINE_METHOD1(void, avfilter_free_dont_call, (AVFilterContext *p1)) +-#if LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(1,76,0) + DEFINE_METHOD1(void, avfilter_graph_free_dont_call, (AVFilterGraph **p1)) +-#else +- DEFINE_METHOD1(void, avfilter_graph_free_dont_call, (AVFilterGraph *p1)) +-#endif + DEFINE_METHOD0(void, avfilter_register_all_dont_call) + DEFINE_METHOD6(int, avfilter_graph_create_filter, (AVFilterContext **p1, AVFilter *p2, const char *p3, const char *p4, void *p5, AVFilterGraph *p6)) + DEFINE_METHOD1(AVFilter*, avfilter_get_by_name, (const char *p1)) + DEFINE_METHOD0(AVFilterGraph*, avfilter_graph_alloc) +-#if LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(2,17,0) + DEFINE_METHOD0(AVFilterInOut*, avfilter_inout_alloc_dont_call) + DEFINE_METHOD1(void, avfilter_inout_free_dont_call, (AVFilterInOut **p1)) +-#endif +-#if LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(2,16,0) + DEFINE_METHOD5(int, avfilter_graph_parse_dont_call, (AVFilterGraph *p1, const char *p2, AVFilterInOut **p3, AVFilterInOut **p4, void *p5)) +-#elif LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(2,15,1) +- DEFINE_METHOD5(int, avfilter_graph_parse_dont_call, (AVFilterGraph *p1, const char *p2, AVFilterInOut *p3, AVFilterInOut *p4, void *p5)) +-#else +- DEFINE_METHOD5(int, avfilter_graph_parse_dont_call, (AVFilterGraph *p1, const char *p2, AVFilterInOut *p3, AVFilterInOut *p4, AVClass *p5)) +-#endif +-#if LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(2,15,1) + DEFINE_METHOD2(int, avfilter_graph_config_dont_call, (AVFilterGraph *p1, void *p2)) +-#else +- DEFINE_METHOD2(int, avfilter_graph_config_dont_call, (AVFilterGraph *p1, AVClass *p2)) +-#endif + DEFINE_FUNC_ALIGNED1(int, __cdecl, avfilter_poll_frame, AVFilterLink *) + DEFINE_FUNC_ALIGNED1(int, __cdecl, avfilter_request_frame, AVFilterLink*) +-#if LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(2,13,0) + DEFINE_METHOD3(int, av_vsrc_buffer_add_frame, (AVFilterContext *p1, AVFrame *p2, int p3)) +-#elif LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(2,7,0) +- DEFINE_METHOD2(int, av_vsrc_buffer_add_frame, (AVFilterContext *p1, AVFrame *p2)) +-#elif LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53,3,0) +- DEFINE_METHOD3(int, av_vsrc_buffer_add_frame, (AVFilterContext *p1, AVFrame *p2, int64_t p3)) +-#else +- DEFINE_METHOD4(int, av_vsrc_buffer_add_frame, (AVFilterContext *p1, AVFrame *p2, int64_t p3, AVRational p4)) +-#endif + DEFINE_METHOD4(AVFilterBufferRef*, avfilter_get_video_buffer, (AVFilterLink *p1, int p2, int p3, int p4)) + DEFINE_METHOD1(void, avfilter_unref_buffer, (AVFilterBufferRef *p1)) + DEFINE_METHOD4(int, avfilter_link, (AVFilterContext *p1, unsigned p2, AVFilterContext *p3, unsigned p4)) +@@ -249,10 +170,8 @@ class DllAvFilter : public DllDynamic, DllAvFilterInterface + RESOLVE_METHOD(avfilter_graph_create_filter) + RESOLVE_METHOD(avfilter_get_by_name) + RESOLVE_METHOD(avfilter_graph_alloc) +-#if LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(2,17,0) + RESOLVE_METHOD_RENAME(avfilter_inout_alloc, avfilter_inout_alloc_dont_call) + RESOLVE_METHOD_RENAME(avfilter_inout_free, avfilter_inout_free_dont_call) +-#endif + RESOLVE_METHOD_RENAME(avfilter_graph_parse, avfilter_graph_parse_dont_call) + RESOLVE_METHOD_RENAME(avfilter_graph_config, avfilter_graph_config_dont_call) + RESOLVE_METHOD(avfilter_poll_frame) +@@ -281,12 +200,7 @@ public: + void avfilter_graph_free(AVFilterGraph **graph) + { + CSingleLock lock(DllAvCodec::m_critSection); +-#if LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(1,76,0) + avfilter_graph_free_dont_call(graph); +-#else +- avfilter_graph_free_dont_call(*graph); +- m_dllAvUtil.av_freep(graph); +-#endif + } + void avfilter_register_all() + { +@@ -296,40 +210,22 @@ public: + AVFilterInOut* avfilter_inout_alloc() + { + CSingleLock lock(DllAvCodec::m_critSection); +-#if LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(2,17,0) + return avfilter_inout_alloc_dont_call(); +-#else +- return (AVFilterInOut*)m_dllAvUtil.av_mallocz(sizeof(AVFilterInOut)); +-#endif + } + int avfilter_graph_parse(AVFilterGraph *graph, const char *filters, AVFilterInOut **inputs, AVFilterInOut **outputs, void *log_ctx) + { + CSingleLock lock(DllAvCodec::m_critSection); +-#if LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(2,16,0) + return avfilter_graph_parse_dont_call(graph, filters, inputs, outputs, log_ctx); +-#elif LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(2,15,1) +- return avfilter_graph_parse_dont_call(graph, filters, *inputs, *outputs, log_ctx); +-#else +- return avfilter_graph_parse_dont_call(graph, filters, *inputs, *outputs, (AVClass*)log_ctx); +-#endif + } + void avfilter_inout_free(AVFilterInOut **inout) + { + CSingleLock lock(DllAvCodec::m_critSection); +-#if LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(2,17,0) + avfilter_inout_free_dont_call(inout); +-#else +- *inout = NULL; +-#endif + } + int avfilter_graph_config(AVFilterGraph *graphctx, void *log_ctx) + { + CSingleLock lock(DllAvCodec::m_critSection); +-#if LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(2,15,1) + return avfilter_graph_config_dont_call(graphctx, log_ctx); +-#else +- return avfilter_graph_config_dont_call(graphctx, (AVClass*)log_ctx); +-#endif + } + virtual bool Load() + { +diff --git a/lib/DllAvFormat.h b/lib/DllAvFormat.h +index 9b38c9c..d6753ae 100644 +--- a/lib/DllAvFormat.h ++++ b/lib/DllAvFormat.h +@@ -126,12 +126,7 @@ public: + virtual void av_register_all_dont_call() { *(int* )0x0 = 0; } + virtual AVInputFormat *av_find_input_format(const char *short_name) { return ::av_find_input_format(short_name); } + virtual int url_feof(AVIOContext *s) { return ::url_feof(s); } +-#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(52,31,0) +- // API added on: 2009-03-01 + virtual AVDictionaryEntry *av_metadata_get(AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags){ return ::av_metadata_get(m, key, prev, flags); } +-#else +- virtual AVDictionaryEntry *av_metadata_get(AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags){ return NULL; } +-#endif + virtual void av_close_input_file(AVFormatContext *s) { ::av_close_input_file(s); } + virtual void av_close_input_stream(AVFormatContext *s) { ::av_close_input_stream(s); } + virtual int av_read_frame(AVFormatContext *s, AVPacket *pkt) { return ::av_read_frame(s, pkt); } +@@ -153,12 +148,7 @@ public: + offset_t (*seek)(void *opaque, offset_t offset, int whence)) { return ::init_put_byte(s, buffer, buffer_size, write_flag, opaque, read_packet, write_packet, seek); } + virtual AVInputFormat *av_probe_input_format(AVProbeData *pd, int is_opened) {return ::av_probe_input_format(pd, is_opened); } + virtual AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score_max) {*score_max = 100; return ::av_probe_input_format(pd, is_opened); } // Use av_probe_input_format, this is not exported by ffmpeg's headers +-#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(52,98,0) +- // API added on: 2010-02-08 + virtual int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt, const char *filename, void *logctx, unsigned int offset, unsigned int max_probe_size) { return ::av_probe_input_buffer(pb, fmt, filename, logctx, offset, max_probe_size); } +-#else +- virtual int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt, const char *filename, void *logctx, unsigned int offset, unsigned int max_probe_size) { return -1; } +-#endif + virtual void dump_format(AVFormatContext *ic, int index, const char *url, int is_output) { ::dump_format(ic, index, url, is_output); } + virtual int url_fdopen(AVIOContext **s, URLContext *h) { return ::url_fdopen(s, h); } + virtual int url_fopen(AVIOContext **s, const char *filename, int flags) { return ::url_fopen(s, filename, flags); } +@@ -175,11 +165,7 @@ public: + virtual void put_be16(AVIOContext *s, unsigned int val) { ::put_be16(s, val); } + virtual AVFormatContext *avformat_alloc_context() { return ::avformat_alloc_context(); } + virtual AVStream *avformat_new_stream(AVFormatContext *s, AVCodec *c) { return ::avformat_new_stream(s, c); } +-#if LIBAVFORMAT_VERSION_INT < (52<<16 | 45<<8) +- virtual AVOutputFormat *av_guess_format(const char *short_name, const char *filename, const char *mime_type) { return ::guess_format(short_name, filename, mime_type); } +-#else + virtual AVOutputFormat *av_guess_format(const char *short_name, const char *filename, const char *mime_type) { return ::av_guess_format(short_name, filename, mime_type); } +-#endif + virtual int av_set_parameters(AVFormatContext *s, AVFormatParameters *ap) { return ::av_set_parameters(s, ap); } + virtual AVIOContext *av_alloc_put_byte(unsigned char *buffer, int buffer_size, int write_flag, void *opaque, + int (*read_packet)(void *opaque, uint8_t *buf, int buf_size), +@@ -188,15 +174,7 @@ public: + virtual int av_write_header (AVFormatContext *s) { return ::av_write_header (s); } + virtual int av_write_trailer(AVFormatContext *s) { return ::av_write_trailer(s); } + virtual int av_write_frame (AVFormatContext *s, AVPacket *pkt) { return ::av_write_frame(s, pkt); } +-#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(52,43,0) +- // API added on: 2009-12-13 + virtual int av_metadata_set2(AVDictionary **pm, const char *key, const char *value, int flags) { return ::av_metadata_set2(pm, key, value, flags); } +-#elif LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(52,31,0) +- // API added on: 2009-03-01 +- virtual int av_metadata_set2(AVDictionary **pm, const char *key, const char *value, int flags) { return ::av_metadata_set(pm, key, value); } +-#else +- virtual int av_metadata_set2(AVDictionary **pm, const char *key, const char *value, int flags) { return -1; } +-#endif + + // DLL faking. + virtual bool ResolveExports() { return true; } +@@ -252,11 +230,7 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface + DEFINE_METHOD3(offset_t, url_fseek, (AVIOContext *p1, offset_t p2, int p3)) + DEFINE_METHOD0(AVFormatContext *, avformat_alloc_context) + DEFINE_METHOD2(AVStream *, avformat_new_stream, (AVFormatContext *p1, AVCodec *p2)) +-#if LIBAVFORMAT_VERSION_INT < (52<<16 | 45<<8) +- DEFINE_METHOD3(AVOutputFormat *, guess_format, (const char *p1, const char *p2, const char *p3)) +-#else + DEFINE_METHOD3(AVOutputFormat *, av_guess_format, (const char *p1, const char *p2, const char *p3)) +-#endif + DEFINE_METHOD2(int, av_set_parameters, (AVFormatContext *p1, AVFormatParameters *p2)); + DEFINE_METHOD7(AVIOContext *, av_alloc_put_byte, (unsigned char *p1, int p2, int p3, void *p4, + int(*p5)(void *opaque, uint8_t *buf, int buf_size), +@@ -301,11 +275,7 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface + RESOLVE_METHOD(put_be16) + RESOLVE_METHOD(avformat_alloc_context) + RESOLVE_METHOD(avformat_new_stream) +-#if LIBAVFORMAT_VERSION_INT < (52<<16 | 45<<8) +- RESOLVE_METHOD(guess_format) +-#else + RESOLVE_METHOD(av_guess_format) +-#endif + RESOLVE_METHOD(av_set_parameters) + RESOLVE_METHOD(av_alloc_put_byte) + RESOLVE_METHOD(av_write_header) +diff --git a/xbmc/cdrip/EncoderFFmpeg.cpp b/xbmc/cdrip/EncoderFFmpeg.cpp +index 0b3ef76..220fe21 100644 +--- a/xbmc/cdrip/EncoderFFmpeg.cpp ++++ b/xbmc/cdrip/EncoderFFmpeg.cpp +@@ -59,11 +59,7 @@ bool CEncoderFFmpeg::Init(const char* strFile, int iInChannels, int iInRate, int + + CStdString filename = URIUtils::GetFileName(strFile); + AVOutputFormat *fmt = NULL; +-#if LIBAVFORMAT_VERSION_MAJOR < 52 +- fmt = m_dllAvFormat.guess_format(NULL, filename.c_str(), NULL); +-#else + fmt = m_dllAvFormat.av_guess_format(NULL, filename.c_str(), NULL); +-#endif + if (!fmt) + { + CLog::Log(LOGERROR, "CEncoderFFmpeg::Init - Unable to guess the output format for the file %s", filename.c_str()); +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthroughFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthroughFFmpeg.cpp +index 440b04b..8fae8bf 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthroughFFmpeg.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthroughFFmpeg.cpp +@@ -79,11 +79,7 @@ bool CDVDAudioCodecPassthroughFFmpeg::SetupMuxer(CDVDStreamInfo &hints, CStdStri + /* get the muxer */ + AVOutputFormat *fOut = NULL; + +-#if LIBAVFORMAT_VERSION_MAJOR < 52 +- fOut = m_dllAvFormat.guess_format(muxerName.c_str(), NULL, NULL); +-#else + fOut = m_dllAvFormat.av_guess_format(muxerName.c_str(), NULL, NULL); +-#endif + if (!fOut) + { + CLog::Log(LOGERROR, "CDVDAudioCodecPassthroughFFmpeg::SetupMuxer - Failed to get the FFmpeg %s muxer", muxerName.c_str()); +@@ -124,8 +120,6 @@ bool CDVDAudioCodecPassthroughFFmpeg::SetupMuxer(CDVDStreamInfo &hints, CStdStri + return false; + } + +-#if LIBAVFORMAT_VERSION_INT >= AV_VERSION_INT(52,92,0) +- // API added on: 2011-01-02 + + /* While this is strictly only needed on big-endian systems, we do it on + * both to avoid as much dead code as possible. +@@ -139,7 +133,6 @@ bool CDVDAudioCodecPassthroughFFmpeg::SetupMuxer(CDVDStreamInfo &hints, CStdStri + + /* request output of wanted endianness */ + if (!fOut->priv_class || m_dllAvUtil.av_set_string3(muxer.m_pFormat->priv_data, "spdif_flags", spdifFlags, 0, NULL) != 0) +-#endif + { + #if defined(WORDS_BIGENDIAN) && !defined(__APPLE__) + CLog::Log(LOGERROR, "CDVDAudioCodecPassthroughFFmpeg::SetupMuxer - Unable to set big-endian stream mode (FFmpeg too old?), disabling passthrough"); +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Overlay/DVDOverlayCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Overlay/DVDOverlayCodecFFmpeg.cpp +index 754169e..238c855 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Overlay/DVDOverlayCodecFFmpeg.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Overlay/DVDOverlayCodecFFmpeg.cpp +@@ -134,19 +134,12 @@ void CDVDOverlayCodecFFmpeg::FreeSubtitle(AVSubtitle& sub) + { + for(unsigned i=0;i= (52<<10) + if(sub.rects[i]) + { + m_dllAvUtil.av_free(sub.rects[i]->pict.data[0]); + m_dllAvUtil.av_free(sub.rects[i]->pict.data[1]); + m_dllAvUtil.av_freep(&sub.rects[i]); + } +-#else +- if(sub.rects[i].bitmap) +- m_dllAvUtil.av_freep(&sub.rects[i].bitmap); +- if(m_Subtitle.rects[i].rgba_palette) +- m_dllAvUtil.av_freep(&sub.rects[i].rgba_palette); +-#endif + } + if(sub.rects) + m_dllAvUtil.av_freep(&sub.rects); +@@ -294,7 +287,6 @@ CDVDOverlay* CDVDOverlayCodecFFmpeg::GetOverlay() + overlay->source_width = m_width; + overlay->source_height = m_height; + +-#if LIBAVCODEC_VERSION_INT >= (52<<10) + BYTE* s = rect.pict.data[0]; + BYTE* t = overlay->data; + for(int i=0;idata; +- for(int i=0;ilinesize; +- } +- +- memcpy(overlay->palette, rect.rgba_palette, rect.nb_colors*4); +- +- m_dllAvUtil.av_freep(&rect.bitmap); +- m_dllAvUtil.av_freep(&rect.rgba_palette); +-#endif + m_SubtitleIndex++; + + return overlay; +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +index c792cfd..74f2431 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +@@ -242,9 +242,7 @@ bool CDVDVideoCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options + m_pCodecContext->flags &= CODEC_FLAG_EMU_EDGE; + #else + if (pCodec->id != CODEC_ID_H264 && pCodec->capabilities & CODEC_CAP_DR1 +-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52,69,0) + && pCodec->id != CODEC_ID_VP8 +-#endif + ) + m_pCodecContext->flags |= CODEC_FLAG_EMU_EDGE; + #endif +@@ -600,11 +598,7 @@ bool CDVDVideoCodecFFmpeg::GetPictureCommon(DVDVideoPicture* pDvdVideoPicture) + /* use variable in the frame */ + AVRational pixel_aspect = m_pCodecContext->sample_aspect_ratio; + if (m_pFilterLink) +-#ifdef HAVE_AVFILTERBUFFERREFVIDEOPROPS_SAMPLE_ASPECT_RATIO + pixel_aspect = m_pFilterLink->cur_buf->video->sample_aspect_ratio; +-#else +- pixel_aspect = m_pFilterLink->cur_buf->video->pixel_aspect; +-#endif + + if (pixel_aspect.num == 0) + aspect_ratio = 0; +@@ -814,16 +808,7 @@ int CDVDVideoCodecFFmpeg::FilterProcess(AVFrame* frame) + + if (frame) + { +-#if LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(2,13,0) + result = m_dllAvFilter.av_vsrc_buffer_add_frame(m_pFilterIn, frame, 0); +-#elif LIBAVFILTER_VERSION_INT >= AV_VERSION_INT(2,7,0) +- result = m_dllAvFilter.av_vsrc_buffer_add_frame(m_pFilterIn, frame); +-#elif LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(53,3,0) +- result = m_dllAvFilter.av_vsrc_buffer_add_frame(m_pFilterIn, frame, frame->pts); +-#else +- result = m_dllAvFilter.av_vsrc_buffer_add_frame(m_pFilterIn, frame, frame->pts, m_pCodecContext->sample_aspect_ratio); +-#endif +- + if (result < 0) + { + CLog::Log(LOGERROR, "CDVDVideoCodecFFmpeg::FilterProcess - av_vsrc_buffer_add_frame"); +diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +index 68f4358..f1b0119 100644 +--- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp ++++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +@@ -311,14 +311,6 @@ bool CDVDDemuxFFmpeg::Open(CDVDInputStream* pInput) + + if( iformat == NULL ) + { +-#if defined(USE_EXTERNAL_FFMPEG) && LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(52,98,0) +- // API added on: 2011-02-09 +- // Old versions of ffmpeg do not have av_probe_input_format, so we need +- // to always probe using the lower-level functions as well. +- const bool legacyProbing = true; +-#else +- const bool legacyProbing = false; +-#endif + // let ffmpeg decide which demuxer we have to open + + bool trySPDIFonly = (m_pInput->GetContent() == "audio/x-spdif-compressed"); +@@ -331,7 +323,7 @@ bool CDVDDemuxFFmpeg::Open(CDVDInputStream* pInput) + // want to probe for spdif (DTS or IEC 61937) compressed audio + // specifically, or in case the file is a wav which may contain DTS or + // IEC 61937 (e.g. ac3-in-wav) and we want to check for those formats. +- if (legacyProbing || trySPDIFonly || (iformat && strcmp(iformat->name, "wav") == 0)) ++ if (trySPDIFonly || (iformat && strcmp(iformat->name, "wav") == 0)) + { + AVProbeData pd; + BYTE probe_buffer[FFMPEG_FILE_BUFFER_SIZE + AVPROBE_PADDING_SIZE]; +@@ -352,9 +344,6 @@ bool CDVDDemuxFFmpeg::Open(CDVDInputStream* pInput) + // restore position again + m_dllAvFormat.url_fseek(m_ioContext , 0, SEEK_SET); + +- if (legacyProbing && !trySPDIFonly) +- iformat = m_dllAvFormat.av_probe_input_format(&pd, 1); +- + // the advancedsetting is for allowing the user to force outputting the + // 44.1 kHz DTS wav file as PCM, so that an A/V receiver can decode + // it (this is temporary until we handle 44.1 kHz passthrough properly) diff --git a/srcpkgs/xbmc/patches/090_all_interupt_cb.patch b/srcpkgs/xbmc/patches/090_all_interupt_cb.patch new file mode 100644 index 0000000000..5a152454d7 --- /dev/null +++ b/srcpkgs/xbmc/patches/090_all_interupt_cb.patch @@ -0,0 +1,102 @@ +commit 0bf68bf61aab44ccf6f54a2923ed567f9a56af4a +Author: Alexis Ballier +Date: Thu Mar 1 10:22:11 2012 -0300 + + Drop url_set_interrupt_cb usage which was removed in libavformat 54 and set the callback directly in the AVFormatContext, which was added in libavformat-53.15.0 + +diff --git a/lib/DllAvFormat.h b/lib/DllAvFormat.h +index d6753ae..405a58b 100644 +--- a/lib/DllAvFormat.h ++++ b/lib/DllAvFormat.h +@@ -74,7 +74,6 @@ public: + #if (!defined USE_EXTERNAL_FFMPEG) + virtual int avformat_find_stream_info_dont_call(AVFormatContext *ic, AVDictionary **options)=0; + #endif +- virtual void url_set_interrupt_cb(URLInterruptCB *interrupt_cb)=0; + virtual int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputFormat *fmt, AVDictionary **options)=0; + virtual int init_put_byte(AVIOContext *s, unsigned char *buffer, int buffer_size, int write_flag, void *opaque, + int (*read_packet)(void *opaque, uint8_t *buf, int buf_size), +@@ -139,7 +138,6 @@ public: + CSingleLock lock(DllAvCodec::m_critSection); + return ::avformat_find_stream_info(ic, options); + } +- virtual void url_set_interrupt_cb(URLInterruptCB *interrupt_cb) { ::url_set_interrupt_cb(interrupt_cb); } + virtual int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputFormat *fmt, AVDictionary **options) + { return ::avformat_open_input(ps, filename, fmt, options); } + virtual int init_put_byte(AVIOContext *s, unsigned char *buffer, int buffer_size, int write_flag, void *opaque, +@@ -216,7 +214,6 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface + DEFINE_FUNC_ALIGNED2(void, __cdecl, put_be24, AVIOContext*, unsigned int) + DEFINE_FUNC_ALIGNED2(void, __cdecl, put_be32, AVIOContext*, unsigned int) + DEFINE_FUNC_ALIGNED2(void, __cdecl, put_be16, AVIOContext*, unsigned int) +- DEFINE_METHOD1(void, url_set_interrupt_cb, (URLInterruptCB *p1)) + DEFINE_METHOD8(int, init_put_byte, (AVIOContext *p1, unsigned char *p2, int p3, int p4, void *p5, + int (*p6)(void *opaque, uint8_t *buf, int buf_size), + int (*p7)(void *opaque, uint8_t *buf, int buf_size), +@@ -253,7 +250,6 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface + RESOLVE_METHOD(av_read_frame_flush) + RESOLVE_METHOD(av_seek_frame) + RESOLVE_METHOD_RENAME(avformat_find_stream_info, avformat_find_stream_info_dont_call) +- RESOLVE_METHOD(url_set_interrupt_cb) + RESOLVE_METHOD(avformat_open_input) + RESOLVE_METHOD(init_put_byte) + RESOLVE_METHOD(av_probe_input_format) +diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +index 1205e05..aff44f6 100644 +--- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp ++++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +@@ -160,7 +160,7 @@ static TLS g_tls; + #define g_demuxer (*((CDVDDemuxFFmpeg**)g_tls.Get())) + #endif + +-static int interrupt_cb(void) ++static int interrupt_cb(void* unused) + { + if(g_demuxer && g_demuxer->Aborted()) + return 1; +@@ -178,7 +178,7 @@ static int dvd_file_open(URLContext *h, const char *filename, int flags) + + static int dvd_file_read(void *h, uint8_t* buf, int size) + { +- if(interrupt_cb()) ++ if(interrupt_cb(NULL)) + return -1; + + CDVDInputStream* pInputStream = (CDVDInputStream*)h; +@@ -192,7 +192,7 @@ static int dvd_file_write(URLContext *h, BYTE* buf, int size) + */ + static offset_t dvd_file_seek(void *h, offset_t pos, int whence) + { +- if(interrupt_cb()) ++ if(interrupt_cb(NULL)) + return -1; + + CDVDInputStream* pInputStream = (CDVDInputStream*)h; +@@ -236,6 +236,7 @@ bool CDVDDemuxFFmpeg::Open(CDVDInputStream* pInput) + m_speed = DVD_PLAYSPEED_NORMAL; + g_demuxer = this; + m_program = UINT_MAX; ++ const AVIOInterruptCB int_cb = { interrupt_cb, NULL }; + + if (!pInput) return false; + +@@ -246,10 +247,6 @@ bool CDVDDemuxFFmpeg::Open(CDVDInputStream* pInput) + + // register codecs + m_dllAvFormat.av_register_all(); +- m_dllAvFormat.url_set_interrupt_cb(interrupt_cb); +- +- // could be used for interupting ffmpeg while opening a file (eg internet streams) +- // url_set_interrupt_cb(NULL); + + m_pInput = pInput; + strFile = m_pInput->GetFileName(); +@@ -424,6 +421,9 @@ bool CDVDDemuxFFmpeg::Open(CDVDInputStream* pInput) + } + } + ++ // set the interrupt callback, appeared in libavformat 53.15.0 ++ m_pFormatContext->interrupt_callback = int_cb; ++ + // analyse very short to speed up mjpeg playback start + if (iformat && (strcmp(iformat->name, "mjpeg") == 0) && m_ioContext->seekable == 0) + m_pFormatContext->max_analyze_duration = 500000; diff --git a/srcpkgs/xbmc/patches/100_all_url_fdopen.patch b/srcpkgs/xbmc/patches/100_all_url_fdopen.patch new file mode 100644 index 0000000000..90457b79cd --- /dev/null +++ b/srcpkgs/xbmc/patches/100_all_url_fdopen.patch @@ -0,0 +1,42 @@ +commit 45a39f71ac00bbed4bb3fd7c9ed902f7d93900fc +Author: Alexis Ballier +Date: Thu Mar 1 10:26:43 2012 -0300 + + Do not map url_fdopen as it is deprecated and gone in libavformat 54. It is unused in xbmc code. + +diff --git a/lib/DllAvFormat.h b/lib/DllAvFormat.h +index 405a58b..3c7f9fa 100644 +--- a/lib/DllAvFormat.h ++++ b/lib/DllAvFormat.h +@@ -83,7 +83,6 @@ public: + virtual AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score_max)=0; + virtual int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt, const char *filename, void *logctx, unsigned int offset, unsigned int max_probe_size)=0; + virtual void dump_format(AVFormatContext *ic, int index, const char *url, int is_output)=0; +- virtual int url_fdopen(AVIOContext **s, URLContext *h)=0; + virtual int url_fopen(AVIOContext **s, const char *filename, int flags)=0; + virtual int url_fclose(AVIOContext *s)=0; + virtual int url_open_dyn_buf(AVIOContext **s)=0; +@@ -148,7 +147,6 @@ public: + virtual AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score_max) {*score_max = 100; return ::av_probe_input_format(pd, is_opened); } // Use av_probe_input_format, this is not exported by ffmpeg's headers + virtual int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt, const char *filename, void *logctx, unsigned int offset, unsigned int max_probe_size) { return ::av_probe_input_buffer(pb, fmt, filename, logctx, offset, max_probe_size); } + virtual void dump_format(AVFormatContext *ic, int index, const char *url, int is_output) { ::dump_format(ic, index, url, is_output); } +- virtual int url_fdopen(AVIOContext **s, URLContext *h) { return ::url_fdopen(s, h); } + virtual int url_fopen(AVIOContext **s, const char *filename, int flags) { return ::url_fopen(s, filename, flags); } + virtual int url_fclose(AVIOContext *s) { return ::url_fclose(s); } + virtual int url_open_dyn_buf(AVIOContext **s) { return ::url_open_dyn_buf(s); } +@@ -219,7 +217,6 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface + int (*p7)(void *opaque, uint8_t *buf, int buf_size), + offset_t (*p8)(void *opaque, offset_t offset, int whence))) + DEFINE_METHOD4(void, dump_format, (AVFormatContext *p1, int p2, const char *p3, int p4)) +- DEFINE_METHOD2(int, url_fdopen, (AVIOContext **p1, URLContext *p2)) + DEFINE_METHOD3(int, url_fopen, (AVIOContext **p1, const char *p2, int p3)) + DEFINE_METHOD1(int, url_fclose, (AVIOContext *p1)) + DEFINE_METHOD1(int, url_open_dyn_buf, (AVIOContext **p1)) +@@ -256,7 +253,6 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface + RESOLVE_METHOD(av_probe_input_format2) + RESOLVE_METHOD(av_probe_input_buffer) + RESOLVE_METHOD(dump_format) +- RESOLVE_METHOD(url_fdopen) + RESOLVE_METHOD(url_fopen) + RESOLVE_METHOD(url_fclose) + RESOLVE_METHOD(url_open_dyn_buf) diff --git a/srcpkgs/xbmc/patches/110_all_av_write_header.patch b/srcpkgs/xbmc/patches/110_all_av_write_header.patch new file mode 100644 index 0000000000..641d118ede --- /dev/null +++ b/srcpkgs/xbmc/patches/110_all_av_write_header.patch @@ -0,0 +1,74 @@ +commit e4396ee8a6010c03dca976c8204c29d1da1ec299 +Author: Alexis Ballier +Date: Thu Mar 1 10:33:19 2012 -0300 + + Replace av_write_header by avformat_write_header. + + The former is gone in libavformat 54. + +diff --git a/lib/DllAvFormat.h b/lib/DllAvFormat.h +index 3c7f9fa..df946ee 100644 +--- a/lib/DllAvFormat.h ++++ b/lib/DllAvFormat.h +@@ -103,7 +103,7 @@ public: + int (*read_packet)(void *opaque, uint8_t *buf, int buf_size), + int (*write_packet)(void *opaque, uint8_t *buf, int buf_size), + offset_t (*seek)(void *opaque, offset_t offset, int whence))=0; +- virtual int av_write_header (AVFormatContext *s)=0; ++ virtual int avformat_write_header (AVFormatContext *s, AVDictionary **options)=0; + virtual int av_write_trailer(AVFormatContext *s)=0; + virtual int av_write_frame (AVFormatContext *s, AVPacket *pkt)=0; + virtual int av_metadata_set2(AVDictionary **pm, const char *key, const char *value, int flags)=0; +@@ -167,7 +167,7 @@ public: + int (*read_packet)(void *opaque, uint8_t *buf, int buf_size), + int (*write_packet)(void *opaque, uint8_t *buf, int buf_size), + offset_t (*seek)(void *opaque, offset_t offset, int whence)) { return ::av_alloc_put_byte(buffer, buffer_size, write_flag, opaque, read_packet, write_packet, seek); } +- virtual int av_write_header (AVFormatContext *s) { return ::av_write_header (s); } ++ virtual int avformat_write_header (AVFormatContext *s, AVDictionary **options) { return ::avformat_write_header (s, options); } + virtual int av_write_trailer(AVFormatContext *s) { return ::av_write_trailer(s); } + virtual int av_write_frame (AVFormatContext *s, AVPacket *pkt) { return ::av_write_frame(s, pkt); } + virtual int av_metadata_set2(AVDictionary **pm, const char *key, const char *value, int flags) { return ::av_metadata_set2(pm, key, value, flags); } +@@ -230,7 +230,7 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface + int(*p5)(void *opaque, uint8_t *buf, int buf_size), + int(*p6)(void *opaque, uint8_t *buf, int buf_size), + offset_t(*p7)(void *opaque, offset_t offset, int whence))) +- DEFINE_METHOD1(int, av_write_header , (AVFormatContext *p1)) ++ DEFINE_METHOD2(int, avformat_write_header , (AVFormatContext *p1, AVDictionary **p2)) + DEFINE_METHOD1(int, av_write_trailer, (AVFormatContext *p1)) + DEFINE_METHOD2(int, av_write_frame , (AVFormatContext *p1, AVPacket *p2)) + DEFINE_METHOD4(int, av_metadata_set2, (AVDictionary **p1, const char *p2, const char *p3, int p4)); +@@ -270,7 +270,7 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface + RESOLVE_METHOD(av_guess_format) + RESOLVE_METHOD(av_set_parameters) + RESOLVE_METHOD(av_alloc_put_byte) +- RESOLVE_METHOD(av_write_header) ++ RESOLVE_METHOD(avformat_write_header) + RESOLVE_METHOD(av_write_trailer) + RESOLVE_METHOD(av_write_frame) + RESOLVE_METHOD(av_metadata_set2) +diff --git a/xbmc/cdrip/EncoderFFmpeg.cpp b/xbmc/cdrip/EncoderFFmpeg.cpp +index 220fe21..13c9772 100644 +--- a/xbmc/cdrip/EncoderFFmpeg.cpp ++++ b/xbmc/cdrip/EncoderFFmpeg.cpp +@@ -175,7 +175,7 @@ bool CEncoderFFmpeg::Init(const char* strFile, int iInChannels, int iInRate, int + SetTag("encoder" , "XBMC FFmpeg Encoder"); + + /* write the header */ +- if (m_dllAvFormat.av_write_header(m_Format) != 0) ++ if (m_dllAvFormat.avformat_write_header(m_Format, NULL) != 0) + { + CLog::Log(LOGERROR, "CEncoderFFmpeg::Init - Failed to write the header"); + delete[] m_Buffer; +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthroughFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthroughFFmpeg.cpp +index 9b71fd3..4257f96 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthroughFFmpeg.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthroughFFmpeg.cpp +@@ -169,7 +169,7 @@ bool CDVDAudioCodecPassthroughFFmpeg::SetupMuxer(CDVDStreamInfo &hints, CStdStri + codec->extradata_size = hints.extrasize; + memcpy(codec->extradata, hints.extradata, hints.extrasize); + +- muxer.m_WroteHeader = m_dllAvFormat.av_write_header(muxer.m_pFormat) == 0; ++ muxer.m_WroteHeader = m_dllAvFormat.avformat_write_header(muxer.m_pFormat, NULL) == 0; + if (!muxer.m_WroteHeader) + { + CLog::Log(LOGERROR, "CDVDAudioCodecPassthrough::SetupMuxer - Failed to write the frame header"); diff --git a/srcpkgs/xbmc/patches/120_all_av_set_params.patch b/srcpkgs/xbmc/patches/120_all_av_set_params.patch new file mode 100644 index 0000000000..28c5fae262 --- /dev/null +++ b/srcpkgs/xbmc/patches/120_all_av_set_params.patch @@ -0,0 +1,84 @@ +commit 157206286d3a165f97c4d0ef67e70756d6b4f496 +Author: Alexis Ballier +Date: Thu Mar 1 10:44:00 2012 -0300 + + Remove av_set_parameters. + + It is gone in libavformat 54 and avformat_write_header takes care of allocating data as needed. + +diff --git a/lib/DllAvFormat.h b/lib/DllAvFormat.h +index df946ee..0671fee 100644 +--- a/lib/DllAvFormat.h ++++ b/lib/DllAvFormat.h +@@ -98,7 +98,6 @@ public: + virtual AVFormatContext *avformat_alloc_context(void)=0; + virtual AVStream *avformat_new_stream(AVFormatContext *s, AVCodec *c)=0; + virtual AVOutputFormat *av_guess_format(const char *short_name, const char *filename, const char *mime_type)=0; +- virtual int av_set_parameters(AVFormatContext *s, AVFormatParameters *ap)=0; + virtual AVIOContext *av_alloc_put_byte(unsigned char *buffer, int buffer_size, int write_flag, void *opaque, + int (*read_packet)(void *opaque, uint8_t *buf, int buf_size), + int (*write_packet)(void *opaque, uint8_t *buf, int buf_size), +@@ -162,7 +161,6 @@ public: + virtual AVFormatContext *avformat_alloc_context() { return ::avformat_alloc_context(); } + virtual AVStream *avformat_new_stream(AVFormatContext *s, AVCodec *c) { return ::avformat_new_stream(s, c); } + virtual AVOutputFormat *av_guess_format(const char *short_name, const char *filename, const char *mime_type) { return ::av_guess_format(short_name, filename, mime_type); } +- virtual int av_set_parameters(AVFormatContext *s, AVFormatParameters *ap) { return ::av_set_parameters(s, ap); } + virtual AVIOContext *av_alloc_put_byte(unsigned char *buffer, int buffer_size, int write_flag, void *opaque, + int (*read_packet)(void *opaque, uint8_t *buf, int buf_size), + int (*write_packet)(void *opaque, uint8_t *buf, int buf_size), +@@ -225,7 +223,6 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface + DEFINE_METHOD0(AVFormatContext *, avformat_alloc_context) + DEFINE_METHOD2(AVStream *, avformat_new_stream, (AVFormatContext *p1, AVCodec *p2)) + DEFINE_METHOD3(AVOutputFormat *, av_guess_format, (const char *p1, const char *p2, const char *p3)) +- DEFINE_METHOD2(int, av_set_parameters, (AVFormatContext *p1, AVFormatParameters *p2)); + DEFINE_METHOD7(AVIOContext *, av_alloc_put_byte, (unsigned char *p1, int p2, int p3, void *p4, + int(*p5)(void *opaque, uint8_t *buf, int buf_size), + int(*p6)(void *opaque, uint8_t *buf, int buf_size), +@@ -268,7 +265,6 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface + RESOLVE_METHOD(avformat_alloc_context) + RESOLVE_METHOD(avformat_new_stream) + RESOLVE_METHOD(av_guess_format) +- RESOLVE_METHOD(av_set_parameters) + RESOLVE_METHOD(av_alloc_put_byte) + RESOLVE_METHOD(avformat_write_header) + RESOLVE_METHOD(av_write_trailer) +diff --git a/xbmc/cdrip/EncoderFFmpeg.cpp b/xbmc/cdrip/EncoderFFmpeg.cpp +index 13c9772..7959919 100644 +--- a/xbmc/cdrip/EncoderFFmpeg.cpp ++++ b/xbmc/cdrip/EncoderFFmpeg.cpp +@@ -89,15 +89,6 @@ bool CEncoderFFmpeg::Init(const char* strFile, int iInChannels, int iInRate, int + m_Format->oformat = fmt; + m_Format->bit_rate = g_guiSettings.GetInt("audiocds.bitrate") * 1000; + +- /* setup the muxer */ +- if (m_dllAvFormat.av_set_parameters(m_Format, NULL) != 0) +- { +- m_dllAvUtil.av_freep(&m_Format->pb); +- m_dllAvUtil.av_freep(&m_Format); +- CLog::Log(LOGERROR, "CEncoderFFmpeg::Init - Failed to set the muxer parameters"); +- return false; +- } +- + /* add a stream to it */ + m_Stream = m_dllAvFormat.avformat_new_stream(m_Format, codec); + if (!m_Stream) +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthroughFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthroughFFmpeg.cpp +index 4257f96..d230623 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthroughFFmpeg.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthroughFFmpeg.cpp +@@ -112,15 +112,6 @@ bool CDVDAudioCodecPassthroughFFmpeg::SetupMuxer(CDVDStreamInfo &hints, CStdStri + muxer.m_pFormat->flags |= AVFMT_NOFILE | AVFMT_FLAG_IGNIDX; + muxer.m_pFormat->bit_rate = hints.bitrate; + +- /* setup the muxer */ +- if (m_dllAvFormat.av_set_parameters(muxer.m_pFormat, NULL) != 0) +- { +- CLog::Log(LOGERROR, "CDVDAudioCodecPassthroughFFmpeg::SetupMuxer - Failed to set the %s muxer parameters", muxerName.c_str()); +- Dispose(); +- return false; +- } +- +- + /* While this is strictly only needed on big-endian systems, we do it on + * both to avoid as much dead code as possible. + * CoreAudio (at least on the cases we've seen) wants IEC 61937 in diff --git a/srcpkgs/xbmc/patches/130_all_av_metadata.patch b/srcpkgs/xbmc/patches/130_all_av_metadata.patch new file mode 100644 index 0000000000..230eedd904 --- /dev/null +++ b/srcpkgs/xbmc/patches/130_all_av_metadata.patch @@ -0,0 +1,179 @@ +commit 2528bd0db7331f98167c7e18dafddb568840c471 +Author: Alexis Ballier +Date: Thu Mar 1 10:48:46 2012 -0300 + + Replace av_metadata_(get/set2) by av_dict_(get/set). + + The former is deprecated and gone in ffmpeg git. + +diff --git a/lib/DllAvFormat.h b/lib/DllAvFormat.h +index 0671fee..4f9a60d 100644 +--- a/lib/DllAvFormat.h ++++ b/lib/DllAvFormat.h +@@ -63,7 +63,6 @@ public: + virtual void av_register_all_dont_call(void)=0; + virtual AVInputFormat *av_find_input_format(const char *short_name)=0; + virtual int url_feof(AVIOContext *s)=0; +- virtual AVDictionaryEntry *av_metadata_get(AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags)=0; + virtual void av_close_input_file(AVFormatContext *s)=0; + virtual void av_close_input_stream(AVFormatContext *s)=0; + virtual int av_read_frame(AVFormatContext *s, AVPacket *pkt)=0; +@@ -105,7 +104,6 @@ public: + virtual int avformat_write_header (AVFormatContext *s, AVDictionary **options)=0; + virtual int av_write_trailer(AVFormatContext *s)=0; + virtual int av_write_frame (AVFormatContext *s, AVPacket *pkt)=0; +- virtual int av_metadata_set2(AVDictionary **pm, const char *key, const char *value, int flags)=0; + }; + + #if (defined USE_EXTERNAL_FFMPEG) +@@ -123,7 +121,6 @@ public: + virtual void av_register_all_dont_call() { *(int* )0x0 = 0; } + virtual AVInputFormat *av_find_input_format(const char *short_name) { return ::av_find_input_format(short_name); } + virtual int url_feof(AVIOContext *s) { return ::url_feof(s); } +- virtual AVDictionaryEntry *av_metadata_get(AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags){ return ::av_metadata_get(m, key, prev, flags); } + virtual void av_close_input_file(AVFormatContext *s) { ::av_close_input_file(s); } + virtual void av_close_input_stream(AVFormatContext *s) { ::av_close_input_stream(s); } + virtual int av_read_frame(AVFormatContext *s, AVPacket *pkt) { return ::av_read_frame(s, pkt); } +@@ -168,7 +165,6 @@ public: + virtual int avformat_write_header (AVFormatContext *s, AVDictionary **options) { return ::avformat_write_header (s, options); } + virtual int av_write_trailer(AVFormatContext *s) { return ::av_write_trailer(s); } + virtual int av_write_frame (AVFormatContext *s, AVPacket *pkt) { return ::av_write_frame(s, pkt); } +- virtual int av_metadata_set2(AVDictionary **pm, const char *key, const char *value, int flags) { return ::av_metadata_set2(pm, key, value, flags); } + + // DLL faking. + virtual bool ResolveExports() { return true; } +@@ -190,7 +186,6 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface + DEFINE_METHOD0(void, av_register_all_dont_call) + DEFINE_METHOD1(AVInputFormat*, av_find_input_format, (const char *p1)) + DEFINE_METHOD1(int, url_feof, (AVIOContext *p1)) +- DEFINE_METHOD4(AVDictionaryEntry*, av_metadata_get, (AVDictionary *p1, const char *p2, const AVDictionaryEntry *p3, int p4)) + DEFINE_METHOD1(void, av_close_input_file, (AVFormatContext *p1)) + DEFINE_METHOD1(void, av_close_input_stream, (AVFormatContext *p1)) + DEFINE_METHOD1(int, av_read_play, (AVFormatContext *p1)) +@@ -230,12 +225,10 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface + DEFINE_METHOD2(int, avformat_write_header , (AVFormatContext *p1, AVDictionary **p2)) + DEFINE_METHOD1(int, av_write_trailer, (AVFormatContext *p1)) + DEFINE_METHOD2(int, av_write_frame , (AVFormatContext *p1, AVPacket *p2)) +- DEFINE_METHOD4(int, av_metadata_set2, (AVDictionary **p1, const char *p2, const char *p3, int p4)); + BEGIN_METHOD_RESOLVE() + RESOLVE_METHOD_RENAME(av_register_all, av_register_all_dont_call) + RESOLVE_METHOD(av_find_input_format) + RESOLVE_METHOD(url_feof) +- RESOLVE_METHOD(av_metadata_get) + RESOLVE_METHOD(av_close_input_file) + RESOLVE_METHOD(av_close_input_stream) + RESOLVE_METHOD(av_read_frame) +@@ -269,7 +262,6 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface + RESOLVE_METHOD(avformat_write_header) + RESOLVE_METHOD(av_write_trailer) + RESOLVE_METHOD(av_write_frame) +- RESOLVE_METHOD(av_metadata_set2) + END_METHOD_RESOLVE() + + /* dependencies of libavformat */ +diff --git a/lib/DllAvUtil.h b/lib/DllAvUtil.h +index f907834..0a293f9 100644 +--- a/lib/DllAvUtil.h ++++ b/lib/DllAvUtil.h +@@ -99,6 +99,8 @@ public: + virtual int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size, int (*func)(void*, void*, int)) = 0; + virtual char *av_strdup(const char *s)=0; + virtual int av_get_bits_per_sample_fmt(enum AVSampleFormat p1) = 0; ++ virtual AVDictionaryEntry *av_dict_get(AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags) = 0; ++ virtual int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)=0; + }; + + #if (defined USE_EXTERNAL_FFMPEG) +@@ -136,6 +138,8 @@ public: + virtual char *av_strdup(const char *s) { return ::av_strdup(s); } + virtual int av_get_bits_per_sample_fmt(enum AVSampleFormat p1) + { return ::av_get_bits_per_sample_fmt(p1); } ++ virtual AVDictionaryEntry *av_dict_get(AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags){ return ::av_dict_get(m, key, prev, flags); } ++ virtual int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags) { return ::av_dict_set(pm, key, value, flags); } + + // DLL faking. + virtual bool ResolveExports() { return true; } +@@ -173,6 +177,8 @@ class DllAvUtilBase : public DllDynamic, DllAvUtilInterface + DEFINE_METHOD4(int, av_fifo_generic_write, (AVFifoBuffer *p1, void *p2, int p3, int (*p4)(void*, void*, int))) + DEFINE_METHOD1(char*, av_strdup, (const char *p1)) + DEFINE_METHOD1(int, av_get_bits_per_sample_fmt, (enum AVSampleFormat p1)) ++ DEFINE_METHOD4(AVDictionaryEntry *, av_dict_get, (AVDictionary *p1, const char *p2, const AVDictionaryEntry *p3, int p4)) ++ DEFINE_METHOD4(int, av_dict_set, (AVDictionary **p1, const char *p2, const char *p3, int p4)); + + public: + BEGIN_METHOD_RESOLVE() +@@ -195,6 +201,8 @@ class DllAvUtilBase : public DllDynamic, DllAvUtilInterface + RESOLVE_METHOD(av_fifo_generic_write) + RESOLVE_METHOD(av_strdup) + RESOLVE_METHOD(av_get_bits_per_sample_fmt) ++ RESOLVE_METHOD(av_dict_get) ++ RESOLVE_METHOD(av_dict_set) + END_METHOD_RESOLVE() + }; + +diff --git a/xbmc/cdrip/EncoderFFmpeg.cpp b/xbmc/cdrip/EncoderFFmpeg.cpp +index 7959919..b67b231 100644 +--- a/xbmc/cdrip/EncoderFFmpeg.cpp ++++ b/xbmc/cdrip/EncoderFFmpeg.cpp +@@ -181,7 +181,7 @@ bool CEncoderFFmpeg::Init(const char* strFile, int iInChannels, int iInRate, int + + void CEncoderFFmpeg::SetTag(const CStdString tag, const CStdString value) + { +- m_dllAvFormat.av_metadata_set2(&m_Format->metadata, tag.c_str(), value.c_str(), 0); ++ m_dllAvUtil.av_dict_set(&m_Format->metadata, tag.c_str(), value.c_str(), 0); + } + + int CEncoderFFmpeg::MuxerReadPacket(void *opaque, uint8_t *buf, int buf_size) +diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +index aff44f6..991491c 100644 +--- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp ++++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +@@ -959,8 +959,8 @@ void CDVDDemuxFFmpeg::AddStream(int iId) + st->iBitRate = pStream->codec->bit_rate; + st->iBitsPerSample = pStream->codec->bits_per_coded_sample; + +- if(m_dllAvFormat.av_metadata_get(pStream->metadata, "title", NULL, 0)) +- st->m_description = m_dllAvFormat.av_metadata_get(pStream->metadata, "title", NULL, 0)->value; ++ if(m_dllAvUtil.av_dict_get(pStream->metadata, "title", NULL, 0)) ++ st->m_description = m_dllAvUtil.av_dict_get(pStream->metadata, "title", NULL, 0)->value; + + break; + } +@@ -1049,8 +1049,8 @@ void CDVDDemuxFFmpeg::AddStream(int iId) + if(pStream->codec) + st->identifier = pStream->codec->sub_id; + +- if(m_dllAvFormat.av_metadata_get(pStream->metadata, "title", NULL, 0)) +- st->m_description = m_dllAvFormat.av_metadata_get(pStream->metadata, "title", NULL, 0)->value; ++ if(m_dllAvUtil.av_dict_get(pStream->metadata, "title", NULL, 0)) ++ st->m_description = m_dllAvUtil.av_dict_get(pStream->metadata, "title", NULL, 0)->value; + + break; + } +@@ -1061,7 +1061,7 @@ void CDVDDemuxFFmpeg::AddStream(int iId) + { + std::string fileName = "special://temp/fonts/"; + XFILE::CDirectory::Create(fileName); +- AVDictionaryEntry *nameTag = m_dllAvFormat.av_metadata_get(pStream->metadata, "filename", NULL, 0); ++ AVDictionaryEntry *nameTag = m_dllAvUtil.av_dict_get(pStream->metadata, "filename", NULL, 0); + if (!nameTag) { + CLog::Log(LOGERROR, "%s: TTF attachment has no name", __FUNCTION__); + break; +@@ -1110,7 +1110,7 @@ void CDVDDemuxFFmpeg::AddStream(int iId) + // API added on: 2010-10-15 + // (Note that while the function was available earlier, the generic + // metadata tags were not populated by default) +- AVDictionaryEntry *langTag = m_dllAvFormat.av_metadata_get(pStream->metadata, "language", NULL, 0); ++ AVDictionaryEntry *langTag = m_dllAvUtil.av_dict_get(pStream->metadata, "language", NULL, 0); + if (langTag) + strncpy(m_streams[iId]->language, langTag->value, 3); + #else +@@ -1220,7 +1220,7 @@ void CDVDDemuxFFmpeg::GetChapterName(std::string& strChapterName) + // API added on: 2010-10-15 + // (Note that while the function was available earlier, the generic + // metadata tags were not populated by default) +- AVDictionaryEntry *titleTag = m_dllAvFormat.av_metadata_get(m_pFormatContext->chapters[chapterIdx-1]->metadata, ++ AVDictionaryEntry *titleTag = m_dllAvUtil.av_dict_get(m_pFormatContext->chapters[chapterIdx-1]->metadata, + "title", NULL, 0); + if (titleTag) + strChapterName = titleTag->value; diff --git a/srcpkgs/xbmc/patches/140_all_av_close.patch b/srcpkgs/xbmc/patches/140_all_av_close.patch new file mode 100644 index 0000000000..4b3da9d415 --- /dev/null +++ b/srcpkgs/xbmc/patches/140_all_av_close.patch @@ -0,0 +1,82 @@ +commit d6669d741f69e3d937c1949ef1986a952189fde4 +Author: Alexis Ballier +Date: Thu Mar 1 11:08:29 2012 -0300 + + Merge av_close_input_{file,stream} into avformat_close_input. + + The formers are deprecated and gone in libavformat 54. + Moreover, this allows removing some code because avformat_close_input takes care of freeing relevant structures. + +diff --git a/lib/DllAvFormat.h b/lib/DllAvFormat.h +index 4f9a60d..f6d6b70 100644 +--- a/lib/DllAvFormat.h ++++ b/lib/DllAvFormat.h +@@ -63,8 +63,7 @@ public: + virtual void av_register_all_dont_call(void)=0; + virtual AVInputFormat *av_find_input_format(const char *short_name)=0; + virtual int url_feof(AVIOContext *s)=0; +- virtual void av_close_input_file(AVFormatContext *s)=0; +- virtual void av_close_input_stream(AVFormatContext *s)=0; ++ virtual void avformat_close_input(AVFormatContext **s)=0; + virtual int av_read_frame(AVFormatContext *s, AVPacket *pkt)=0; + virtual void av_read_frame_flush(AVFormatContext *s)=0; + virtual int av_read_play(AVFormatContext *s)=0; +@@ -121,8 +120,7 @@ public: + virtual void av_register_all_dont_call() { *(int* )0x0 = 0; } + virtual AVInputFormat *av_find_input_format(const char *short_name) { return ::av_find_input_format(short_name); } + virtual int url_feof(AVIOContext *s) { return ::url_feof(s); } +- virtual void av_close_input_file(AVFormatContext *s) { ::av_close_input_file(s); } +- virtual void av_close_input_stream(AVFormatContext *s) { ::av_close_input_stream(s); } ++ virtual void avformat_close_input(AVFormatContext **s) { ::avformat_close_input(s); } + virtual int av_read_frame(AVFormatContext *s, AVPacket *pkt) { return ::av_read_frame(s, pkt); } + virtual void av_read_frame_flush(AVFormatContext *s) { ::av_read_frame_flush(s); } + virtual int av_read_play(AVFormatContext *s) { return ::av_read_play(s); } +@@ -186,8 +184,7 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface + DEFINE_METHOD0(void, av_register_all_dont_call) + DEFINE_METHOD1(AVInputFormat*, av_find_input_format, (const char *p1)) + DEFINE_METHOD1(int, url_feof, (AVIOContext *p1)) +- DEFINE_METHOD1(void, av_close_input_file, (AVFormatContext *p1)) +- DEFINE_METHOD1(void, av_close_input_stream, (AVFormatContext *p1)) ++ DEFINE_METHOD1(void, avformat_close_input, (AVFormatContext **p1)) + DEFINE_METHOD1(int, av_read_play, (AVFormatContext *p1)) + DEFINE_METHOD1(int, av_read_pause, (AVFormatContext *p1)) + DEFINE_METHOD1(void, av_read_frame_flush, (AVFormatContext *p1)) +@@ -229,8 +226,7 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface + RESOLVE_METHOD_RENAME(av_register_all, av_register_all_dont_call) + RESOLVE_METHOD(av_find_input_format) + RESOLVE_METHOD(url_feof) +- RESOLVE_METHOD(av_close_input_file) +- RESOLVE_METHOD(av_close_input_stream) ++ RESOLVE_METHOD(avformat_close_input) + RESOLVE_METHOD(av_read_frame) + RESOLVE_METHOD(av_read_play) + RESOLVE_METHOD(av_read_pause) +diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +index 991491c..f1fad8c 100644 +--- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp ++++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +@@ -502,20 +502,12 @@ void CDVDDemuxFFmpeg::Dispose() + + if (m_pFormatContext) + { +- if (m_ioContext) ++ if (m_ioContext && m_pFormatContext->pb && m_pFormatContext->pb != m_ioContext) + { +- if(m_pFormatContext->pb && m_pFormatContext->pb != m_ioContext) +- { +- CLog::Log(LOGWARNING, "CDVDDemuxFFmpeg::Dispose - demuxer changed our byte context behind our back, possible memleak"); +- m_ioContext = m_pFormatContext->pb; +- } +- m_dllAvFormat.av_close_input_stream(m_pFormatContext); +- if (m_ioContext->buffer) +- m_dllAvUtil.av_free(m_ioContext->buffer); +- m_dllAvUtil.av_free(m_ioContext); ++ CLog::Log(LOGWARNING, "CDVDDemuxFFmpeg::Dispose - demuxer changed our byte context behind our back, possible memleak"); ++ m_ioContext = m_pFormatContext->pb; + } +- else +- m_dllAvFormat.av_close_input_file(m_pFormatContext); ++ m_dllAvFormat.avformat_close_input(&m_pFormatContext); + } + m_ioContext = NULL; + m_pFormatContext = NULL; diff --git a/srcpkgs/xbmc/patches/150_all_init_put_byte.patch b/srcpkgs/xbmc/patches/150_all_init_put_byte.patch new file mode 100644 index 0000000000..aa581fadaf --- /dev/null +++ b/srcpkgs/xbmc/patches/150_all_init_put_byte.patch @@ -0,0 +1,57 @@ +commit 9cf83f59602b436179e935186639c56a216f6762 +Author: Alexis Ballier +Date: Thu Mar 1 11:17:37 2012 -0300 + + Replace init_put_byte by avio_alloc_context. + + The former is deprecated as of ffmpeg 0.9 and is gone in libavformat 54. + +diff --git a/lib/DllAvFormat.h b/lib/DllAvFormat.h +index f6d6b70..e3f0a9a 100644 +--- a/lib/DllAvFormat.h ++++ b/lib/DllAvFormat.h +@@ -73,7 +73,7 @@ public: + virtual int avformat_find_stream_info_dont_call(AVFormatContext *ic, AVDictionary **options)=0; + #endif + virtual int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputFormat *fmt, AVDictionary **options)=0; +- virtual int init_put_byte(AVIOContext *s, unsigned char *buffer, int buffer_size, int write_flag, void *opaque, ++ virtual AVIOContext *avio_alloc_context(unsigned char *buffer, int buffer_size, int write_flag, void *opaque, + int (*read_packet)(void *opaque, uint8_t *buf, int buf_size), + int (*write_packet)(void *opaque, uint8_t *buf, int buf_size), + offset_t (*seek)(void *opaque, offset_t offset, int whence))=0; +@@ -133,10 +133,10 @@ public: + } + virtual int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputFormat *fmt, AVDictionary **options) + { return ::avformat_open_input(ps, filename, fmt, options); } +- virtual int init_put_byte(AVIOContext *s, unsigned char *buffer, int buffer_size, int write_flag, void *opaque, ++ virtual AVIOContext *avio_alloc_context(unsigned char *buffer, int buffer_size, int write_flag, void *opaque, + int (*read_packet)(void *opaque, uint8_t *buf, int buf_size), + int (*write_packet)(void *opaque, uint8_t *buf, int buf_size), +- offset_t (*seek)(void *opaque, offset_t offset, int whence)) { return ::init_put_byte(s, buffer, buffer_size, write_flag, opaque, read_packet, write_packet, seek); } ++ offset_t (*seek)(void *opaque, offset_t offset, int whence)) { return ::avio_alloc_context(buffer, buffer_size, write_flag, opaque, read_packet, write_packet, seek); } + virtual AVInputFormat *av_probe_input_format(AVProbeData *pd, int is_opened) {return ::av_probe_input_format(pd, is_opened); } + virtual AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score_max) {*score_max = 100; return ::av_probe_input_format(pd, is_opened); } // Use av_probe_input_format, this is not exported by ffmpeg's headers + virtual int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt, const char *filename, void *logctx, unsigned int offset, unsigned int max_probe_size) { return ::av_probe_input_buffer(pb, fmt, filename, logctx, offset, max_probe_size); } +@@ -202,10 +202,10 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface + DEFINE_FUNC_ALIGNED2(void, __cdecl, put_be24, AVIOContext*, unsigned int) + DEFINE_FUNC_ALIGNED2(void, __cdecl, put_be32, AVIOContext*, unsigned int) + DEFINE_FUNC_ALIGNED2(void, __cdecl, put_be16, AVIOContext*, unsigned int) +- DEFINE_METHOD8(int, init_put_byte, (AVIOContext *p1, unsigned char *p2, int p3, int p4, void *p5, ++ DEFINE_METHOD7(AVIOContext *, avio_alloc_context, (unsigned char *p1, int p2, int p3, void *p4, ++ int (*p5)(void *opaque, uint8_t *buf, int buf_size), + int (*p6)(void *opaque, uint8_t *buf, int buf_size), +- int (*p7)(void *opaque, uint8_t *buf, int buf_size), +- offset_t (*p8)(void *opaque, offset_t offset, int whence))) ++ offset_t (*p7)(void *opaque, offset_t offset, int whence))) + DEFINE_METHOD4(void, dump_format, (AVFormatContext *p1, int p2, const char *p3, int p4)) + DEFINE_METHOD3(int, url_fopen, (AVIOContext **p1, const char *p2, int p3)) + DEFINE_METHOD1(int, url_fclose, (AVIOContext *p1)) +@@ -234,7 +234,7 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface + RESOLVE_METHOD(av_seek_frame) + RESOLVE_METHOD_RENAME(avformat_find_stream_info, avformat_find_stream_info_dont_call) + RESOLVE_METHOD(avformat_open_input) +- RESOLVE_METHOD(init_put_byte) ++ RESOLVE_METHOD(avio_alloc_context) + RESOLVE_METHOD(av_probe_input_format) + RESOLVE_METHOD(av_probe_input_format2) + RESOLVE_METHOD(av_probe_input_buffer) diff --git a/srcpkgs/xbmc/patches/160_all_dump_format.patch b/srcpkgs/xbmc/patches/160_all_dump_format.patch new file mode 100644 index 0000000000..d270069c8a --- /dev/null +++ b/srcpkgs/xbmc/patches/160_all_dump_format.patch @@ -0,0 +1,59 @@ +commit 3d4c4fe835bb7a46c5970674b0c6c416fb3822f1 +Author: Alexis Ballier +Date: Thu Mar 1 11:22:51 2012 -0300 + + Replace dump_format by av_dump_format. + +diff --git a/lib/DllAvFormat.h b/lib/DllAvFormat.h +index e3f0a9a..7f88c7b 100644 +--- a/lib/DllAvFormat.h ++++ b/lib/DllAvFormat.h +@@ -80,7 +80,7 @@ public: + virtual AVInputFormat *av_probe_input_format(AVProbeData *pd, int is_opened)=0; + virtual AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score_max)=0; + virtual int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt, const char *filename, void *logctx, unsigned int offset, unsigned int max_probe_size)=0; +- virtual void dump_format(AVFormatContext *ic, int index, const char *url, int is_output)=0; ++ virtual void av_dump_format(AVFormatContext *ic, int index, const char *url, int is_output)=0; + virtual int url_fopen(AVIOContext **s, const char *filename, int flags)=0; + virtual int url_fclose(AVIOContext *s)=0; + virtual int url_open_dyn_buf(AVIOContext **s)=0; +@@ -140,7 +140,7 @@ public: + virtual AVInputFormat *av_probe_input_format(AVProbeData *pd, int is_opened) {return ::av_probe_input_format(pd, is_opened); } + virtual AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score_max) {*score_max = 100; return ::av_probe_input_format(pd, is_opened); } // Use av_probe_input_format, this is not exported by ffmpeg's headers + virtual int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt, const char *filename, void *logctx, unsigned int offset, unsigned int max_probe_size) { return ::av_probe_input_buffer(pb, fmt, filename, logctx, offset, max_probe_size); } +- virtual void dump_format(AVFormatContext *ic, int index, const char *url, int is_output) { ::dump_format(ic, index, url, is_output); } ++ virtual void av_dump_format(AVFormatContext *ic, int index, const char *url, int is_output) { ::av_dump_format(ic, index, url, is_output); } + virtual int url_fopen(AVIOContext **s, const char *filename, int flags) { return ::url_fopen(s, filename, flags); } + virtual int url_fclose(AVIOContext *s) { return ::url_fclose(s); } + virtual int url_open_dyn_buf(AVIOContext **s) { return ::url_open_dyn_buf(s); } +@@ -206,7 +206,7 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface + int (*p5)(void *opaque, uint8_t *buf, int buf_size), + int (*p6)(void *opaque, uint8_t *buf, int buf_size), + offset_t (*p7)(void *opaque, offset_t offset, int whence))) +- DEFINE_METHOD4(void, dump_format, (AVFormatContext *p1, int p2, const char *p3, int p4)) ++ DEFINE_METHOD4(void, av_dump_format, (AVFormatContext *p1, int p2, const char *p3, int p4)) + DEFINE_METHOD3(int, url_fopen, (AVIOContext **p1, const char *p2, int p3)) + DEFINE_METHOD1(int, url_fclose, (AVIOContext *p1)) + DEFINE_METHOD1(int, url_open_dyn_buf, (AVIOContext **p1)) +@@ -238,7 +238,7 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface + RESOLVE_METHOD(av_probe_input_format) + RESOLVE_METHOD(av_probe_input_format2) + RESOLVE_METHOD(av_probe_input_buffer) +- RESOLVE_METHOD(dump_format) ++ RESOLVE_METHOD(av_dump_format) + RESOLVE_METHOD(url_fopen) + RESOLVE_METHOD(url_fclose) + RESOLVE_METHOD(url_open_dyn_buf) +diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +index f1fad8c..b54b9bc 100644 +--- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp ++++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +@@ -463,7 +463,7 @@ bool CDVDDemuxFFmpeg::Open(CDVDInputStream* pInput) + m_pFormatContext->flags |= AVFMT_FLAG_NONBLOCK; + + // print some extra information +- m_dllAvFormat.dump_format(m_pFormatContext, 0, strFile.c_str(), 0); ++ m_dllAvFormat.av_dump_format(m_pFormatContext, 0, strFile.c_str(), 0); + + UpdateCurrentPTS(); + diff --git a/srcpkgs/xbmc/patches/170_all_url2avio.patch b/srcpkgs/xbmc/patches/170_all_url2avio.patch new file mode 100644 index 0000000000..8039c9ef58 --- /dev/null +++ b/srcpkgs/xbmc/patches/170_all_url2avio.patch @@ -0,0 +1,496 @@ +commit c5774f92ea4a458fb354d2f1852800d0917239bb +Author: Alexis Ballier +Date: Thu Mar 1 11:43:16 2012 -0300 + + Replace url_* functions by their avio_* counterparts. + +diff --git a/lib/DllAvFormat.h b/lib/DllAvFormat.h +index 7f88c7b..7ac02e7 100644 +--- a/lib/DllAvFormat.h ++++ b/lib/DllAvFormat.h +@@ -81,18 +81,17 @@ public: + virtual AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score_max)=0; + virtual int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt, const char *filename, void *logctx, unsigned int offset, unsigned int max_probe_size)=0; + virtual void av_dump_format(AVFormatContext *ic, int index, const char *url, int is_output)=0; +- virtual int url_fopen(AVIOContext **s, const char *filename, int flags)=0; +- virtual int url_fclose(AVIOContext *s)=0; +- virtual int url_open_dyn_buf(AVIOContext **s)=0; +- virtual int url_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer)=0; +- virtual offset_t url_fseek(AVIOContext *s, offset_t offset, int whence)=0; +- virtual int get_buffer(AVIOContext *s, unsigned char *buf, int size)=0; +- virtual int get_partial_buffer(AVIOContext *s, unsigned char *buf, int size)=0; +- virtual void put_byte(AVIOContext *s, int b)=0; +- virtual void put_buffer(AVIOContext *s, const unsigned char *buf, int size)=0; +- virtual void put_be24(AVIOContext *s, unsigned int val)=0; +- virtual void put_be32(AVIOContext *s, unsigned int val)=0; +- virtual void put_be16(AVIOContext *s, unsigned int val)=0; ++ virtual int avio_open(AVIOContext **s, const char *filename, int flags)=0; ++ virtual int avio_close(AVIOContext *s)=0; ++ virtual int avio_open_dyn_buf(AVIOContext **s)=0; ++ virtual int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer)=0; ++ virtual offset_t avio_seek(AVIOContext *s, offset_t offset, int whence)=0; ++ virtual int avio_read(AVIOContext *s, unsigned char *buf, int size)=0; ++ virtual void avio_w8(AVIOContext *s, int b)=0; ++ virtual void avio_write(AVIOContext *s, const unsigned char *buf, int size)=0; ++ virtual void avio_wb24(AVIOContext *s, unsigned int val)=0; ++ virtual void avio_wb32(AVIOContext *s, unsigned int val)=0; ++ virtual void avio_wb16(AVIOContext *s, unsigned int val)=0; + virtual AVFormatContext *avformat_alloc_context(void)=0; + virtual AVStream *avformat_new_stream(AVFormatContext *s, AVCodec *c)=0; + virtual AVOutputFormat *av_guess_format(const char *short_name, const char *filename, const char *mime_type)=0; +@@ -141,18 +140,17 @@ public: + virtual AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score_max) {*score_max = 100; return ::av_probe_input_format(pd, is_opened); } // Use av_probe_input_format, this is not exported by ffmpeg's headers + virtual int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt, const char *filename, void *logctx, unsigned int offset, unsigned int max_probe_size) { return ::av_probe_input_buffer(pb, fmt, filename, logctx, offset, max_probe_size); } + virtual void av_dump_format(AVFormatContext *ic, int index, const char *url, int is_output) { ::av_dump_format(ic, index, url, is_output); } +- virtual int url_fopen(AVIOContext **s, const char *filename, int flags) { return ::url_fopen(s, filename, flags); } +- virtual int url_fclose(AVIOContext *s) { return ::url_fclose(s); } +- virtual int url_open_dyn_buf(AVIOContext **s) { return ::url_open_dyn_buf(s); } +- virtual int url_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer) { return ::url_close_dyn_buf(s, pbuffer); } +- virtual offset_t url_fseek(AVIOContext *s, offset_t offset, int whence) { return ::url_fseek(s, offset, whence); } +- virtual int get_buffer(AVIOContext *s, unsigned char *buf, int size) { return ::get_buffer(s, buf, size); } +- virtual int get_partial_buffer(AVIOContext *s, unsigned char *buf, int size) { return ::get_partial_buffer(s, buf, size); } +- virtual void put_byte(AVIOContext *s, int b) { ::put_byte(s, b); } +- virtual void put_buffer(AVIOContext *s, const unsigned char *buf, int size) { ::put_buffer(s, buf, size); } +- virtual void put_be24(AVIOContext *s, unsigned int val) { ::put_be24(s, val); } +- virtual void put_be32(AVIOContext *s, unsigned int val) { ::put_be32(s, val); } +- virtual void put_be16(AVIOContext *s, unsigned int val) { ::put_be16(s, val); } ++ virtual int avio_open(AVIOContext **s, const char *filename, int flags) { return ::avio_open(s, filename, flags); } ++ virtual int avio_close(AVIOContext *s) { return ::avio_close(s); } ++ virtual int avio_open_dyn_buf(AVIOContext **s) { return ::avio_open_dyn_buf(s); } ++ virtual int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer) { return ::avio_close_dyn_buf(s, pbuffer); } ++ virtual offset_t avio_seek(AVIOContext *s, offset_t offset, int whence) { return ::avio_seek(s, offset, whence); } ++ virtual int avio_read(AVIOContext *s, unsigned char *buf, int size) { return ::avio_read(s, buf, size); } ++ virtual void avio_w8(AVIOContext *s, int b) { ::avio_w8(s, b); } ++ virtual void avio_write(AVIOContext *s, const unsigned char *buf, int size) { ::avio_write(s, buf, size); } ++ virtual void avio_wb24(AVIOContext *s, unsigned int val) { ::avio_wb24(s, val); } ++ virtual void avio_wb32(AVIOContext *s, unsigned int val) { ::avio_wb32(s, val); } ++ virtual void avio_wb16(AVIOContext *s, unsigned int val) { ::avio_wb16(s, val); } + virtual AVFormatContext *avformat_alloc_context() { return ::avformat_alloc_context(); } + virtual AVStream *avformat_new_stream(AVFormatContext *s, AVCodec *c) { return ::avformat_new_stream(s, c); } + virtual AVOutputFormat *av_guess_format(const char *short_name, const char *filename, const char *mime_type) { return ::av_guess_format(short_name, filename, mime_type); } +@@ -195,23 +193,22 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface + DEFINE_FUNC_ALIGNED2(AVInputFormat*, __cdecl, av_probe_input_format, AVProbeData*, int) + DEFINE_FUNC_ALIGNED3(AVInputFormat*, __cdecl, av_probe_input_format2, AVProbeData*, int, int*) + DEFINE_FUNC_ALIGNED6(int, __cdecl, av_probe_input_buffer, AVIOContext *, AVInputFormat **, const char *, void *, unsigned int, unsigned int) +- DEFINE_FUNC_ALIGNED3(int, __cdecl, get_buffer, AVIOContext*, unsigned char *, int) +- DEFINE_FUNC_ALIGNED3(int, __cdecl, get_partial_buffer, AVIOContext*, unsigned char *, int) +- DEFINE_FUNC_ALIGNED2(void, __cdecl, put_byte, AVIOContext*, int) +- DEFINE_FUNC_ALIGNED3(void, __cdecl, put_buffer, AVIOContext*, const unsigned char *, int) +- DEFINE_FUNC_ALIGNED2(void, __cdecl, put_be24, AVIOContext*, unsigned int) +- DEFINE_FUNC_ALIGNED2(void, __cdecl, put_be32, AVIOContext*, unsigned int) +- DEFINE_FUNC_ALIGNED2(void, __cdecl, put_be16, AVIOContext*, unsigned int) ++ DEFINE_FUNC_ALIGNED3(int, __cdecl, avio_read, AVIOContext*, unsigned char *, int) ++ DEFINE_FUNC_ALIGNED2(void, __cdecl, avio_w8, AVIOContext*, int) ++ DEFINE_FUNC_ALIGNED3(void, __cdecl, avio_write, AVIOContext*, const unsigned char *, int) ++ DEFINE_FUNC_ALIGNED2(void, __cdecl, avio_wb24, AVIOContext*, unsigned int) ++ DEFINE_FUNC_ALIGNED2(void, __cdecl, avio_wb32, AVIOContext*, unsigned int) ++ DEFINE_FUNC_ALIGNED2(void, __cdecl, avio_wb16, AVIOContext*, unsigned int) + DEFINE_METHOD7(AVIOContext *, avio_alloc_context, (unsigned char *p1, int p2, int p3, void *p4, + int (*p5)(void *opaque, uint8_t *buf, int buf_size), + int (*p6)(void *opaque, uint8_t *buf, int buf_size), + offset_t (*p7)(void *opaque, offset_t offset, int whence))) + DEFINE_METHOD4(void, av_dump_format, (AVFormatContext *p1, int p2, const char *p3, int p4)) +- DEFINE_METHOD3(int, url_fopen, (AVIOContext **p1, const char *p2, int p3)) +- DEFINE_METHOD1(int, url_fclose, (AVIOContext *p1)) +- DEFINE_METHOD1(int, url_open_dyn_buf, (AVIOContext **p1)) +- DEFINE_METHOD2(int, url_close_dyn_buf, (AVIOContext *p1, uint8_t **p2)) +- DEFINE_METHOD3(offset_t, url_fseek, (AVIOContext *p1, offset_t p2, int p3)) ++ DEFINE_METHOD3(int, avio_open, (AVIOContext **p1, const char *p2, int p3)) ++ DEFINE_METHOD1(int, avio_close, (AVIOContext *p1)) ++ DEFINE_METHOD1(int, avio_open_dyn_buf, (AVIOContext **p1)) ++ DEFINE_METHOD2(int, avio_close_dyn_buf, (AVIOContext *p1, uint8_t **p2)) ++ DEFINE_METHOD3(offset_t, avio_seek, (AVIOContext *p1, offset_t p2, int p3)) + DEFINE_METHOD0(AVFormatContext *, avformat_alloc_context) + DEFINE_METHOD2(AVStream *, avformat_new_stream, (AVFormatContext *p1, AVCodec *p2)) + DEFINE_METHOD3(AVOutputFormat *, av_guess_format, (const char *p1, const char *p2, const char *p3)) +@@ -239,18 +236,17 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface + RESOLVE_METHOD(av_probe_input_format2) + RESOLVE_METHOD(av_probe_input_buffer) + RESOLVE_METHOD(av_dump_format) +- RESOLVE_METHOD(url_fopen) +- RESOLVE_METHOD(url_fclose) +- RESOLVE_METHOD(url_open_dyn_buf) +- RESOLVE_METHOD(url_close_dyn_buf) +- RESOLVE_METHOD(url_fseek) +- RESOLVE_METHOD(get_buffer) +- RESOLVE_METHOD(get_partial_buffer) +- RESOLVE_METHOD(put_byte) +- RESOLVE_METHOD(put_buffer) +- RESOLVE_METHOD(put_be24) +- RESOLVE_METHOD(put_be32) +- RESOLVE_METHOD(put_be16) ++ RESOLVE_METHOD(avio_open) ++ RESOLVE_METHOD(avio_close) ++ RESOLVE_METHOD(avio_open_dyn_buf) ++ RESOLVE_METHOD(avio_close_dyn_buf) ++ RESOLVE_METHOD(avio_seek) ++ RESOLVE_METHOD(avio_read) ++ RESOLVE_METHOD(avio_w8) ++ RESOLVE_METHOD(avio_write) ++ RESOLVE_METHOD(avio_wb24) ++ RESOLVE_METHOD(avio_wb32) ++ RESOLVE_METHOD(avio_wb16) + RESOLVE_METHOD(avformat_alloc_context) + RESOLVE_METHOD(avformat_new_stream) + RESOLVE_METHOD(av_guess_format) +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecVDA.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecVDA.cpp +index 0238864..c9f0650 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecVDA.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecVDA.cpp +@@ -525,8 +525,8 @@ const int avc_parse_nal_units(DllAvFormat *av_format_ctx, + { + while (!*(nal_start++)); + nal_end = avc_find_startcode(nal_start, end); +- av_format_ctx->put_be32(pb, nal_end - nal_start); +- av_format_ctx->put_buffer(pb, nal_start, nal_end - nal_start); ++ av_format_ctx->avio_wb32(pb, nal_end - nal_start); ++ av_format_ctx->avio_write(pb, nal_start, nal_end - nal_start); + size += 4 + nal_end - nal_start; + nal_start = nal_end; + } +@@ -537,14 +537,14 @@ const int avc_parse_nal_units_buf(DllAvUtil *av_util_ctx, DllAvFormat *av_format + const uint8_t *buf_in, uint8_t **buf, int *size) + { + ByteIOContext *pb; +- int ret = av_format_ctx->url_open_dyn_buf(&pb); ++ int ret = av_format_ctx->avio_open_dyn_buf(&pb); + if (ret < 0) + return ret; + + avc_parse_nal_units(av_format_ctx, pb, buf_in, *size); + + av_util_ctx->av_freep(buf); +- *size = av_format_ctx->url_close_dyn_buf(pb, buf); ++ *size = av_format_ctx->avio_close_dyn_buf(pb, buf); + return 0; + } + +@@ -590,26 +590,26 @@ const int isom_write_avcc(DllAvUtil *av_util_ctx, DllAvFormat *av_format_ctx, + } + assert(sps); + +- av_format_ctx->put_byte(pb, 1); /* version */ +- av_format_ctx->put_byte(pb, sps[1]); /* profile */ +- av_format_ctx->put_byte(pb, sps[2]); /* profile compat */ +- av_format_ctx->put_byte(pb, sps[3]); /* level */ +- av_format_ctx->put_byte(pb, 0xff); /* 6 bits reserved (111111) + 2 bits nal size length - 1 (11) */ +- av_format_ctx->put_byte(pb, 0xe1); /* 3 bits reserved (111) + 5 bits number of sps (00001) */ ++ av_format_ctx->avio_w8(pb, 1); /* version */ ++ av_format_ctx->avio_w8(pb, sps[1]); /* profile */ ++ av_format_ctx->avio_w8(pb, sps[2]); /* profile compat */ ++ av_format_ctx->avio_w8(pb, sps[3]); /* level */ ++ av_format_ctx->avio_w8(pb, 0xff); /* 6 bits reserved (111111) + 2 bits nal size length - 1 (11) */ ++ av_format_ctx->avio_w8(pb, 0xe1); /* 3 bits reserved (111) + 5 bits number of sps (00001) */ + +- av_format_ctx->put_be16(pb, sps_size); +- av_format_ctx->put_buffer(pb, sps, sps_size); ++ av_format_ctx->avio_wb16(pb, sps_size); ++ av_format_ctx->avio_write(pb, sps, sps_size); + if (pps) + { +- av_format_ctx->put_byte(pb, 1); /* number of pps */ +- av_format_ctx->put_be16(pb, pps_size); +- av_format_ctx->put_buffer(pb, pps, pps_size); ++ av_format_ctx->avio_w8(pb, 1); /* number of pps */ ++ av_format_ctx->avio_wb16(pb, pps_size); ++ av_format_ctx->avio_write(pb, pps, pps_size); + } + av_util_ctx->av_free(start); + } + else + { +- av_format_ctx->put_buffer(pb, data, len); ++ av_format_ctx->avio_write(pb, data, len); + } + } + return 0; +@@ -706,7 +706,7 @@ bool CDVDVideoCodecVDA::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options) + } + + ByteIOContext *pb; +- if (m_dllAvFormat->url_open_dyn_buf(&pb) < 0) ++ if (m_dllAvFormat->avio_open_dyn_buf(&pb) < 0) + { + return false; + } +@@ -717,7 +717,7 @@ bool CDVDVideoCodecVDA::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options) + // unhook from ffmpeg's extradata + extradata = NULL; + // extract the avcC atom data into extradata then write it into avcCData for VDADecoder +- extrasize = m_dllAvFormat->url_close_dyn_buf(pb, &extradata); ++ extrasize = m_dllAvFormat->avio_close_dyn_buf(pb, &extradata); + // CFDataCreate makes a copy of extradata contents + avcCData = CFDataCreate(kCFAllocatorDefault, (const uint8_t*)extradata, extrasize); + // done with the converted extradata, we MUST free using av_free +@@ -948,12 +948,12 @@ int CDVDVideoCodecVDA::Decode(BYTE* pData, int iSize, double dts, double pts) + int demuxer_bytes; + uint8_t *demuxer_content; + +- if(m_dllAvFormat->url_open_dyn_buf(&pb) < 0) ++ if(m_dllAvFormat->avio_open_dyn_buf(&pb) < 0) + { + return VC_ERROR; + } + demuxer_bytes = avc_parse_nal_units(m_dllAvFormat, pb, pData, iSize); +- demuxer_bytes = m_dllAvFormat->url_close_dyn_buf(pb, &demuxer_content); ++ demuxer_bytes = m_dllAvFormat->avio_close_dyn_buf(pb, &demuxer_content); + avc_demux = CFDataCreate(kCFAllocatorDefault, demuxer_content, demuxer_bytes); + m_dllAvUtil->av_free(demuxer_content); + } +@@ -961,7 +961,7 @@ int CDVDVideoCodecVDA::Decode(BYTE* pData, int iSize, double dts, double pts) + { + // convert demuxer packet from 3 byte NAL sizes to 4 byte + ByteIOContext *pb; +- if (m_dllAvFormat->url_open_dyn_buf(&pb) < 0) ++ if (m_dllAvFormat->avio_open_dyn_buf(&pb) < 0) + return VC_ERROR; + + uint32_t nal_size; +@@ -970,14 +970,14 @@ int CDVDVideoCodecVDA::Decode(BYTE* pData, int iSize, double dts, double pts) + while (nal_start < end) + { + nal_size = VDA_RB24(nal_start); +- m_dllAvFormat->put_be32(pb, nal_size); ++ m_dllAvFormat->avio_wb32(pb, nal_size); + nal_start += 3; +- m_dllAvFormat->put_buffer(pb, nal_start, nal_size); ++ m_dllAvFormat->avio_write(pb, nal_start, nal_size); + nal_start += nal_size; + } + + uint8_t *demuxer_content; +- int demuxer_bytes = m_dllAvFormat->url_close_dyn_buf(pb, &demuxer_content); ++ int demuxer_bytes = m_dllAvFormat->avio_close_dyn_buf(pb, &demuxer_content); + avc_demux = CFDataCreate(kCFAllocatorDefault, demuxer_content, demuxer_bytes); + m_dllAvUtil->av_free(demuxer_content); + } +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecVideoToolBox.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecVideoToolBox.cpp +index a78b1b8..3cca691 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecVideoToolBox.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecVideoToolBox.cpp +@@ -474,7 +474,7 @@ int quicktime_write_mp4_descr_length(DllAvFormat *av_format_ctx, ByteIOContext * + { + b |= 0x80; + } +- av_format_ctx->put_byte(pb, b); ++ av_format_ctx->avio_w8(pb, b); + } + + return numBytes; +@@ -482,37 +482,37 @@ int quicktime_write_mp4_descr_length(DllAvFormat *av_format_ctx, ByteIOContext * + + void quicktime_write_esds(DllAvFormat *av_format_ctx, ByteIOContext *pb, quicktime_esds_t *esds) + { +- av_format_ctx->put_byte(pb, 0); // Version +- av_format_ctx->put_be24(pb, 0); // Flags ++ av_format_ctx->avio_w8(pb, 0); // Version ++ av_format_ctx->avio_wb24(pb, 0); // Flags + + // elementary stream descriptor tag +- av_format_ctx->put_byte(pb, 0x03); ++ av_format_ctx->avio_w8(pb, 0x03); + quicktime_write_mp4_descr_length(av_format_ctx, pb, + 3 + 5 + (13 + 5 + esds->decoderConfigLen) + 3, false); + // 3 bytes + 5 bytes for tag +- av_format_ctx->put_be16(pb, esds->esid); +- av_format_ctx->put_byte(pb, esds->stream_priority); ++ av_format_ctx->avio_wb16(pb, esds->esid); ++ av_format_ctx->avio_w8(pb, esds->stream_priority); + + // decoder configuration description tag +- av_format_ctx->put_byte(pb, 0x04); ++ av_format_ctx->avio_w8(pb, 0x04); + quicktime_write_mp4_descr_length(av_format_ctx, pb, + 13 + 5 + esds->decoderConfigLen, false); + // 13 bytes + 5 bytes for tag +- av_format_ctx->put_byte(pb, esds->objectTypeId); // objectTypeIndication +- av_format_ctx->put_byte(pb, esds->streamType); // streamType +- av_format_ctx->put_be24(pb, esds->bufferSizeDB); // buffer size +- av_format_ctx->put_be32(pb, esds->maxBitrate); // max bitrate +- av_format_ctx->put_be32(pb, esds->avgBitrate); // average bitrate ++ av_format_ctx->avio_w8(pb, esds->objectTypeId); // objectTypeIndication ++ av_format_ctx->avio_w8(pb, esds->streamType); // streamType ++ av_format_ctx->avio_wb24(pb, esds->bufferSizeDB); // buffer size ++ av_format_ctx->avio_wb32(pb, esds->maxBitrate); // max bitrate ++ av_format_ctx->avio_wb32(pb, esds->avgBitrate); // average bitrate + + // decoder specific description tag +- av_format_ctx->put_byte(pb, 0x05); ++ av_format_ctx->avio_w8(pb, 0x05); + quicktime_write_mp4_descr_length(av_format_ctx, pb, esds->decoderConfigLen, false); +- av_format_ctx->put_buffer(pb, esds->decoderConfig, esds->decoderConfigLen); ++ av_format_ctx->avio_write(pb, esds->decoderConfig, esds->decoderConfigLen); + + // sync layer configuration descriptor tag +- av_format_ctx->put_byte(pb, 0x06); // tag +- av_format_ctx->put_byte(pb, 0x01); // length +- av_format_ctx->put_byte(pb, 0x7F); // no SL ++ av_format_ctx->avio_w8(pb, 0x06); // tag ++ av_format_ctx->avio_w8(pb, 0x01); // length ++ av_format_ctx->avio_w8(pb, 0x7F); // no SL + + /* no IPI_DescrPointer */ + /* no IP_IdentificationDataSet */ +@@ -666,8 +666,8 @@ const int avc_parse_nal_units(DllAvFormat *av_format_ctx, + { + while (!*(nal_start++)); + nal_end = avc_find_startcode(nal_start, end); +- av_format_ctx->put_be32(pb, nal_end - nal_start); +- av_format_ctx->put_buffer(pb, nal_start, nal_end - nal_start); ++ av_format_ctx->avio_wb32(pb, nal_end - nal_start); ++ av_format_ctx->avio_write(pb, nal_start, nal_end - nal_start); + size += 4 + nal_end - nal_start; + nal_start = nal_end; + } +@@ -678,14 +678,14 @@ const int avc_parse_nal_units_buf(DllAvUtil *av_util_ctx, DllAvFormat *av_format + const uint8_t *buf_in, uint8_t **buf, int *size) + { + ByteIOContext *pb; +- int ret = av_format_ctx->url_open_dyn_buf(&pb); ++ int ret = av_format_ctx->avio_open_dyn_buf(&pb); + if (ret < 0) + return ret; + + avc_parse_nal_units(av_format_ctx, pb, buf_in, *size); + + av_util_ctx->av_freep(buf); +- *size = av_format_ctx->url_close_dyn_buf(pb, buf); ++ *size = av_format_ctx->avio_close_dyn_buf(pb, buf); + return 0; + } + +@@ -770,26 +770,26 @@ const int isom_write_avcc(DllAvUtil *av_util_ctx, DllAvFormat *av_format_ctx, + } + assert(sps); + +- av_format_ctx->put_byte(pb, 1); /* version */ +- av_format_ctx->put_byte(pb, sps[1]); /* profile */ +- av_format_ctx->put_byte(pb, sps[2]); /* profile compat */ +- av_format_ctx->put_byte(pb, sps[3]); /* level */ +- av_format_ctx->put_byte(pb, 0xff); /* 6 bits reserved (111111) + 2 bits nal size length - 1 (11) */ +- av_format_ctx->put_byte(pb, 0xe1); /* 3 bits reserved (111) + 5 bits number of sps (00001) */ ++ av_format_ctx->avio_w8(pb, 1); /* version */ ++ av_format_ctx->avio_w8(pb, sps[1]); /* profile */ ++ av_format_ctx->avio_w8(pb, sps[2]); /* profile compat */ ++ av_format_ctx->avio_w8(pb, sps[3]); /* level */ ++ av_format_ctx->avio_w8(pb, 0xff); /* 6 bits reserved (111111) + 2 bits nal size length - 1 (11) */ ++ av_format_ctx->avio_w8(pb, 0xe1); /* 3 bits reserved (111) + 5 bits number of sps (00001) */ + +- av_format_ctx->put_be16(pb, sps_size); +- av_format_ctx->put_buffer(pb, sps, sps_size); ++ av_format_ctx->avio_wb16(pb, sps_size); ++ av_format_ctx->avio_write(pb, sps, sps_size); + if (pps) + { +- av_format_ctx->put_byte(pb, 1); /* number of pps */ +- av_format_ctx->put_be16(pb, pps_size); +- av_format_ctx->put_buffer(pb, pps, pps_size); ++ av_format_ctx->avio_w8(pb, 1); /* number of pps */ ++ av_format_ctx->avio_wb16(pb, pps_size); ++ av_format_ctx->avio_write(pb, pps, pps_size); + } + av_util_ctx->av_free(start); + } + else + { +- av_format_ctx->put_buffer(pb, data, len); ++ av_format_ctx->avio_write(pb, data, len); + } + } + return 0; +@@ -1086,7 +1086,7 @@ bool CDVDVideoCodecVideoToolBox::Open(CDVDStreamInfo &hints, CDVDCodecOptions &o + ByteIOContext *pb; + quicktime_esds_t *esds; + +- if (m_dllAvFormat->url_open_dyn_buf(&pb) < 0) ++ if (m_dllAvFormat->avio_open_dyn_buf(&pb) < 0) + return false; + + esds = quicktime_set_esds(m_dllAvFormat, extradata, extrasize); +@@ -1095,7 +1095,7 @@ bool CDVDVideoCodecVideoToolBox::Open(CDVDStreamInfo &hints, CDVDCodecOptions &o + // unhook from ffmpeg's extradata + extradata = NULL; + // extract the esds atom decoderConfig from extradata +- extrasize = m_dllAvFormat->url_close_dyn_buf(pb, &extradata); ++ extrasize = m_dllAvFormat->avio_close_dyn_buf(pb, &extradata); + free(esds->decoderConfig); + free(esds); + +@@ -1152,7 +1152,7 @@ bool CDVDVideoCodecVideoToolBox::Open(CDVDStreamInfo &hints, CDVDCodecOptions &o + // NAL reformating to bitstream format required + + ByteIOContext *pb; +- if (m_dllAvFormat->url_open_dyn_buf(&pb) < 0) ++ if (m_dllAvFormat->avio_open_dyn_buf(&pb) < 0) + return false; + + m_convert_bytestream = true; +@@ -1161,7 +1161,7 @@ bool CDVDVideoCodecVideoToolBox::Open(CDVDStreamInfo &hints, CDVDCodecOptions &o + // unhook from ffmpeg's extradata + extradata = NULL; + // extract the avcC atom data into extradata getting size into extrasize +- extrasize = m_dllAvFormat->url_close_dyn_buf(pb, &extradata); ++ extrasize = m_dllAvFormat->avio_close_dyn_buf(pb, &extradata); + + // check for interlaced and get number of ref frames + if (!validate_avcC_spc(extradata, extrasize, &m_max_ref_frames)) +@@ -1302,17 +1302,17 @@ int CDVDVideoCodecVideoToolBox::Decode(BYTE* pData, int iSize, double dts, doubl + if (m_convert_bytestream) + { + // convert demuxer packet from bytestream (AnnexB) to bitstream +- if(m_dllAvFormat->url_open_dyn_buf(&pb) < 0) ++ if(m_dllAvFormat->avio_open_dyn_buf(&pb) < 0) + return VC_ERROR; + + demux_size = avc_parse_nal_units(m_dllAvFormat, pb, pData, iSize); +- demux_size = m_dllAvFormat->url_close_dyn_buf(pb, &demux_buff); ++ demux_size = m_dllAvFormat->avio_close_dyn_buf(pb, &demux_buff); + sampleBuff = CreateSampleBufferFrom(m_fmt_desc, demux_buff, demux_size); + } + else if (m_convert_3byteTo4byteNALSize) + { + // convert demuxer packet from 3 byte NAL sizes to 4 byte +- if (m_dllAvFormat->url_open_dyn_buf(&pb) < 0) ++ if (m_dllAvFormat->avio_open_dyn_buf(&pb) < 0) + return VC_ERROR; + + uint32_t nal_size; +@@ -1321,13 +1321,13 @@ int CDVDVideoCodecVideoToolBox::Decode(BYTE* pData, int iSize, double dts, doubl + while (nal_start < end) + { + nal_size = VDA_RB24(nal_start); +- m_dllAvFormat->put_be32(pb, nal_size); ++ m_dllAvFormat->avio_wb32(pb, nal_size); + nal_start += 3; +- m_dllAvFormat->put_buffer(pb, nal_start, nal_size); ++ m_dllAvFormat->avio_write(pb, nal_start, nal_size); + nal_start += nal_size; + } + +- demux_size = m_dllAvFormat->url_close_dyn_buf(pb, &demux_buff); ++ demux_size = m_dllAvFormat->avio_close_dyn_buf(pb, &demux_buff); + sampleBuff = CreateSampleBufferFrom(m_fmt_desc, demux_buff, demux_size); + } + else +diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +index b54b9bc..4f09346 100644 +--- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp ++++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +@@ -330,7 +330,7 @@ bool CDVDDemuxFFmpeg::Open(CDVDInputStream* pInput) + pd.filename = strFile.c_str(); + + // read data using avformat's buffers +- pd.buf_size = m_dllAvFormat.get_buffer(m_ioContext, pd.buf, m_ioContext->max_packet_size ? m_ioContext->max_packet_size : m_ioContext->buffer_size); ++ pd.buf_size = m_dllAvFormat.avio_read(m_ioContext, pd.buf, m_ioContext->max_packet_size ? m_ioContext->max_packet_size : m_ioContext->buffer_size); + if (pd.buf_size <= 0) + { + CLog::Log(LOGERROR, "%s - error reading from input stream, %s", __FUNCTION__, strFile.c_str()); +@@ -339,7 +339,7 @@ bool CDVDDemuxFFmpeg::Open(CDVDInputStream* pInput) + memset(pd.buf+pd.buf_size, 0, AVPROBE_PADDING_SIZE); + + // restore position again +- m_dllAvFormat.url_fseek(m_ioContext , 0, SEEK_SET); ++ m_dllAvFormat.avio_seek(m_ioContext , 0, SEEK_SET); + + // the advancedsetting is for allowing the user to force outputting the + // 44.1 kHz DTS wav file as PCM, so that an A/V receiver can decode diff --git a/srcpkgs/xbmc/patches/180_all_alloc_put_byte.patch b/srcpkgs/xbmc/patches/180_all_alloc_put_byte.patch new file mode 100644 index 0000000000..f02eebd639 --- /dev/null +++ b/srcpkgs/xbmc/patches/180_all_alloc_put_byte.patch @@ -0,0 +1,90 @@ +commit 05c142b34798ecea82132dd1faeff89338b3ac78 +Author: Alexis Ballier +Date: Thu Mar 1 11:46:12 2012 -0300 + + Remove av_alloc_put_byte and replace its occurences by avio_alloc_context. + +diff --git a/lib/DllAvFormat.h b/lib/DllAvFormat.h +index 7ac02e7..725f5be 100644 +--- a/lib/DllAvFormat.h ++++ b/lib/DllAvFormat.h +@@ -95,10 +95,6 @@ public: + virtual AVFormatContext *avformat_alloc_context(void)=0; + virtual AVStream *avformat_new_stream(AVFormatContext *s, AVCodec *c)=0; + virtual AVOutputFormat *av_guess_format(const char *short_name, const char *filename, const char *mime_type)=0; +- virtual AVIOContext *av_alloc_put_byte(unsigned char *buffer, int buffer_size, int write_flag, void *opaque, +- int (*read_packet)(void *opaque, uint8_t *buf, int buf_size), +- int (*write_packet)(void *opaque, uint8_t *buf, int buf_size), +- offset_t (*seek)(void *opaque, offset_t offset, int whence))=0; + virtual int avformat_write_header (AVFormatContext *s, AVDictionary **options)=0; + virtual int av_write_trailer(AVFormatContext *s)=0; + virtual int av_write_frame (AVFormatContext *s, AVPacket *pkt)=0; +@@ -154,10 +150,6 @@ public: + virtual AVFormatContext *avformat_alloc_context() { return ::avformat_alloc_context(); } + virtual AVStream *avformat_new_stream(AVFormatContext *s, AVCodec *c) { return ::avformat_new_stream(s, c); } + virtual AVOutputFormat *av_guess_format(const char *short_name, const char *filename, const char *mime_type) { return ::av_guess_format(short_name, filename, mime_type); } +- virtual AVIOContext *av_alloc_put_byte(unsigned char *buffer, int buffer_size, int write_flag, void *opaque, +- int (*read_packet)(void *opaque, uint8_t *buf, int buf_size), +- int (*write_packet)(void *opaque, uint8_t *buf, int buf_size), +- offset_t (*seek)(void *opaque, offset_t offset, int whence)) { return ::av_alloc_put_byte(buffer, buffer_size, write_flag, opaque, read_packet, write_packet, seek); } + virtual int avformat_write_header (AVFormatContext *s, AVDictionary **options) { return ::avformat_write_header (s, options); } + virtual int av_write_trailer(AVFormatContext *s) { return ::av_write_trailer(s); } + virtual int av_write_frame (AVFormatContext *s, AVPacket *pkt) { return ::av_write_frame(s, pkt); } +@@ -212,10 +204,6 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface + DEFINE_METHOD0(AVFormatContext *, avformat_alloc_context) + DEFINE_METHOD2(AVStream *, avformat_new_stream, (AVFormatContext *p1, AVCodec *p2)) + DEFINE_METHOD3(AVOutputFormat *, av_guess_format, (const char *p1, const char *p2, const char *p3)) +- DEFINE_METHOD7(AVIOContext *, av_alloc_put_byte, (unsigned char *p1, int p2, int p3, void *p4, +- int(*p5)(void *opaque, uint8_t *buf, int buf_size), +- int(*p6)(void *opaque, uint8_t *buf, int buf_size), +- offset_t(*p7)(void *opaque, offset_t offset, int whence))) + DEFINE_METHOD2(int, avformat_write_header , (AVFormatContext *p1, AVDictionary **p2)) + DEFINE_METHOD1(int, av_write_trailer, (AVFormatContext *p1)) + DEFINE_METHOD2(int, av_write_frame , (AVFormatContext *p1, AVPacket *p2)) +@@ -250,7 +238,6 @@ class DllAvFormat : public DllDynamic, DllAvFormatInterface + RESOLVE_METHOD(avformat_alloc_context) + RESOLVE_METHOD(avformat_new_stream) + RESOLVE_METHOD(av_guess_format) +- RESOLVE_METHOD(av_alloc_put_byte) + RESOLVE_METHOD(avformat_write_header) + RESOLVE_METHOD(av_write_trailer) + RESOLVE_METHOD(av_write_frame) +diff --git a/xbmc/cdrip/EncoderFFmpeg.cpp b/xbmc/cdrip/EncoderFFmpeg.cpp +index b67b231..bcedb0c 100644 +--- a/xbmc/cdrip/EncoderFFmpeg.cpp ++++ b/xbmc/cdrip/EncoderFFmpeg.cpp +@@ -78,7 +78,7 @@ bool CEncoderFFmpeg::Init(const char* strFile, int iInChannels, int iInRate, int + } + + m_Format = m_dllAvFormat.avformat_alloc_context(); +- m_Format->pb = m_dllAvFormat.av_alloc_put_byte(m_BCBuffer, sizeof(m_BCBuffer), URL_RDONLY, this, NULL, MuxerReadPacket, NULL); ++ m_Format->pb = m_dllAvFormat.avio_alloc_context(m_BCBuffer, sizeof(m_BCBuffer), AVIO_FLAG_READ, this, NULL, MuxerReadPacket, NULL); + if (!m_Format->pb) + { + m_dllAvUtil.av_freep(&m_Format); +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthroughFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthroughFFmpeg.cpp +index d230623..20f9aff 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthroughFFmpeg.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthroughFFmpeg.cpp +@@ -99,7 +99,7 @@ bool CDVDAudioCodecPassthroughFFmpeg::SetupMuxer(CDVDStreamInfo &hints, CStdStri + muxer.m_pFormat->oformat = fOut; + + /* allocate a put_byte struct so we can grab the output */ +- muxer.m_pFormat->pb = m_dllAvFormat.av_alloc_put_byte(muxer.m_BCBuffer, sizeof(muxer.m_BCBuffer), URL_RDONLY, &muxer, NULL, MuxerReadPacket, NULL); ++ muxer.m_pFormat->pb = m_dllAvFormat.avio_alloc_context(muxer.m_BCBuffer, sizeof(muxer.m_BCBuffer), AVIO_FLAG_READ, &muxer, NULL, MuxerReadPacket, NULL); + if (!muxer.m_pFormat->pb) + { + CLog::Log(LOGERROR, "CDVDAudioCodecPassthroughFFmpeg::SetupMuxer - Failed to allocate ByteIOContext"); +diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +index 4f09346..caae1c8 100644 +--- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp ++++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +@@ -298,7 +298,7 @@ bool CDVDDemuxFFmpeg::Open(CDVDInputStream* pInput) + else + { + unsigned char* buffer = (unsigned char*)m_dllAvUtil.av_malloc(FFMPEG_FILE_BUFFER_SIZE); +- m_ioContext = m_dllAvFormat.av_alloc_put_byte(buffer, FFMPEG_FILE_BUFFER_SIZE, 0, m_pInput, dvd_file_read, NULL, dvd_file_seek); ++ m_ioContext = m_dllAvFormat.avio_alloc_context(buffer, FFMPEG_FILE_BUFFER_SIZE, 0, m_pInput, dvd_file_read, NULL, dvd_file_seek); + m_ioContext->max_packet_size = m_pInput->GetBlockSize(); + if(m_ioContext->max_packet_size) + m_ioContext->max_packet_size *= FFMPEG_FILE_BUFFER_SIZE / m_ioContext->max_packet_size; diff --git a/srcpkgs/xbmc/patches/190_all_avfilter_avformat.patch b/srcpkgs/xbmc/patches/190_all_avfilter_avformat.patch new file mode 100644 index 0000000000..ff7ca361c4 --- /dev/null +++ b/srcpkgs/xbmc/patches/190_all_avfilter_avformat.patch @@ -0,0 +1,35 @@ +commit d1e06c28d3eb6cd689b8cbc5b96babe81707baa7 +Author: Rainer Hochecker +Date: Sun Apr 15 14:00:22 2012 +0200 + + ffmpeg: avfilter depends on avformat + +diff --git a/lib/DllAvFilter.h b/lib/DllAvFilter.h +index 5c83654..6ae5d15 100644 +--- a/lib/DllAvFilter.h ++++ b/lib/DllAvFilter.h +@@ -25,6 +25,7 @@ + #endif + #include "DynamicDll.h" + #include "DllAvCodec.h" ++#include "DllAvFormat.h" + #include "DllSwResample.h" + #include "utils/log.h" + +@@ -203,6 +204,7 @@ class DllAvFilter : public DllDynamic, DllAvFilterInterface + /* dependencies of libavfilter */ + DllAvUtil m_dllAvUtil; + DllSwResample m_dllSwResample; ++ DllAvFormat m_dllAvFormat; + + public: + int avfilter_open(AVFilterContext **filter_ctx, AVFilter *filter, const char *inst_name) +@@ -251,6 +253,8 @@ public: + return false; + if (!m_dllSwResample.Load()) + return false; ++ if (!m_dllAvFormat.Load()) ++ return false; + return DllDynamic::Load(); + } + }; diff --git a/srcpkgs/xbmc/patches/200_all_avfilter_buffersink.patch b/srcpkgs/xbmc/patches/200_all_avfilter_buffersink.patch new file mode 100644 index 0000000000..6a7604bf78 --- /dev/null +++ b/srcpkgs/xbmc/patches/200_all_avfilter_buffersink.patch @@ -0,0 +1,296 @@ +commit 1fccb604ac8c4e45ebce6c2743d59140b4a117e0 +Author: elupus +Date: Thu Jan 19 20:54:43 2012 +0100 + + changed: replace old libavfilter integration with null output filter with buffersink + +diff --git a/lib/DllAvFilter.h b/lib/DllAvFilter.h +index ea012e8..cf91ee9 100644 +--- a/lib/DllAvFilter.h ++++ b/lib/DllAvFilter.h +@@ -43,11 +43,14 @@ extern "C" { + #if (defined USE_EXTERNAL_FFMPEG) + #if (defined HAVE_LIBAVFILTER_AVFILTER_H) + #include ++ #include + #elif (defined HAVE_FFMPEG_AVFILTER_H) + #include ++ #include + #endif + #else + #include "libavfilter/avfiltergraph.h" ++ #include "libavfilter/buffersink.h" + #endif + } + +@@ -73,6 +76,9 @@ public: + virtual AVFilterBufferRef *avfilter_get_video_buffer(AVFilterLink *link, int perms, int w, int h)=0; + virtual void avfilter_unref_buffer(AVFilterBufferRef *ref)=0; + virtual int avfilter_link(AVFilterContext *src, unsigned srcpad, AVFilterContext *dst, unsigned dstpad)=0; ++ virtual int av_buffersink_get_buffer_ref(AVFilterContext *buffer_sink, AVFilterBufferRef **bufref, int flags)=0; ++ virtual AVBufferSinkParams *av_buffersink_params_alloc()=0; ++ virtual int av_buffersink_poll_frame(AVFilterContext *ctx)=0; + }; + + #if (defined USE_EXTERNAL_FFMPEG) +@@ -129,6 +135,9 @@ public: + virtual AVFilterBufferRef *avfilter_get_video_buffer(AVFilterLink *link, int perms, int w, int h) { return ::avfilter_get_video_buffer(link, perms, w, h); } + virtual void avfilter_unref_buffer(AVFilterBufferRef *ref) { ::avfilter_unref_buffer(ref); } + virtual int avfilter_link(AVFilterContext *src, unsigned srcpad, AVFilterContext *dst, unsigned dstpad) { return ::avfilter_link(src, srcpad, dst, dstpad); } ++ virtual int av_buffersink_get_buffer_ref(AVFilterContext *buffer_sink, AVFilterBufferRef **bufref, int flags) { return ::av_buffersink_get_buffer_ref(buffer_sink, bufref, flags); } ++ virtual AVBufferSinkParams *av_buffersink_params_alloc() { return ::av_buffersink_params_alloc(); } ++ virtual int av_buffersink_poll_frame(AVFilterContext *ctx) { return av_buffersink_poll_frame(ctx); } + // DLL faking. + virtual bool ResolveExports() { return true; } + virtual bool Load() { +@@ -153,14 +162,17 @@ class DllAvFilter : public DllDynamic, DllAvFilterInterface + DEFINE_METHOD0(AVFilterGraph*, avfilter_graph_alloc) + DEFINE_METHOD0(AVFilterInOut*, avfilter_inout_alloc_dont_call) + DEFINE_METHOD1(void, avfilter_inout_free_dont_call, (AVFilterInOut **p1)) +- DEFINE_METHOD5(int, avfilter_graph_parse_dont_call, (AVFilterGraph *p1, const char *p2, AVFilterInOut **p3, AVFilterInOut **p4, void *p5)) +- DEFINE_METHOD2(int, avfilter_graph_config_dont_call, (AVFilterGraph *p1, void *p2)) ++ DEFINE_FUNC_ALIGNED5(int, __cdecl, avfilter_graph_parse_dont_call, AVFilterGraph *, const char *, AVFilterInOut **, AVFilterInOut **, void *) ++ DEFINE_FUNC_ALIGNED2(int, __cdecl, avfilter_graph_config_dont_call, AVFilterGraph *, void *) + DEFINE_FUNC_ALIGNED1(int, __cdecl, avfilter_poll_frame, AVFilterLink *) + DEFINE_FUNC_ALIGNED1(int, __cdecl, avfilter_request_frame, AVFilterLink*) + DEFINE_METHOD3(int, av_vsrc_buffer_add_frame, (AVFilterContext *p1, AVFrame *p2, int p3)) + DEFINE_METHOD4(AVFilterBufferRef*, avfilter_get_video_buffer, (AVFilterLink *p1, int p2, int p3, int p4)) + DEFINE_METHOD1(void, avfilter_unref_buffer, (AVFilterBufferRef *p1)) + DEFINE_METHOD4(int, avfilter_link, (AVFilterContext *p1, unsigned p2, AVFilterContext *p3, unsigned p4)) ++ DEFINE_FUNC_ALIGNED3(int , __cdecl, av_buffersink_get_buffer_ref, AVFilterContext *, AVFilterBufferRef **, int); ++ DEFINE_FUNC_ALIGNED0(AVBufferSinkParams*, __cdecl, av_buffersink_params_alloc); ++ DEFINE_FUNC_ALIGNED1(int , __cdecl, av_buffersink_poll_frame, AVFilterContext *); + + BEGIN_METHOD_RESOLVE() + RESOLVE_METHOD_RENAME(avfilter_open, avfilter_open_dont_call) +@@ -180,6 +192,9 @@ class DllAvFilter : public DllDynamic, DllAvFilterInterface + RESOLVE_METHOD(avfilter_get_video_buffer) + RESOLVE_METHOD(avfilter_unref_buffer) + RESOLVE_METHOD(avfilter_link) ++ RESOLVE_METHOD(av_buffersink_get_buffer_ref) ++ RESOLVE_METHOD(av_buffersink_params_alloc) ++ RESOLVE_METHOD(av_buffersink_poll_frame) + END_METHOD_RESOLVE() + + /* dependencies of libavfilter */ +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +index 74f2431..39f653e 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +@@ -128,7 +128,7 @@ CDVDVideoCodecFFmpeg::CDVDVideoCodecFFmpeg() : CDVDVideoCodec() + m_pFilterGraph = NULL; + m_pFilterIn = NULL; + m_pFilterOut = NULL; +- m_pFilterLink = NULL; ++ m_pBufferRef = NULL; + + m_iPictureWidth = 0; + m_iPictureHeight = 0; +@@ -578,10 +578,10 @@ bool CDVDVideoCodecFFmpeg::GetPictureCommon(DVDVideoPicture* pDvdVideoPicture) + pDvdVideoPicture->iWidth = m_pCodecContext->width; + pDvdVideoPicture->iHeight = m_pCodecContext->height; + +- if(m_pFilterLink) ++ if(m_pBufferRef) + { +- pDvdVideoPicture->iWidth = m_pFilterLink->cur_buf->video->w; +- pDvdVideoPicture->iHeight = m_pFilterLink->cur_buf->video->h; ++ pDvdVideoPicture->iWidth = m_pBufferRef->video->w; ++ pDvdVideoPicture->iHeight = m_pBufferRef->video->h; + } + + /* crop of 10 pixels if demuxer asked it */ +@@ -597,8 +597,8 @@ bool CDVDVideoCodecFFmpeg::GetPictureCommon(DVDVideoPicture* pDvdVideoPicture) + + /* use variable in the frame */ + AVRational pixel_aspect = m_pCodecContext->sample_aspect_ratio; +- if (m_pFilterLink) +- pixel_aspect = m_pFilterLink->cur_buf->video->sample_aspect_ratio; ++ if (m_pBufferRef) ++ pixel_aspect = m_pBufferRef->video->sample_aspect_ratio; + + if (pixel_aspect.num == 0) + aspect_ratio = 0; +@@ -627,8 +627,6 @@ bool CDVDVideoCodecFFmpeg::GetPictureCommon(DVDVideoPicture* pDvdVideoPicture) + pDvdVideoPicture->iFlags = DVP_FLAG_ALLOCATED; + pDvdVideoPicture->iFlags |= m_pFrame->interlaced_frame ? DVP_FLAG_INTERLACED : 0; + pDvdVideoPicture->iFlags |= m_pFrame->top_field_first ? DVP_FLAG_TOP_FIELD_FIRST: 0; +- if(m_pCodecContext->pix_fmt == PIX_FMT_YUVJ420P) +- pDvdVideoPicture->color_range = 1; + + pDvdVideoPicture->chroma_position = m_pCodecContext->chroma_sample_location; + pDvdVideoPicture->color_primaries = m_pCodecContext->color_primaries; +@@ -688,8 +686,27 @@ bool CDVDVideoCodecFFmpeg::GetPicture(DVDVideoPicture* pDvdVideoPicture) + } + + pDvdVideoPicture->iFlags |= pDvdVideoPicture->data[0] ? 0 : DVP_FLAG_DROPPED; +- pDvdVideoPicture->format = DVDVideoPicture::FMT_YUV420P; + pDvdVideoPicture->extended_format = 0; ++ pDvdVideoPicture->color_range = 0; ++ ++ PixelFormat pix_fmt; ++ if(m_pBufferRef) ++ pix_fmt = (PixelFormat)m_pBufferRef->format; ++ else if(m_pConvertFrame) ++ pix_fmt = PIX_FMT_YUV420P; ++ else ++ pix_fmt = m_pCodecContext->pix_fmt; ++ ++ switch(pix_fmt) ++ { ++ case PIX_FMT_YUVJ420P: ++ pDvdVideoPicture->format = DVDVideoPicture::FMT_YUV420P; ++ pDvdVideoPicture->color_range = 1; ++ break; ++ default: ++ pDvdVideoPicture->format = DVDVideoPicture::FMT_YUV420P; ++ break; ++ } + + return true; + } +@@ -697,6 +714,7 @@ bool CDVDVideoCodecFFmpeg::GetPicture(DVDVideoPicture* pDvdVideoPicture) + int CDVDVideoCodecFFmpeg::FilterOpen(const CStdString& filters) + { + int result; ++ AVBufferSinkParams *buffersink_params; + + if (m_pFilterGraph) + FilterClose(); +@@ -710,17 +728,8 @@ int CDVDVideoCodecFFmpeg::FilterOpen(const CStdString& filters) + return -1; + } + +- // CrHasher HACK (if an alternative becomes available use it!): In order to display the output +- // produced by a combination of filters we insert "nullsink" as the last filter and we use +- // its input pin as our output pin. +- // +- // input --> .. --> last_filter --> [in] nullsink [null] [in] --> output +- // | | +- // | | +- // +------------------------+ +- // + AVFilter* srcFilter = m_dllAvFilter.avfilter_get_by_name("buffer"); +- AVFilter* outFilter = m_dllAvFilter.avfilter_get_by_name("nullsink"); // should be last filter in the graph for now ++ AVFilter* outFilter = m_dllAvFilter.avfilter_get_by_name("buffersink"); // should be last filter in the graph for now + + CStdString args; + +@@ -739,11 +748,20 @@ int CDVDVideoCodecFFmpeg::FilterOpen(const CStdString& filters) + return result; + } + +- if ((result = m_dllAvFilter.avfilter_graph_create_filter(&m_pFilterOut, outFilter, "out", NULL, NULL/*nullsink=>NULL*/, m_pFilterGraph)) < 0) ++ enum PixelFormat pix_fmts[] = { PIX_FMT_YUV420P, PIX_FMT_YUVJ420P, PIX_FMT_NONE }; ++ buffersink_params = m_dllAvFilter.av_buffersink_params_alloc(); ++ buffersink_params->pixel_fmts = pix_fmts; ++#ifdef FF_API_OLD_VSINK_API ++ if ((result = m_dllAvFilter.avfilter_graph_create_filter(&m_pFilterOut, outFilter, "out", NULL, (void*)buffersink_params->pixel_fmts, m_pFilterGraph)) < 0) ++#else ++ if ((result = m_dllAvFilter.avfilter_graph_create_filter(&m_pFilterOut, outFilter, "out", NULL, buffersink_params, m_pFilterGraph)) < 0) ++#endif + { ++ m_dllAvUtil.av_freep(&buffersink_params); + CLog::Log(LOGERROR, "CDVDVideoCodecFFmpeg::FilterOpen - avfilter_graph_create_filter: out"); + return result; + } ++ m_dllAvUtil.av_freep(&buffersink_params); + + if (!filters.empty()) + { +@@ -789,6 +807,12 @@ int CDVDVideoCodecFFmpeg::FilterOpen(const CStdString& filters) + + void CDVDVideoCodecFFmpeg::FilterClose() + { ++ if(m_pBufferRef) ++ { ++ m_dllAvFilter.avfilter_unref_buffer(m_pBufferRef); ++ m_pBufferRef = NULL; ++ } ++ + if (m_pFilterGraph) + { + m_dllAvFilter.avfilter_graph_free(&m_pFilterGraph); +@@ -796,7 +820,6 @@ void CDVDVideoCodecFFmpeg::FilterClose() + // Disposed by above code + m_pFilterIn = NULL; + m_pFilterOut = NULL; +- m_pFilterLink = NULL; + } + } + +@@ -804,8 +827,6 @@ int CDVDVideoCodecFFmpeg::FilterProcess(AVFrame* frame) + { + int result, frames; + +- m_pFilterLink = m_pFilterOut->inputs[0]; +- + if (frame) + { + result = m_dllAvFilter.av_vsrc_buffer_add_frame(m_pFilterIn, frame, 0); +@@ -816,7 +837,13 @@ int CDVDVideoCodecFFmpeg::FilterProcess(AVFrame* frame) + } + } + +- if ((frames = m_dllAvFilter.avfilter_poll_frame(m_pFilterLink)) < 0) ++ if(m_pBufferRef) ++ { ++ m_dllAvFilter.avfilter_unref_buffer(m_pBufferRef); ++ m_pBufferRef = NULL; ++ } ++ ++ if ((frames = m_dllAvFilter.av_buffersink_poll_frame(m_pFilterOut)) < 0) + { + CLog::Log(LOGERROR, "CDVDVideoCodecFFmpeg::FilterProcess - avfilter_poll_frame"); + return VC_ERROR; +@@ -824,19 +851,9 @@ int CDVDVideoCodecFFmpeg::FilterProcess(AVFrame* frame) + + if (frames > 0) + { +- if (m_pFilterLink->cur_buf) +- { +- m_dllAvFilter.avfilter_unref_buffer(m_pFilterLink->cur_buf); +- m_pFilterLink->cur_buf = NULL; +- } +- +- if ((result = m_dllAvFilter.avfilter_request_frame(m_pFilterLink)) < 0) +- { +- CLog::Log(LOGERROR, "CDVDVideoCodecFFmpeg::FilterProcess - avfilter_request_frame"); +- return VC_ERROR; +- } + +- if (!m_pFilterLink->cur_buf) ++ result = m_dllAvFilter.av_buffersink_get_buffer_ref(m_pFilterOut, &m_pBufferRef, 0); ++ if(!m_pBufferRef) + { + CLog::Log(LOGERROR, "CDVDVideoCodecFFmpeg::FilterProcess - cur_buf"); + return VC_ERROR; +@@ -847,11 +864,11 @@ int CDVDVideoCodecFFmpeg::FilterProcess(AVFrame* frame) + else + m_pFrame->repeat_pict = -(frames - 1); + +- m_pFrame->interlaced_frame = m_pFilterLink->cur_buf->video->interlaced; +- m_pFrame->top_field_first = m_pFilterLink->cur_buf->video->top_field_first; ++ m_pFrame->interlaced_frame = m_pBufferRef->video->interlaced; ++ m_pFrame->top_field_first = m_pBufferRef->video->top_field_first; + +- memcpy(m_pFrame->linesize, m_pFilterLink->cur_buf->linesize, 4*sizeof(int)); +- memcpy(m_pFrame->data , m_pFilterLink->cur_buf->data , 4*sizeof(uint8_t*)); ++ memcpy(m_pFrame->linesize, m_pBufferRef->linesize, 4*sizeof(int)); ++ memcpy(m_pFrame->data , m_pBufferRef->data , 4*sizeof(uint8_t*)); + + if(frames > 1) + return VC_PICTURE; +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h +index 53890cb..0853c51 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.h +@@ -88,7 +88,7 @@ protected: + AVFilterGraph* m_pFilterGraph; + AVFilterContext* m_pFilterIn; + AVFilterContext* m_pFilterOut; +- AVFilterLink* m_pFilterLink; ++ AVFilterBufferRef* m_pBufferRef; + + int m_iPictureWidth; + int m_iPictureHeight; diff --git a/srcpkgs/xbmc/patches/210_all_avfilter_avcodec.patch b/srcpkgs/xbmc/patches/210_all_avfilter_avcodec.patch new file mode 100644 index 0000000000..3c1cfb3daa --- /dev/null +++ b/srcpkgs/xbmc/patches/210_all_avfilter_avcodec.patch @@ -0,0 +1,27 @@ +commit 135160be16da4f8dd8631bbd8780b8d8ac1e682d +Author: Alexis Ballier +Date: Thu Mar 1 11:51:31 2012 -0300 + + Include libavfilter/avcodec.h for av_vsrc_buffer_add_frame. + +diff --git a/lib/DllAvFilter.h b/lib/DllAvFilter.h +index cf91ee9..a6ce6d0 100644 +--- a/lib/DllAvFilter.h ++++ b/lib/DllAvFilter.h +@@ -44,13 +44,16 @@ extern "C" { + #if (defined HAVE_LIBAVFILTER_AVFILTER_H) + #include + #include ++ #include + #elif (defined HAVE_FFMPEG_AVFILTER_H) + #include + #include ++ #include + #endif + #else + #include "libavfilter/avfiltergraph.h" + #include "libavfilter/buffersink.h" ++ #include "libavfilter/avcodec.h" + #endif + } + diff --git a/srcpkgs/xbmc/patches/220_all_avfilter_loop.patch b/srcpkgs/xbmc/patches/220_all_avfilter_loop.patch new file mode 100644 index 0000000000..506a13407c --- /dev/null +++ b/srcpkgs/xbmc/patches/220_all_avfilter_loop.patch @@ -0,0 +1,19 @@ +commit 6ab7a7990bc570ad9af9c14409ccce37b7ab288b +Author: Memphiz +Date: Thu Apr 5 21:29:15 2012 +0200 + + [fix] - deadloop in libavfilter.h + +diff --git a/lib/DllAvFilter.h b/lib/DllAvFilter.h +index 45b9637..5c83654 100644 +--- a/lib/DllAvFilter.h ++++ b/lib/DllAvFilter.h +@@ -140,7 +140,7 @@ public: + virtual int avfilter_link(AVFilterContext *src, unsigned srcpad, AVFilterContext *dst, unsigned dstpad) { return ::avfilter_link(src, srcpad, dst, dstpad); } + virtual int av_buffersink_get_buffer_ref(AVFilterContext *buffer_sink, AVFilterBufferRef **bufref, int flags) { return ::av_buffersink_get_buffer_ref(buffer_sink, bufref, flags); } + virtual AVBufferSinkParams *av_buffersink_params_alloc() { return ::av_buffersink_params_alloc(); } +- virtual int av_buffersink_poll_frame(AVFilterContext *ctx) { return av_buffersink_poll_frame(ctx); } ++ virtual int av_buffersink_poll_frame(AVFilterContext *ctx) { return ::av_buffersink_poll_frame(ctx); } + // DLL faking. + virtual bool ResolveExports() { return true; } + virtual bool Load() { diff --git a/srcpkgs/xbmc/patches/230_all_avfilter_poll_frame.patch b/srcpkgs/xbmc/patches/230_all_avfilter_poll_frame.patch new file mode 100644 index 0000000000..26f3712bae --- /dev/null +++ b/srcpkgs/xbmc/patches/230_all_avfilter_poll_frame.patch @@ -0,0 +1,42 @@ +commit 4ddf29ceceaae0f96dc8c9a185b9211fea2e26ee +Author: Alexis Ballier +Date: Mon Jul 9 09:00:00 2012 -0400 + + AvFilter wrapper: Remove unused avfilter_poll_frame which has been removed in libavfilter 3. + +diff --git a/lib/DllAvFilter.h b/lib/DllAvFilter.h +index 6ae5d15..b00ceef 100644 +--- a/lib/DllAvFilter.h ++++ b/lib/DllAvFilter.h +@@ -74,7 +74,6 @@ public: + virtual void avfilter_inout_free(AVFilterInOut **inout)=0; + virtual int avfilter_graph_parse(AVFilterGraph *graph, const char *filters, AVFilterInOut **inputs, AVFilterInOut **outputs, void *log_ctx)=0; + virtual int avfilter_graph_config(AVFilterGraph *graphctx, void *log_ctx)=0; +- virtual int avfilter_poll_frame(AVFilterLink *link)=0; + virtual int avfilter_request_frame(AVFilterLink *link)=0; + virtual int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, AVFrame *frame, int flags)=0; + virtual AVFilterBufferRef *avfilter_get_video_buffer(AVFilterLink *link, int perms, int w, int h)=0; +@@ -133,7 +132,6 @@ public: + { + return ::avfilter_graph_config(graphctx, log_ctx); + } +- virtual int avfilter_poll_frame(AVFilterLink *link) { return ::avfilter_poll_frame(link); } + virtual int avfilter_request_frame(AVFilterLink *link) { return ::avfilter_request_frame(link); } + virtual int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, AVFrame *frame, int flags) { return ::av_vsrc_buffer_add_frame(buffer_filter, frame, flags); } + virtual AVFilterBufferRef *avfilter_get_video_buffer(AVFilterLink *link, int perms, int w, int h) { return ::avfilter_get_video_buffer(link, perms, w, h); } +@@ -168,7 +166,6 @@ class DllAvFilter : public DllDynamic, DllAvFilterInterface + DEFINE_METHOD1(void, avfilter_inout_free_dont_call, (AVFilterInOut **p1)) + DEFINE_FUNC_ALIGNED5(int, __cdecl, avfilter_graph_parse_dont_call, AVFilterGraph *, const char *, AVFilterInOut **, AVFilterInOut **, void *) + DEFINE_FUNC_ALIGNED2(int, __cdecl, avfilter_graph_config_dont_call, AVFilterGraph *, void *) +- DEFINE_FUNC_ALIGNED1(int, __cdecl, avfilter_poll_frame, AVFilterLink *) + DEFINE_FUNC_ALIGNED1(int, __cdecl, avfilter_request_frame, AVFilterLink*) + DEFINE_METHOD3(int, av_vsrc_buffer_add_frame, (AVFilterContext *p1, AVFrame *p2, int p3)) + DEFINE_METHOD4(AVFilterBufferRef*, avfilter_get_video_buffer, (AVFilterLink *p1, int p2, int p3, int p4)) +@@ -190,7 +187,6 @@ class DllAvFilter : public DllDynamic, DllAvFilterInterface + RESOLVE_METHOD_RENAME(avfilter_inout_free, avfilter_inout_free_dont_call) + RESOLVE_METHOD_RENAME(avfilter_graph_parse, avfilter_graph_parse_dont_call) + RESOLVE_METHOD_RENAME(avfilter_graph_config, avfilter_graph_config_dont_call) +- RESOLVE_METHOD(avfilter_poll_frame) + RESOLVE_METHOD(avfilter_request_frame) + RESOLVE_METHOD(av_vsrc_buffer_add_frame) + RESOLVE_METHOD(avfilter_get_video_buffer) diff --git a/srcpkgs/xbmc/patches/240_all_avfilter_request_frame.patch b/srcpkgs/xbmc/patches/240_all_avfilter_request_frame.patch new file mode 100644 index 0000000000..1ad8ec6894 --- /dev/null +++ b/srcpkgs/xbmc/patches/240_all_avfilter_request_frame.patch @@ -0,0 +1,42 @@ +commit 2e6f521e3412f1cf504d1588df598dd9a30622f8 +Author: Alexis Ballier +Date: Mon Jul 9 09:01:30 2012 -0400 + + AvFilter wrapper: Remove unused avfilter_request_frame mapping as the function has been removed in libavfilter 3. + +diff --git a/lib/DllAvFilter.h b/lib/DllAvFilter.h +index b00ceef..0cfa740 100644 +--- a/lib/DllAvFilter.h ++++ b/lib/DllAvFilter.h +@@ -74,7 +74,6 @@ public: + virtual void avfilter_inout_free(AVFilterInOut **inout)=0; + virtual int avfilter_graph_parse(AVFilterGraph *graph, const char *filters, AVFilterInOut **inputs, AVFilterInOut **outputs, void *log_ctx)=0; + virtual int avfilter_graph_config(AVFilterGraph *graphctx, void *log_ctx)=0; +- virtual int avfilter_request_frame(AVFilterLink *link)=0; + virtual int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, AVFrame *frame, int flags)=0; + virtual AVFilterBufferRef *avfilter_get_video_buffer(AVFilterLink *link, int perms, int w, int h)=0; + virtual void avfilter_unref_buffer(AVFilterBufferRef *ref)=0; +@@ -132,7 +131,6 @@ public: + { + return ::avfilter_graph_config(graphctx, log_ctx); + } +- virtual int avfilter_request_frame(AVFilterLink *link) { return ::avfilter_request_frame(link); } + virtual int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, AVFrame *frame, int flags) { return ::av_vsrc_buffer_add_frame(buffer_filter, frame, flags); } + virtual AVFilterBufferRef *avfilter_get_video_buffer(AVFilterLink *link, int perms, int w, int h) { return ::avfilter_get_video_buffer(link, perms, w, h); } + virtual void avfilter_unref_buffer(AVFilterBufferRef *ref) { ::avfilter_unref_buffer(ref); } +@@ -166,7 +164,6 @@ class DllAvFilter : public DllDynamic, DllAvFilterInterface + DEFINE_METHOD1(void, avfilter_inout_free_dont_call, (AVFilterInOut **p1)) + DEFINE_FUNC_ALIGNED5(int, __cdecl, avfilter_graph_parse_dont_call, AVFilterGraph *, const char *, AVFilterInOut **, AVFilterInOut **, void *) + DEFINE_FUNC_ALIGNED2(int, __cdecl, avfilter_graph_config_dont_call, AVFilterGraph *, void *) +- DEFINE_FUNC_ALIGNED1(int, __cdecl, avfilter_request_frame, AVFilterLink*) + DEFINE_METHOD3(int, av_vsrc_buffer_add_frame, (AVFilterContext *p1, AVFrame *p2, int p3)) + DEFINE_METHOD4(AVFilterBufferRef*, avfilter_get_video_buffer, (AVFilterLink *p1, int p2, int p3, int p4)) + DEFINE_METHOD1(void, avfilter_unref_buffer, (AVFilterBufferRef *p1)) +@@ -187,7 +184,6 @@ class DllAvFilter : public DllDynamic, DllAvFilterInterface + RESOLVE_METHOD_RENAME(avfilter_inout_free, avfilter_inout_free_dont_call) + RESOLVE_METHOD_RENAME(avfilter_graph_parse, avfilter_graph_parse_dont_call) + RESOLVE_METHOD_RENAME(avfilter_graph_config, avfilter_graph_config_dont_call) +- RESOLVE_METHOD(avfilter_request_frame) + RESOLVE_METHOD(av_vsrc_buffer_add_frame) + RESOLVE_METHOD(avfilter_get_video_buffer) + RESOLVE_METHOD(avfilter_unref_buffer) diff --git a/srcpkgs/xbmc/patches/250_all_avfilter_get_video_buffer.patch b/srcpkgs/xbmc/patches/250_all_avfilter_get_video_buffer.patch new file mode 100644 index 0000000000..9ae32fef75 --- /dev/null +++ b/srcpkgs/xbmc/patches/250_all_avfilter_get_video_buffer.patch @@ -0,0 +1,42 @@ +commit 0a71337ea5ea169ea442ade6c0f040a7d10e9c6a +Author: Alexis Ballier +Date: Mon Jul 9 09:02:44 2012 -0400 + + AvFilter wrapper: Remove unused avfilter_get_video_buffer mapping as the function has been removed in libavfilter 3. + +diff --git a/lib/DllAvFilter.h b/lib/DllAvFilter.h +index 0cfa740..d272c3b 100644 +--- a/lib/DllAvFilter.h ++++ b/lib/DllAvFilter.h +@@ -75,7 +75,6 @@ public: + virtual int avfilter_graph_parse(AVFilterGraph *graph, const char *filters, AVFilterInOut **inputs, AVFilterInOut **outputs, void *log_ctx)=0; + virtual int avfilter_graph_config(AVFilterGraph *graphctx, void *log_ctx)=0; + virtual int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, AVFrame *frame, int flags)=0; +- virtual AVFilterBufferRef *avfilter_get_video_buffer(AVFilterLink *link, int perms, int w, int h)=0; + virtual void avfilter_unref_buffer(AVFilterBufferRef *ref)=0; + virtual int avfilter_link(AVFilterContext *src, unsigned srcpad, AVFilterContext *dst, unsigned dstpad)=0; + virtual int av_buffersink_get_buffer_ref(AVFilterContext *buffer_sink, AVFilterBufferRef **bufref, int flags)=0; +@@ -132,7 +131,6 @@ public: + return ::avfilter_graph_config(graphctx, log_ctx); + } + virtual int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, AVFrame *frame, int flags) { return ::av_vsrc_buffer_add_frame(buffer_filter, frame, flags); } +- virtual AVFilterBufferRef *avfilter_get_video_buffer(AVFilterLink *link, int perms, int w, int h) { return ::avfilter_get_video_buffer(link, perms, w, h); } + virtual void avfilter_unref_buffer(AVFilterBufferRef *ref) { ::avfilter_unref_buffer(ref); } + virtual int avfilter_link(AVFilterContext *src, unsigned srcpad, AVFilterContext *dst, unsigned dstpad) { return ::avfilter_link(src, srcpad, dst, dstpad); } + virtual int av_buffersink_get_buffer_ref(AVFilterContext *buffer_sink, AVFilterBufferRef **bufref, int flags) { return ::av_buffersink_get_buffer_ref(buffer_sink, bufref, flags); } +@@ -165,7 +163,6 @@ class DllAvFilter : public DllDynamic, DllAvFilterInterface + DEFINE_FUNC_ALIGNED5(int, __cdecl, avfilter_graph_parse_dont_call, AVFilterGraph *, const char *, AVFilterInOut **, AVFilterInOut **, void *) + DEFINE_FUNC_ALIGNED2(int, __cdecl, avfilter_graph_config_dont_call, AVFilterGraph *, void *) + DEFINE_METHOD3(int, av_vsrc_buffer_add_frame, (AVFilterContext *p1, AVFrame *p2, int p3)) +- DEFINE_METHOD4(AVFilterBufferRef*, avfilter_get_video_buffer, (AVFilterLink *p1, int p2, int p3, int p4)) + DEFINE_METHOD1(void, avfilter_unref_buffer, (AVFilterBufferRef *p1)) + DEFINE_METHOD4(int, avfilter_link, (AVFilterContext *p1, unsigned p2, AVFilterContext *p3, unsigned p4)) + DEFINE_FUNC_ALIGNED3(int , __cdecl, av_buffersink_get_buffer_ref, AVFilterContext *, AVFilterBufferRef **, int); +@@ -185,7 +182,6 @@ class DllAvFilter : public DllDynamic, DllAvFilterInterface + RESOLVE_METHOD_RENAME(avfilter_graph_parse, avfilter_graph_parse_dont_call) + RESOLVE_METHOD_RENAME(avfilter_graph_config, avfilter_graph_config_dont_call) + RESOLVE_METHOD(av_vsrc_buffer_add_frame) +- RESOLVE_METHOD(avfilter_get_video_buffer) + RESOLVE_METHOD(avfilter_unref_buffer) + RESOLVE_METHOD(avfilter_link) + RESOLVE_METHOD(av_buffersink_get_buffer_ref) diff --git a/srcpkgs/xbmc/patches/260_all_av_buffersrc_add_frame.patch b/srcpkgs/xbmc/patches/260_all_av_buffersrc_add_frame.patch new file mode 100644 index 0000000000..5179c617a6 --- /dev/null +++ b/srcpkgs/xbmc/patches/260_all_av_buffersrc_add_frame.patch @@ -0,0 +1,81 @@ +commit d1bbbc972e6dedf7adfbb01b9c80645165d48227 +Author: Alexis Ballier +Date: Mon Jul 9 09:19:16 2012 -0400 + + AvFilter: Map and use av_buffersrc_add_frame instead of av_vsrc_buffer_add_frame with libavfilter version 3. + +diff --git a/lib/DllAvFilter.h b/lib/DllAvFilter.h +index d272c3b..de6f4c0 100644 +--- a/lib/DllAvFilter.h ++++ b/lib/DllAvFilter.h +@@ -74,7 +74,11 @@ public: + virtual void avfilter_inout_free(AVFilterInOut **inout)=0; + virtual int avfilter_graph_parse(AVFilterGraph *graph, const char *filters, AVFilterInOut **inputs, AVFilterInOut **outputs, void *log_ctx)=0; + virtual int avfilter_graph_config(AVFilterGraph *graphctx, void *log_ctx)=0; ++#if LIBAVFILTER_VERSION_INT < AV_VERSION_INT(3,0,0) + virtual int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, AVFrame *frame, int flags)=0; ++#else ++ virtual int av_buffersrc_add_frame(AVFilterContext *buffer_filter, AVFrame *frame, int flags)=0; ++#endif + virtual void avfilter_unref_buffer(AVFilterBufferRef *ref)=0; + virtual int avfilter_link(AVFilterContext *src, unsigned srcpad, AVFilterContext *dst, unsigned dstpad)=0; + virtual int av_buffersink_get_buffer_ref(AVFilterContext *buffer_sink, AVFilterBufferRef **bufref, int flags)=0; +@@ -130,7 +134,11 @@ public: + { + return ::avfilter_graph_config(graphctx, log_ctx); + } ++#if LIBAVFILTER_VERSION_INT < AV_VERSION_INT(3,0,0) + virtual int av_vsrc_buffer_add_frame(AVFilterContext *buffer_filter, AVFrame *frame, int flags) { return ::av_vsrc_buffer_add_frame(buffer_filter, frame, flags); } ++#else ++ virtual int av_buffersrc_add_frame(AVFilterContext *buffer_filter, AVFrame* frame, int flags) { return ::av_buffersrc_add_frame(buffer_filter, frame, flags); } ++#endif + virtual void avfilter_unref_buffer(AVFilterBufferRef *ref) { ::avfilter_unref_buffer(ref); } + virtual int avfilter_link(AVFilterContext *src, unsigned srcpad, AVFilterContext *dst, unsigned dstpad) { return ::avfilter_link(src, srcpad, dst, dstpad); } + virtual int av_buffersink_get_buffer_ref(AVFilterContext *buffer_sink, AVFilterBufferRef **bufref, int flags) { return ::av_buffersink_get_buffer_ref(buffer_sink, bufref, flags); } +@@ -162,7 +170,11 @@ class DllAvFilter : public DllDynamic, DllAvFilterInterface + DEFINE_METHOD1(void, avfilter_inout_free_dont_call, (AVFilterInOut **p1)) + DEFINE_FUNC_ALIGNED5(int, __cdecl, avfilter_graph_parse_dont_call, AVFilterGraph *, const char *, AVFilterInOut **, AVFilterInOut **, void *) + DEFINE_FUNC_ALIGNED2(int, __cdecl, avfilter_graph_config_dont_call, AVFilterGraph *, void *) ++#if LIBAVFILTER_VERSION_INT < AV_VERSION_INT(3,0,0) + DEFINE_METHOD3(int, av_vsrc_buffer_add_frame, (AVFilterContext *p1, AVFrame *p2, int p3)) ++#else ++ DEFINE_METHOD3(int, av_buffersrc_add_frame, (AVFilterContext *p1, AVFrame *p2, int p3)) ++#endif + DEFINE_METHOD1(void, avfilter_unref_buffer, (AVFilterBufferRef *p1)) + DEFINE_METHOD4(int, avfilter_link, (AVFilterContext *p1, unsigned p2, AVFilterContext *p3, unsigned p4)) + DEFINE_FUNC_ALIGNED3(int , __cdecl, av_buffersink_get_buffer_ref, AVFilterContext *, AVFilterBufferRef **, int); +@@ -181,7 +193,11 @@ class DllAvFilter : public DllDynamic, DllAvFilterInterface + RESOLVE_METHOD_RENAME(avfilter_inout_free, avfilter_inout_free_dont_call) + RESOLVE_METHOD_RENAME(avfilter_graph_parse, avfilter_graph_parse_dont_call) + RESOLVE_METHOD_RENAME(avfilter_graph_config, avfilter_graph_config_dont_call) ++#if LIBAVFILTER_VERSION_INT < AV_VERSION_INT(3,0,0) + RESOLVE_METHOD(av_vsrc_buffer_add_frame) ++#else ++ RESOLVE_METHOD(av_buffersrc_add_frame) ++#endif + RESOLVE_METHOD(avfilter_unref_buffer) + RESOLVE_METHOD(avfilter_link) + RESOLVE_METHOD(av_buffersink_get_buffer_ref) +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +index cb3e5a4..dd84dc3 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +@@ -776,10 +776,18 @@ int CDVDVideoCodecFFmpeg::FilterProcess(AVFrame* frame) + + if (frame) + { ++#if LIBAVFILTER_VERSION_INT < AV_VERSION_INT(3,0,0) + result = m_dllAvFilter.av_vsrc_buffer_add_frame(m_pFilterIn, frame, 0); ++#else ++ result = m_dllAvFilter.av_buffersrc_add_frame(m_pFilterIn, frame, 0); ++#endif + if (result < 0) + { ++#if LIBAVFILTER_VERSION_INT < AV_VERSION_INT(3,0,0) + CLog::Log(LOGERROR, "CDVDVideoCodecFFmpeg::FilterProcess - av_vsrc_buffer_add_frame"); ++#else ++ CLog::Log(LOGERROR, "CDVDVideoCodecFFmpeg::FilterProcess - av_buffersrc_add_frame"); ++#endif + return VC_ERROR; + } + } diff --git a/srcpkgs/xbmc/patches/270_all_is_streamed.patch b/srcpkgs/xbmc/patches/270_all_is_streamed.patch new file mode 100644 index 0000000000..55816b19f2 --- /dev/null +++ b/srcpkgs/xbmc/patches/270_all_is_streamed.patch @@ -0,0 +1,41 @@ +commit 8d4876732c80fe27e48c4b17d143655fb0737d9a +Author: elupus +Date: Mon Dec 12 22:18:18 2011 +0100 + + Replace deprecated is_streamed with new seekable flags + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthroughFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthroughFFmpeg.cpp +index 8fae8bf..9b71fd3 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthroughFFmpeg.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthroughFFmpeg.cpp +@@ -108,7 +108,7 @@ bool CDVDAudioCodecPassthroughFFmpeg::SetupMuxer(CDVDStreamInfo &hints, CStdStri + } + + /* this is streamed, no file, and ignore the index */ +- muxer.m_pFormat->pb->is_streamed = 1; ++ muxer.m_pFormat->pb->seekable = 0; + muxer.m_pFormat->flags |= AVFMT_NOFILE | AVFMT_FLAG_IGNIDX; + muxer.m_pFormat->bit_rate = hints.bitrate; + +diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +index f1b0119..cdc6e8f 100644 +--- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp ++++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +@@ -307,7 +307,7 @@ bool CDVDDemuxFFmpeg::Open(CDVDInputStream* pInput) + m_ioContext->max_packet_size *= FFMPEG_FILE_BUFFER_SIZE / m_ioContext->max_packet_size; + + if(m_pInput->Seek(0, SEEK_POSSIBLE) == 0) +- m_ioContext->is_streamed = 1; ++ m_ioContext->seekable = 0; + + if( iformat == NULL ) + { +@@ -425,7 +425,7 @@ bool CDVDDemuxFFmpeg::Open(CDVDInputStream* pInput) + } + + // analyse very short to speed up mjpeg playback start +- if (iformat && (strcmp(iformat->name, "mjpeg") == 0) && m_ioContext->is_streamed) ++ if (iformat && (strcmp(iformat->name, "mjpeg") == 0) && m_ioContext->seekable == 0) + m_pFormatContext->max_analyze_duration = 500000; + + // we need to know if this is matroska or avi later diff --git a/srcpkgs/xbmc/patches/280_all_stream_copy.patch b/srcpkgs/xbmc/patches/280_all_stream_copy.patch new file mode 100644 index 0000000000..c733bc674c --- /dev/null +++ b/srcpkgs/xbmc/patches/280_all_stream_copy.patch @@ -0,0 +1,19 @@ +commit 75179cb1513bd0202e1c69bafbc557f545d8f220 +Author: Alexis Ballier +Date: Thu Mar 1 12:05:24 2012 -0300 + + Remove assignment to stream_copy which is never read after, be it by xbmc or ffmpeg. + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthroughFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthroughFFmpeg.cpp +index 20f9aff..fbd6264 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthroughFFmpeg.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthroughFFmpeg.cpp +@@ -143,8 +143,6 @@ bool CDVDAudioCodecPassthroughFFmpeg::SetupMuxer(CDVDStreamInfo &hints, CStdStri + + + /* set the stream's parameters */ +- muxer.m_pStream->stream_copy = 1; +- + m_SampleRate = hints.samplerate; + if(!m_SampleRate && hints.codec == CODEC_ID_AC3) + m_SampleRate = 48000; diff --git a/srcpkgs/xbmc/patches/290_all_age.patch b/srcpkgs/xbmc/patches/290_all_age.patch new file mode 100644 index 0000000000..01ccf06afc --- /dev/null +++ b/srcpkgs/xbmc/patches/290_all_age.patch @@ -0,0 +1,39 @@ +commit fd3506a4c51b75d80f5f36daba30772235439984 +Author: Alexis Ballier +Date: Thu Mar 1 12:08:08 2012 -0300 + + Do not set AVFrame.age. + + It is unused and does not exist anymore in libavcodec 54. + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp +index 18fe368..a4b8725 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.cpp +@@ -223,7 +223,6 @@ int CDecoder::GetBuffer(AVCodecContext *avctx, AVFrame *pic) + } + + pic->type = FF_BUFFER_TYPE_USER; +- pic->age = 1; + pic->data[0] = (uint8_t*)wrapper; + pic->data[1] = NULL; + pic->data[2] = NULL; +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +index ea1f0bd..539d913 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp +@@ -1197,14 +1197,12 @@ int CVDPAU::FFGetBuffer(AVCodecContext *avctx, AVFrame *pic) + + if(pic->reference) + { +- pic->age = pA->ip_age[0]; + pA->ip_age[0]= pA->ip_age[1]+1; + pA->ip_age[1]= 1; + pA->b_age++; + } + else + { +- pic->age = pA->b_age; + pA->ip_age[0]++; + pA->ip_age[1]++; + pA->b_age = 1; diff --git a/srcpkgs/xbmc/patches/300_all_file_size.patch b/srcpkgs/xbmc/patches/300_all_file_size.patch new file mode 100644 index 0000000000..f1bc8b8e9b --- /dev/null +++ b/srcpkgs/xbmc/patches/300_all_file_size.patch @@ -0,0 +1,53 @@ +commit 29121de3069a6684df11257ada9eccbe623157f0 +Author: elupus +Date: Mon Dec 12 22:20:31 2011 +0100 + + Remove old code depending on deprecated file_size + + This may need some testing for growing files + +diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +index cdc6e8f..1205e05 100644 +--- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp ++++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxFFmpeg.cpp +@@ -765,19 +765,12 @@ DemuxPacket* CDVDDemuxFFmpeg::Read() + { + stream->duration = duration; + duration = m_dllAvUtil.av_rescale_rnd(stream->duration, (int64_t)stream->time_base.num * AV_TIME_BASE, stream->time_base.den, AV_ROUND_NEAR_INF); +- if ((m_pFormatContext->duration == (int64_t)AV_NOPTS_VALUE && m_pFormatContext->file_size > 0) ++ if ((m_pFormatContext->duration == (int64_t)AV_NOPTS_VALUE) + || (m_pFormatContext->duration != (int64_t)AV_NOPTS_VALUE && duration > m_pFormatContext->duration)) + m_pFormatContext->duration = duration; + } + } + +- // check if stream seem to have grown since start +- if(m_pFormatContext->file_size > 0 && m_pFormatContext->pb) +- { +- if(m_pFormatContext->pb->pos > m_pFormatContext->file_size) +- m_pFormatContext->file_size = m_pFormatContext->pb->pos; +- } +- + pPacket->iStreamId = pkt.stream_index; // XXX just for now + } + m_dllAvCodec.av_free_packet(&pkt); +@@ -915,19 +908,6 @@ int CDVDDemuxFFmpeg::GetStreamLength() + if (!m_pFormatContext) + return 0; + +- /* apperently ffmpeg messes up sometimes, so check for negative value too */ +- if (m_pFormatContext->duration == (int64_t)AV_NOPTS_VALUE || m_pFormatContext->duration < 0LL) +- { +- // no duration is available for us +- // try to calculate it +- int iLength = 0; +- if (m_iCurrentPts != DVD_NOPTS_VALUE && m_pFormatContext->file_size > 0 && m_pFormatContext->pb && m_pFormatContext->pb->pos > 0) +- { +- iLength = (int)(((m_iCurrentPts * m_pFormatContext->file_size) / m_pFormatContext->pb->pos) / 1000) & 0xFFFFFFFF; +- } +- return iLength; +- } +- + return (int)(m_pFormatContext->duration / (AV_TIME_BASE / 1000)); + } + diff --git a/srcpkgs/xbmc/patches/310_all_av_read_frame_flush.patch b/srcpkgs/xbmc/patches/310_all_av_read_frame_flush.patch new file mode 100644 index 0000000000..96573b7d4b --- /dev/null +++ b/srcpkgs/xbmc/patches/310_all_av_read_frame_flush.patch @@ -0,0 +1,84 @@ +commit ac2d961354533972c4bde5e8c7defd5404754877 +Author: Alexis Ballier +Date: Thu Apr 5 11:07:41 2012 -0300 + + Bring av_read_frame_flush in line with ffmpeg git. + + Current version failed to build with ffmpeg git. This patch uses the new code when we are building against libavformat 54. + +diff --git a/lib/xbmc-dll-symbols/DllAvFormat.c b/lib/xbmc-dll-symbols/DllAvFormat.c +index 31040a3..61ffdf4 100644 +--- a/lib/xbmc-dll-symbols/DllAvFormat.c ++++ b/lib/xbmc-dll-symbols/DllAvFormat.c +@@ -28,6 +28,7 @@ + #include + + /* Taken from libavformat/utils.c */ ++#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(54,0,0) + static void flush_packet_queue(AVFormatContext *s) + { + AVPacketList *pktl; +@@ -53,6 +54,27 @@ static void flush_packet_queue(AVFormatContext *s) + s->raw_packet_buffer_remaining_size = RAW_PACKET_BUFFER_SIZE; + #endif + } ++#else ++static void free_packet_buffer(AVPacketList **pkt_buf, AVPacketList **pkt_buf_end) ++{ ++ while (*pkt_buf) { ++ AVPacketList *pktl = *pkt_buf; ++ *pkt_buf = pktl->next; ++ av_free_packet(&pktl->pkt); ++ av_freep(&pktl); ++ } ++ *pkt_buf_end = NULL; ++} ++/* XXX: suppress the packet queue */ ++static void flush_packet_queue(AVFormatContext *s) ++{ ++ free_packet_buffer(&s->parse_queue, &s->parse_queue_end); ++ free_packet_buffer(&s->packet_buffer, &s->packet_buffer_end); ++ free_packet_buffer(&s->raw_packet_buffer, &s->raw_packet_buffer_end); ++ ++ s->raw_packet_buffer_remaining_size = RAW_PACKET_BUFFER_SIZE; ++} ++#endif + + /* Taken from libavformat/utils.c */ + void av_read_frame_flush(AVFormatContext *s) +@@ -62,7 +84,9 @@ void av_read_frame_flush(AVFormatContext *s) + + flush_packet_queue(s); + ++#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(54,0,0) + s->cur_st = NULL; ++#endif + + /* for each stream, reset read state */ + for(i = 0; i < s->nb_streams; i++) { +@@ -71,14 +95,25 @@ void av_read_frame_flush(AVFormatContext *s) + if (st->parser) { + av_parser_close(st->parser); + st->parser = NULL; ++#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(54,0,0) + av_free_packet(&st->cur_pkt); ++#endif + } + st->last_IP_pts = AV_NOPTS_VALUE; ++#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(54,0,0) + st->cur_dts = AV_NOPTS_VALUE; /* we set the current DTS to an unspecified origin */ + st->reference_dts = AV_NOPTS_VALUE; + /* fail safe */ + st->cur_ptr = NULL; + st->cur_len = 0; ++#else ++#define RELATIVE_TS_BASE (INT64_MAX - (1LL<<48)) ++ if(st->first_dts == AV_NOPTS_VALUE) st->cur_dts = RELATIVE_TS_BASE; ++ else st->cur_dts = AV_NOPTS_VALUE; /* we set the current DTS to an unspecified origin */ ++ st->reference_dts = AV_NOPTS_VALUE; ++ ++ st->probe_packets = MAX_PROBE_PACKETS; ++#endif + + for(j=0; jpts_buffer[j]= AV_NOPTS_VALUE; diff --git a/srcpkgs/xbmc/patches/320_all_av_opt_set.patch b/srcpkgs/xbmc/patches/320_all_av_opt_set.patch new file mode 100644 index 0000000000..e67c940754 --- /dev/null +++ b/srcpkgs/xbmc/patches/320_all_av_opt_set.patch @@ -0,0 +1,77 @@ +commit 4caa26437aa24253cb97032a46d7c51581b6d5f7 +Author: Alexis Ballier +Date: Thu Mar 1 12:57:40 2012 -0300 + + Use av_opt_set instead of av_set_string3 and drop support for old API. + +diff --git a/lib/DllAvUtil.h b/lib/DllAvUtil.h +index 0a293f9..f498c7c 100644 +--- a/lib/DllAvUtil.h ++++ b/lib/DllAvUtil.h +@@ -90,7 +90,7 @@ public: + virtual int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq)=0; + virtual const AVCRC* av_crc_get_table(AVCRCId crc_id)=0; + virtual uint32_t av_crc(const AVCRC *ctx, uint32_t crc, const uint8_t *buffer, size_t length)=0; +- virtual int av_set_string3(void *obj, const char *name, const char *val, int alloc, const AVOption **o_out)=0; ++ virtual int av_opt_set(void *obj, const char *name, const char *val, int search_flags)=0; + virtual AVFifoBuffer *av_fifo_alloc(unsigned int size) = 0; + virtual void av_fifo_free(AVFifoBuffer *f) = 0; + virtual void av_fifo_reset(AVFifoBuffer *f) = 0; +@@ -121,12 +121,7 @@ public: + virtual int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq) { return ::av_rescale_q(a, bq, cq); } + virtual const AVCRC* av_crc_get_table(AVCRCId crc_id) { return ::av_crc_get_table(crc_id); } + virtual uint32_t av_crc(const AVCRC *ctx, uint32_t crc, const uint8_t *buffer, size_t length) { return ::av_crc(ctx, crc, buffer, length); } +-#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(52,7,0) +- // API added on: 2008-12-16 +- virtual int av_set_string3(void *obj, const char *name, const char *val, int alloc, const AVOption **o_out) { return ::av_set_string3(obj, name, val, alloc, o_out); } +-#else +- virtual int av_set_string3(void *obj, const char *name, const char *val, int alloc, const AVOption **o_out) { return AVERROR(ENOENT); } +-#endif ++ virtual int av_opt_set(void *obj, const char *name, const char *val, int search_flags) { return ::av_opt_set(obj, name, val, search_flags); } + virtual AVFifoBuffer *av_fifo_alloc(unsigned int size) {return ::av_fifo_alloc(size); } + virtual void av_fifo_free(AVFifoBuffer *f) { ::av_fifo_free(f); } + virtual void av_fifo_reset(AVFifoBuffer *f) { ::av_fifo_reset(f); } +@@ -168,7 +163,7 @@ class DllAvUtilBase : public DllDynamic, DllAvUtilInterface + DEFINE_METHOD3(int64_t, av_rescale_q, (int64_t p1, AVRational p2, AVRational p3)); + DEFINE_METHOD1(const AVCRC*, av_crc_get_table, (AVCRCId p1)) + DEFINE_METHOD4(uint32_t, av_crc, (const AVCRC *p1, uint32_t p2, const uint8_t *p3, size_t p4)); +- DEFINE_METHOD5(int, av_set_string3, (void *p1, const char *p2, const char *p3, int p4, const AVOption **p5)); ++ DEFINE_METHOD4(int, av_opt_set, (void *p1, const char *p2, const char *p3, int p4)); + DEFINE_METHOD1(AVFifoBuffer*, av_fifo_alloc, (unsigned int p1)) + DEFINE_METHOD1(void, av_fifo_free, (AVFifoBuffer *p1)) + DEFINE_METHOD1(void, av_fifo_reset, (AVFifoBuffer *p1)) +@@ -192,7 +187,7 @@ class DllAvUtilBase : public DllDynamic, DllAvUtilInterface + RESOLVE_METHOD(av_rescale_q) + RESOLVE_METHOD(av_crc_get_table) + RESOLVE_METHOD(av_crc) +- RESOLVE_METHOD(av_set_string3) ++ RESOLVE_METHOD(av_opt_set) + RESOLVE_METHOD(av_fifo_alloc) + RESOLVE_METHOD(av_fifo_free) + RESOLVE_METHOD(av_fifo_reset) +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthroughFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthroughFFmpeg.cpp +index fbd6264..c0c3c06 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthroughFFmpeg.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthroughFFmpeg.cpp +@@ -123,7 +123,7 @@ bool CDVDAudioCodecPassthroughFFmpeg::SetupMuxer(CDVDStreamInfo &hints, CStdStri + #endif + + /* request output of wanted endianness */ +- if (!fOut->priv_class || m_dllAvUtil.av_set_string3(muxer.m_pFormat->priv_data, "spdif_flags", spdifFlags, 0, NULL) != 0) ++ if (!fOut->priv_class || m_dllAvUtil.av_opt_set(muxer.m_pFormat->priv_data, "spdif_flags", spdifFlags, 0) != 0) + { + #if defined(WORDS_BIGENDIAN) && !defined(__APPLE__) + CLog::Log(LOGERROR, "CDVDAudioCodecPassthroughFFmpeg::SetupMuxer - Unable to set big-endian stream mode (FFmpeg too old?), disabling passthrough"); +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +index bd115b9..33bb3b7 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +@@ -277,7 +277,7 @@ bool CDVDVideoCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options + if (it->m_name == "surfaces") + m_uSurfacesCount = std::atoi(it->m_value.c_str()); + else +- m_dllAvUtil.av_set_string3(m_pCodecContext, it->m_name.c_str(), it->m_value.c_str(), 0, NULL); ++ m_dllAvUtil.av_opt_set(m_pCodecContext, it->m_name.c_str(), it->m_value.c_str(), 0); + } + + int num_threads = std::min(8 /*MAX_THREADS*/, g_cpuInfo.getCPUCount()); diff --git a/srcpkgs/xbmc/patches/340_all_decode_audio4.patch b/srcpkgs/xbmc/patches/340_all_decode_audio4.patch new file mode 100644 index 0000000000..965a6d6e1f --- /dev/null +++ b/srcpkgs/xbmc/patches/340_all_decode_audio4.patch @@ -0,0 +1,186 @@ +commit 525834b388b3f0c7d2cece694b8893684a7715b7 +Author: elupus +Date: Fri Mar 23 21:06:50 2012 +0100 + + Convert to avcodec_decode_audio4 and drop avcodec_decode_audio3. + +diff --git a/lib/DllAvCodec.h b/lib/DllAvCodec.h +index 7993408..9a4164a 100644 +--- a/lib/DllAvCodec.h ++++ b/lib/DllAvCodec.h +@@ -91,7 +91,7 @@ public: + virtual AVFrame *avcodec_alloc_frame(void)=0; + virtual int avpicture_fill(AVPicture *picture, uint8_t *ptr, PixelFormat pix_fmt, int width, int height)=0; + virtual int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture, int *got_picture_ptr, AVPacket *avpkt)=0; +- virtual int avcodec_decode_audio3(AVCodecContext *avctx, int16_t *samples, int *frame_size_ptr, AVPacket *avpkt)=0; ++ virtual int avcodec_decode_audio4(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt)=0; + virtual int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub, int *got_sub_ptr, AVPacket *avpkt)=0; + virtual int avcodec_encode_audio(AVCodecContext *avctx, uint8_t *buf, int buf_size, const short *samples)=0; + virtual int avpicture_get_size(PixelFormat pix_fmt, int width, int height)=0; +@@ -160,7 +160,7 @@ public: + virtual AVFrame *avcodec_alloc_frame() { return ::avcodec_alloc_frame(); } + virtual int avpicture_fill(AVPicture *picture, uint8_t *ptr, PixelFormat pix_fmt, int width, int height) { return ::avpicture_fill(picture, ptr, pix_fmt, width, height); } + virtual int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture, int *got_picture_ptr, AVPacket *avpkt) { return ::avcodec_decode_video2(avctx, picture, got_picture_ptr, avpkt); } +- virtual int avcodec_decode_audio3(AVCodecContext *avctx, int16_t *samples, int *frame_size_ptr, AVPacket *avpkt) { return ::avcodec_decode_audio3(avctx, samples, frame_size_ptr, avpkt); } ++ virtual int avcodec_decode_audio4(AVCodecContext *avctx, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { return ::avcodec_decode_audio4(avctx, frame, got_frame_ptr, avpkt); } + virtual int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub, int *got_sub_ptr, AVPacket *avpkt) { return ::avcodec_decode_subtitle2(avctx, sub, got_sub_ptr, avpkt); } + virtual int avcodec_encode_audio(AVCodecContext *avctx, uint8_t *buf, int buf_size, const short *samples) { return ::avcodec_encode_audio(avctx, buf, buf_size, samples); } + virtual int avpicture_get_size(PixelFormat pix_fmt, int width, int height) { return ::avpicture_get_size(pix_fmt, width, height); } +@@ -222,7 +222,7 @@ class DllAvCodec : public DllDynamic, DllAvCodecInterface + DEFINE_FUNC_ALIGNED1(void, __cdecl, avcodec_flush_buffers, AVCodecContext*) + DEFINE_FUNC_ALIGNED3(int, __cdecl, avcodec_open2_dont_call, AVCodecContext*, AVCodec *, AVDictionary **) + DEFINE_FUNC_ALIGNED4(int, __cdecl, avcodec_decode_video2, AVCodecContext*, AVFrame*, int*, AVPacket*) +- DEFINE_FUNC_ALIGNED4(int, __cdecl, avcodec_decode_audio3, AVCodecContext*, int16_t*, int*, AVPacket*) ++ DEFINE_FUNC_ALIGNED4(int, __cdecl, avcodec_decode_audio4, AVCodecContext*, AVFrame*, int*, AVPacket*) + DEFINE_FUNC_ALIGNED4(int, __cdecl, avcodec_decode_subtitle2, AVCodecContext*, AVSubtitle*, int*, AVPacket*) + DEFINE_FUNC_ALIGNED4(int, __cdecl, avcodec_encode_audio, AVCodecContext*, uint8_t*, int, const short*) + DEFINE_FUNC_ALIGNED1(AVCodecContext*, __cdecl, avcodec_alloc_context3, AVCodec *) +@@ -272,7 +272,7 @@ class DllAvCodec : public DllDynamic, DllAvCodecInterface + RESOLVE_METHOD_RENAME(avcodec_register_all, avcodec_register_all_dont_call) + RESOLVE_METHOD(avpicture_fill) + RESOLVE_METHOD(avcodec_decode_video2) +- RESOLVE_METHOD(avcodec_decode_audio3) ++ RESOLVE_METHOD(avcodec_decode_audio4) + RESOLVE_METHOD(avcodec_decode_subtitle2) + RESOLVE_METHOD(avcodec_encode_audio) + RESOLVE_METHOD(avpicture_get_size) +diff --git a/lib/DllAvUtil.h b/lib/DllAvUtil.h +index 990317c..ad41a14 100644 +--- a/lib/DllAvUtil.h ++++ b/lib/DllAvUtil.h +@@ -101,6 +101,7 @@ public: + virtual int av_get_bytes_per_sample(enum AVSampleFormat p1) = 0; + virtual AVDictionaryEntry *av_dict_get(AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags) = 0; + virtual int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)=0; ++ virtual int av_samples_get_buffer_size (int *linesize, int nb_channels, int nb_samples, enum AVSampleFormat sample_fmt, int align) = 0; + }; + + #if (defined USE_EXTERNAL_FFMPEG) +@@ -135,6 +136,8 @@ public: + { return ::av_get_bytes_per_sample(p1); } + virtual AVDictionaryEntry *av_dict_get(AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags){ return ::av_dict_get(m, key, prev, flags); } + virtual int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags) { return ::av_dict_set(pm, key, value, flags); } ++ virtual int av_samples_get_buffer_size (int *linesize, int nb_channels, int nb_samples, enum AVSampleFormat sample_fmt, int align) ++ { return ::av_samples_get_buffer_size(linesize, nb_channels, nb_samples, sample_fmt, align); } + + // DLL faking. + virtual bool ResolveExports() { return true; } +@@ -174,6 +177,7 @@ class DllAvUtilBase : public DllDynamic, DllAvUtilInterface + DEFINE_METHOD1(int, av_get_bytes_per_sample, (enum AVSampleFormat p1)) + DEFINE_METHOD4(AVDictionaryEntry *, av_dict_get, (AVDictionary *p1, const char *p2, const AVDictionaryEntry *p3, int p4)) + DEFINE_METHOD4(int, av_dict_set, (AVDictionary **p1, const char *p2, const char *p3, int p4)); ++ DEFINE_METHOD5(int, av_samples_get_buffer_size, (int *p1, int p2, int p3, enum AVSampleFormat p4, int p5)) + + public: + BEGIN_METHOD_RESOLVE() +@@ -198,6 +202,7 @@ class DllAvUtilBase : public DllDynamic, DllAvUtilInterface + RESOLVE_METHOD(av_get_bytes_per_sample) + RESOLVE_METHOD(av_dict_get) + RESOLVE_METHOD(av_dict_set) ++ RESOLVE_METHOD(av_samples_get_buffer_size) + END_METHOD_RESOLVE() + }; + +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp +index 2e8766e..ad8a95c 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp +@@ -29,10 +29,6 @@ + + CDVDAudioCodecFFmpeg::CDVDAudioCodecFFmpeg() : CDVDAudioCodec() + { +- m_iBufferSize1 = 0; +- m_pBuffer1 = (BYTE*)_aligned_malloc(AVCODEC_MAX_AUDIO_FRAME_SIZE + FF_INPUT_BUFFER_PADDING_SIZE, 16); +- memset(m_pBuffer1, 0, AVCODEC_MAX_AUDIO_FRAME_SIZE + FF_INPUT_BUFFER_PADDING_SIZE); +- + m_iBufferSize2 = 0; + m_pBuffer2 = (BYTE*)_aligned_malloc(AVCODEC_MAX_AUDIO_FRAME_SIZE + FF_INPUT_BUFFER_PADDING_SIZE, 16); + memset(m_pBuffer2, 0, AVCODEC_MAX_AUDIO_FRAME_SIZE + FF_INPUT_BUFFER_PADDING_SIZE); +@@ -45,11 +41,11 @@ CDVDAudioCodecFFmpeg::CDVDAudioCodecFFmpeg() : CDVDAudioCodec() + m_channelMap[0] = PCM_INVALID; + m_channels = 0; + m_layout = 0; ++ m_pFrame1 = NULL; + } + + CDVDAudioCodecFFmpeg::~CDVDAudioCodecFFmpeg() + { +- _aligned_free(m_pBuffer1); + _aligned_free(m_pBuffer2); + Dispose(); + } +@@ -103,6 +99,7 @@ bool CDVDAudioCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options + return false; + } + ++ m_pFrame1 = m_dllAvCodec.avcodec_alloc_frame(); + m_bOpenedCodec = true; + m_iSampleFormat = AV_SAMPLE_FMT_NONE; + return true; +@@ -110,6 +107,9 @@ bool CDVDAudioCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options + + void CDVDAudioCodecFFmpeg::Dispose() + { ++ if (m_pFrame1) m_dllAvUtil.av_free(m_pFrame1); ++ m_pFrame1 = NULL; ++ + if (m_pConvert) + { + m_dllAvCodec.av_audio_convert_free(m_pConvert); +@@ -134,7 +134,7 @@ void CDVDAudioCodecFFmpeg::Dispose() + + int CDVDAudioCodecFFmpeg::Decode(BYTE* pData, int iSize) + { +- int iBytesUsed; ++ int iBytesUsed, got_frame; + if (!m_pCodecContext) return -1; + + m_iBufferSize1 = AVCODEC_MAX_AUDIO_FRAME_SIZE ; +@@ -144,10 +144,13 @@ int CDVDAudioCodecFFmpeg::Decode(BYTE* pData, int iSize) + m_dllAvCodec.av_init_packet(&avpkt); + avpkt.data = pData; + avpkt.size = iSize; +- iBytesUsed = m_dllAvCodec.avcodec_decode_audio3( m_pCodecContext +- , (int16_t*)m_pBuffer1 +- , &m_iBufferSize1 ++ iBytesUsed = m_dllAvCodec.avcodec_decode_audio4( m_pCodecContext ++ , m_pFrame1 ++ , &got_frame + , &avpkt); ++ if (iBytesUsed < 0 || !got_frame) ++ return iBytesUsed; ++ m_iBufferSize1 = m_dllAvUtil.av_samples_get_buffer_size(NULL, m_pCodecContext->channels, m_pFrame1->nb_samples, m_pCodecContext->sample_fmt, 1); + + /* some codecs will attempt to consume more data than what we gave */ + if (iBytesUsed > iSize) +@@ -183,7 +186,7 @@ int CDVDAudioCodecFFmpeg::Decode(BYTE* pData, int iSize) + return iBytesUsed; + } + +- const void *ibuf[6] = { m_pBuffer1 }; ++ const void *ibuf[6] = { m_pFrame1->data[0] }; + void *obuf[6] = { m_pBuffer2 }; + int istr[6] = { m_dllAvUtil.av_get_bytes_per_sample(m_pCodecContext->sample_fmt) }; + int ostr[6] = { 2 }; +@@ -207,7 +210,7 @@ int CDVDAudioCodecFFmpeg::GetData(BYTE** dst) + { + if(m_iBufferSize1) + { +- *dst = m_pBuffer1; ++ *dst = m_pFrame1->data[0]; + return m_iBufferSize1; + } + if(m_iBufferSize2) +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.h b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.h +index 0446213..4c01499 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.h ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.h +@@ -50,7 +50,7 @@ protected: + enum AVSampleFormat m_iSampleFormat; + enum PCMChannels m_channelMap[PCM_MAX_CH + 1]; + +- BYTE *m_pBuffer1; ++ AVFrame* m_pFrame1; + int m_iBufferSize1; + + BYTE *m_pBuffer2; diff --git a/srcpkgs/xbmc/patches/350_all_av_get_default_channel_layout.patch b/srcpkgs/xbmc/patches/350_all_av_get_default_channel_layout.patch new file mode 100644 index 0000000000..6b33275c26 --- /dev/null +++ b/srcpkgs/xbmc/patches/350_all_av_get_default_channel_layout.patch @@ -0,0 +1,42 @@ +commit e06404904c6cb08ba8cecd53b6b64e8d6509adb8 +Author: Alexis Ballier +Date: Sat Apr 14 14:30:07 2012 -0300 + + avutil: add av_get_default_channel_layout for later use. + +diff --git a/lib/DllAvUtil.h b/lib/DllAvUtil.h +index 0c8e8c5..ecf2c97 100644 +--- a/lib/DllAvUtil.h ++++ b/lib/DllAvUtil.h +@@ -102,6 +102,7 @@ public: + virtual AVDictionaryEntry *av_dict_get(AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags) = 0; + virtual int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags)=0; + virtual int av_samples_get_buffer_size (int *linesize, int nb_channels, int nb_samples, enum AVSampleFormat sample_fmt, int align) = 0; ++ virtual int64_t av_get_default_channel_layout(int nb_channels)=0; + }; + + #if defined (USE_EXTERNAL_FFMPEG) || (defined TARGET_DARWIN) +@@ -137,6 +138,7 @@ public: + virtual int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags) { return ::av_dict_set(pm, key, value, flags); } + virtual int av_samples_get_buffer_size (int *linesize, int nb_channels, int nb_samples, enum AVSampleFormat sample_fmt, int align) + { return ::av_samples_get_buffer_size(linesize, nb_channels, nb_samples, sample_fmt, align); } ++ virtual int64_t av_get_default_channel_layout(int nb_channels) { return ::av_get_default_channel_layout(nb_channels); } + + // DLL faking. + virtual bool ResolveExports() { return true; } +@@ -177,6 +179,7 @@ class DllAvUtilBase : public DllDynamic, DllAvUtilInterface + DEFINE_METHOD4(AVDictionaryEntry *, av_dict_get, (AVDictionary *p1, const char *p2, const AVDictionaryEntry *p3, int p4)) + DEFINE_METHOD4(int, av_dict_set, (AVDictionary **p1, const char *p2, const char *p3, int p4)); + DEFINE_METHOD5(int, av_samples_get_buffer_size, (int *p1, int p2, int p3, enum AVSampleFormat p4, int p5)) ++ DEFINE_METHOD1(int64_t, av_get_default_channel_layout, (int p1)) + + public: + BEGIN_METHOD_RESOLVE() +@@ -202,6 +205,7 @@ class DllAvUtilBase : public DllDynamic, DllAvUtilInterface + RESOLVE_METHOD(av_dict_get) + RESOLVE_METHOD(av_dict_set) + RESOLVE_METHOD(av_samples_get_buffer_size) ++ RESOLVE_METHOD(av_get_default_channel_layout) + END_METHOD_RESOLVE() + }; + diff --git a/srcpkgs/xbmc/patches/360_all_av_get_default_channel_layout.patch b/srcpkgs/xbmc/patches/360_all_av_get_default_channel_layout.patch new file mode 100644 index 0000000000..d571eec504 --- /dev/null +++ b/srcpkgs/xbmc/patches/360_all_av_get_default_channel_layout.patch @@ -0,0 +1,34 @@ +commit 2dd610e26fa69ea2d57a2227448a6713b75efbbf +Author: Alexis Ballier +Date: Sat Apr 14 14:31:49 2012 -0300 + + Use libavutil::av_get_default_channel_layout instead of the private libavcodec::avcodec_guess_channel_layout + + The latter has been removed in ffmpeg git master. + +diff --git a/xbmc/cdrip/EncoderFFmpeg.cpp b/xbmc/cdrip/EncoderFFmpeg.cpp +index bcedb0c..23ba054 100644 +--- a/xbmc/cdrip/EncoderFFmpeg.cpp ++++ b/xbmc/cdrip/EncoderFFmpeg.cpp +@@ -106,7 +106,7 @@ bool CEncoderFFmpeg::Init(const char* strFile, int iInChannels, int iInRate, int + m_CodecCtx->bit_rate = m_Format->bit_rate; + m_CodecCtx->sample_rate = iInRate; + m_CodecCtx->channels = iInChannels; +- m_CodecCtx->channel_layout = m_dllAvCodec.avcodec_guess_channel_layout(iInChannels, codec->id, NULL); ++ m_CodecCtx->channel_layout = m_dllAvUtil.av_get_default_channel_layout(iInChannels); + m_CodecCtx->time_base = (AVRational){1, iInRate}; + + if(fmt->flags & AVFMT_GLOBALHEADER) +diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp +index 9a2b166..c55c392 100644 +--- a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp ++++ b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecFFmpeg.cpp +@@ -279,7 +279,7 @@ void CDVDAudioCodecFFmpeg::BuildChannelMap() + else + { + CLog::Log(LOGINFO, "CDVDAudioCodecFFmpeg::GetChannelMap - FFmpeg reported %d channels, but the layout contains %d ignoring", m_pCodecContext->channels, bits); +- layout = m_dllAvCodec.avcodec_guess_channel_layout(m_pCodecContext->channels, m_pCodecContext->codec_id, NULL); ++ layout = m_dllAvUtil.av_get_default_channel_layout(m_pCodecContext->channels); + } + + int index = 0; diff --git a/srcpkgs/xbmc/patches/370_all_avcodec_guess_channel_layout.patch b/srcpkgs/xbmc/patches/370_all_avcodec_guess_channel_layout.patch new file mode 100644 index 0000000000..b8321cf454 --- /dev/null +++ b/srcpkgs/xbmc/patches/370_all_avcodec_guess_channel_layout.patch @@ -0,0 +1,50 @@ +commit 47afab56db3f6f5e8b76f889a6873539b752e9c4 +Author: Alexis Ballier +Date: Sat Apr 14 14:32:38 2012 -0300 + + DllAvCodec: Remove now unused private avcodec_guess_channel_layout. + +diff --git a/lib/DllAvCodec.h b/lib/DllAvCodec.h +index 1ab00ea..9f3b16c 100644 +--- a/lib/DllAvCodec.h ++++ b/lib/DllAvCodec.h +@@ -60,7 +60,6 @@ extern "C" { + #endif + + /* From non-public audioconvert.h */ +- int64_t avcodec_guess_channel_layout(int nb_channels, enum CodecID codec_id, const char *fmt_name); + struct AVAudioConvert; + typedef struct AVAudioConvert AVAudioConvert; + AVAudioConvert *av_audio_convert_alloc(enum AVSampleFormat out_fmt, int out_channels, +@@ -125,7 +124,6 @@ public: + const void * const in[6], const int in_stride[6], int len)=0; + virtual int av_dup_packet(AVPacket *pkt)=0; + virtual void av_init_packet(AVPacket *pkt)=0; +- virtual int64_t avcodec_guess_channel_layout(int nb_channels, enum CodecID codec_id, const char *fmt_name)=0; + }; + + #if (defined USE_EXTERNAL_FFMPEG) || (defined TARGET_DARWIN) +@@ -205,7 +203,6 @@ public: + + virtual int av_dup_packet(AVPacket *pkt) { return ::av_dup_packet(pkt); } + virtual void av_init_packet(AVPacket *pkt) { return ::av_init_packet(pkt); } +- virtual int64_t avcodec_guess_channel_layout(int nb_channels, enum CodecID codec_id, const char *fmt_name) { return ::avcodec_guess_channel_layout(nb_channels, codec_id, fmt_name); } + + // DLL faking. + virtual bool ResolveExports() { return true; } +@@ -230,7 +227,6 @@ class DllAvCodec : public DllDynamic, DllAvCodecInterface + DEFINE_FUNC_ALIGNED9(int, __cdecl, av_parser_parse2, AVCodecParserContext*,AVCodecContext*, uint8_t**, int*, const uint8_t*, int, int64_t, int64_t, int64_t) + DEFINE_METHOD1(int, av_dup_packet, (AVPacket *p1)) + DEFINE_METHOD1(void, av_init_packet, (AVPacket *p1)) +- DEFINE_METHOD3(int64_t, avcodec_guess_channel_layout, (int p1, enum CodecID p2, const char *p3)) + + LOAD_SYMBOLS(); + +@@ -297,7 +293,6 @@ class DllAvCodec : public DllDynamic, DllAvCodecInterface + RESOLVE_METHOD(av_audio_convert) + RESOLVE_METHOD(av_dup_packet) + RESOLVE_METHOD(av_init_packet) +- RESOLVE_METHOD(avcodec_guess_channel_layout) + END_METHOD_RESOLVE() + + /* dependencies of libavcodec */ diff --git a/srcpkgs/xbmc/patches/series b/srcpkgs/xbmc/patches/series new file mode 100644 index 0000000000..6f72b6820d --- /dev/null +++ b/srcpkgs/xbmc/patches/series @@ -0,0 +1,37 @@ +010_all_ffmpeg-0.10.2-update.patch +020_all_thread_init.patch +030_all_av_open_input.patch +040_all_aviocontext.patch +050_all_avdict.patch +060_all_find_stram_info.patch +070_all_deprecated_functions.patch +080_all_drop_old.patch +090_all_interupt_cb.patch +100_all_url_fdopen.patch +110_all_av_write_header.patch +120_all_av_set_params.patch +130_all_av_metadata.patch +140_all_av_close.patch +150_all_init_put_byte.patch +160_all_dump_format.patch +170_all_url2avio.patch +180_all_alloc_put_byte.patch +190_all_avfilter_avformat.patch +200_all_avfilter_buffersink.patch +210_all_avfilter_avcodec.patch +220_all_avfilter_loop.patch +230_all_avfilter_poll_frame.patch +240_all_avfilter_request_frame.patch +250_all_avfilter_get_video_buffer.patch +260_all_av_buffersrc_add_frame.patch +270_all_is_streamed.patch +280_all_stream_copy.patch +290_all_age.patch +300_all_file_size.patch +310_all_av_read_frame_flush.patch +320_all_av_opt_set.patch +330_av_get_bytes_per_sample.patch +340_all_decode_audio4.patch +350_all_av_get_default_channel_layout.patch +360_all_av_get_default_channel_layout.patch +370_all_avcodec_guess_channel_layout.patch diff --git a/srcpkgs/xbmc/template b/srcpkgs/xbmc/template index 40017f30b3..b0e87b72ae 100644 --- a/srcpkgs/xbmc/template +++ b/srcpkgs/xbmc/template @@ -2,6 +2,7 @@ pkgname=xbmc version=11.0 revision=7 +patch_args="-Np1" build_style=gnu-configure configure_args="--disable-debug --enable-sdl --enable-vdpau --enable-vaapi --disable-crystalhd --disable-tegra --disable-nfs --disable-afpclient