diff options
author | Memphiz <memphis@machzwo.de> | 2012-03-26 22:22:46 +0200 |
---|---|---|
committer | elupus <elupus@xbmc.org> | 2012-03-31 16:28:41 +0200 |
commit | 32016958723f5d58d7bfb36e18dd6c4b9307d4fd (patch) | |
tree | e4f371fed8c47539a5bb6c31d39a636c031fbd07 /lib | |
parent | 525834b388b3f0c7d2cece694b8893684a7715b7 (diff) |
[osx/ios/atv2] - build and link static libs for ffmpeg because of build issues on ios
Diffstat (limited to 'lib')
-rw-r--r-- | lib/DllAvCodec.h | 2 | ||||
-rw-r--r-- | lib/DllAvFilter.h | 2 | ||||
-rw-r--r-- | lib/DllAvFormat.h | 4 | ||||
-rw-r--r-- | lib/DllAvUtil.h | 3 | ||||
-rw-r--r-- | lib/DllPostProc.h | 2 | ||||
-rw-r--r-- | lib/DllSwResample.h | 2 | ||||
-rw-r--r-- | lib/DllSwScale.h | 2 | ||||
-rw-r--r-- | lib/Makefile.in | 105 |
8 files changed, 21 insertions, 101 deletions
diff --git a/lib/DllAvCodec.h b/lib/DllAvCodec.h index 9a4164a9f3..1ab00ea314 100644 --- a/lib/DllAvCodec.h +++ b/lib/DllAvCodec.h @@ -128,7 +128,7 @@ public: virtual int64_t avcodec_guess_channel_layout(int nb_channels, enum CodecID codec_id, const char *fmt_name)=0; }; -#if (defined USE_EXTERNAL_FFMPEG) +#if (defined USE_EXTERNAL_FFMPEG) || (defined TARGET_DARWIN) // Use direct layer class DllAvCodec : public DllDynamic, DllAvCodecInterface diff --git a/lib/DllAvFilter.h b/lib/DllAvFilter.h index a6ce6d0e02..45b96372c8 100644 --- a/lib/DllAvFilter.h +++ b/lib/DllAvFilter.h @@ -84,7 +84,7 @@ public: virtual int av_buffersink_poll_frame(AVFilterContext *ctx)=0; }; -#if (defined USE_EXTERNAL_FFMPEG) +#if (defined USE_EXTERNAL_FFMPEG) || (defined TARGET_DARWIN) // Use direct mapping class DllAvFilter : public DllDynamic, DllAvFilterInterface { diff --git a/lib/DllAvFormat.h b/lib/DllAvFormat.h index 725f5be06c..72b88664fd 100644 --- a/lib/DllAvFormat.h +++ b/lib/DllAvFormat.h @@ -69,7 +69,7 @@ public: virtual int av_read_play(AVFormatContext *s)=0; 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) +#if (!defined USE_EXTERNAL_FFMPEG) && (!defined TARGET_DARWIN) 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; @@ -100,7 +100,7 @@ public: virtual int av_write_frame (AVFormatContext *s, AVPacket *pkt)=0; }; -#if (defined USE_EXTERNAL_FFMPEG) +#if (defined USE_EXTERNAL_FFMPEG) || (defined TARGET_DARWIN) // Use direct mapping class DllAvFormat : public DllDynamic, DllAvFormatInterface diff --git a/lib/DllAvUtil.h b/lib/DllAvUtil.h index ad41a14add..0c8e8c5140 100644 --- a/lib/DllAvUtil.h +++ b/lib/DllAvUtil.h @@ -104,8 +104,7 @@ public: 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) - +#if defined (USE_EXTERNAL_FFMPEG) || (defined TARGET_DARWIN) // Use direct layer class DllAvUtilBase : public DllDynamic, DllAvUtilInterface { diff --git a/lib/DllPostProc.h b/lib/DllPostProc.h index b09a3f6d3d..5465601ce4 100644 --- a/lib/DllPostProc.h +++ b/lib/DllPostProc.h @@ -87,7 +87,7 @@ public: virtual void pp_free_context(pp_context *ppContext)=0; }; -#if (defined USE_EXTERNAL_FFMPEG) +#if (defined USE_EXTERNAL_FFMPEG) || (defined TARGET_DARWIN) // We call directly. class DllPostProc : public DllDynamic, DllPostProcInterface diff --git a/lib/DllSwResample.h b/lib/DllSwResample.h index a097387884..8a990720c3 100644 --- a/lib/DllSwResample.h +++ b/lib/DllSwResample.h @@ -43,7 +43,7 @@ extern "C" { } -#if (defined USE_EXTERNAL_FFMPEG) +#if (defined USE_EXTERNAL_FFMPEG) || (defined TARGET_DARWIN) // Use direct mapping class DllSwResample : public DllDynamic diff --git a/lib/DllSwScale.h b/lib/DllSwScale.h index 0cfb65455b..0fe8184b94 100644 --- a/lib/DllSwScale.h +++ b/lib/DllSwScale.h @@ -92,7 +92,7 @@ public: virtual void sws_freeContext(struct SwsContext *context)=0; }; -#if (defined USE_EXTERNAL_FFMPEG) +#if (defined USE_EXTERNAL_FFMPEG) || (defined TARGET_DARWIN) // We call into this library directly. class DllSwScale : public DllDynamic, public DllSwScaleInterface diff --git a/lib/Makefile.in b/lib/Makefile.in index 6b3da12dd5..2ea47fbf7d 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -1,21 +1,10 @@ ARCH=@ARCH@ +AR=@AR@ LD=@LD@ CC=@CC@ CXX=@CXX@ -SHELL=@SHELL@ -ifeq ($(findstring osx,$(ARCH)),osx) -ifeq ($(findstring arm,$(ARCH)),arm) -LDFLAGS=-arch armv7 -iphoneos_version_min 4.1 -bundle -undefined dynamic_lookup -read_only_relocs suppress -else -LDFLAGS=-bundle -undefined dynamic_lookup -read_only_relocs suppress -endif -else -LDFLAGS=-shared -fPIC -rdynamic -endif 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 @@ -41,102 +30,31 @@ ifneq (@USE_EXTERNAL_FFMPEG@,1) $(SWRESAMPLE_SO) endif -ifneq (,$(findstring powerpc,$(ARCH))) - ARCH_DIR=ppc -else -ifeq ($(findstring arm,$(ARCH)),arm) - ARCH_DIR=arm -else - ARCH_DIR=x86 -endif -endif - .PHONY: $(DIRS) codecs -codecs: $(addprefix $(SYSDIR)/, $(LIBS)); - - -ifeq ($(findstring osx,$(ARCH)), osx) -# Add -lbundle1.o for powerpc-osx -ifeq ($(ARCH), powerpc-osx) -BUNDLE1_O = -lbundle1.o -endif - -$(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_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)/$(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_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_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_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_SO): $(WRAPPER) ffmpeg/libswscale/libswscale.dylib - $(LD) $(LDFLAGS) -alias_list $(WRAPPER_MACH_ALIAS) -o $@ \ - $(WRAPPER) ffmpeg/libswscale/*.o -endif - -$(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/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 $@ +ifneq ($(findstring osx,$(ARCH)), osx) -else +codecs: $(addprefix $(SYSDIR)/, $(LIBS)); $(SYSDIR)/$(AVUTIL_SO): ffmpeg/libavutil/libavutil.so cp ffmpeg/libavutil/libavutil.so $@ -$(SYSDIR)/$(AVCODEC_SO): $(WRAPPER) ffmpeg/libavcodec/libavcodec.so +$(SYSDIR)/$(AVCODEC_SO): ffmpeg/libavcodec/libavcodec.so cp ffmpeg/libavcodec/libavcodec.so $@ -$(SYSDIR)/$(AVFORMAT_SO): $(WRAPPER) ffmpeg/libavformat/libavformat.so +$(SYSDIR)/$(AVFORMAT_SO): ffmpeg/libavformat/libavformat.so cp ffmpeg/libavformat/libavformat.so $@ -$(SYSDIR)/$(AVFILTER_SO): $(WRAPPER) ffmpeg/libavfilter/libavfilter.so +$(SYSDIR)/$(AVFILTER_SO): ffmpeg/libavfilter/libavfilter.so cp ffmpeg/libavfilter/libavfilter.so $@ -$(SYSDIR)/$(SWSCALE_SO): $(WRAPPER) ffmpeg/libswscale/libswscale.so +$(SYSDIR)/$(SWSCALE_SO): ffmpeg/libswscale/libswscale.so cp ffmpeg/libswscale/libswscale.so $@ -$(SYSDIR)/$(POSTPROC_SO): $(WRAPPER) ffmpeg/libpostproc/libpostproc.so +$(SYSDIR)/$(POSTPROC_SO): ffmpeg/libpostproc/libpostproc.so cp ffmpeg/libpostproc/libpostproc.so $@ -$(SYSDIR)/$(SWRESAMPLE_SO): $(WRAPPER) ffmpeg/libswresample/libswresample.so +$(SYSDIR)/$(SWRESAMPLE_SO): ffmpeg/libswresample/libswresample.so cp ffmpeg/libswresample/libswresample.so $@ ffmpeg/libavutil/libavutil.so : ffmpeg; @@ -146,9 +64,12 @@ ffmpeg/libavfilter/libavfilter.so : ffmpeg; ffmpeg/libswscale/libswscale.so : ffmpeg; ffmpeg/libpostproc/libpostproc.so : ffmpeg; ffmpeg/libswresample/libswresample.so : ffmpeg; +endif + ffmpeg: $(MAKE) -C $@ - +ifeq ($(findstring osx,$(ARCH)), osx) + $(AR) d ffmpeg/libavcodec/libavcodec.a inverse.o endif clean: |