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;