]> git.sesse.net Git - vlc/blobdiff - contrib/src/ffmpeg/rules.mak
Contribs: use xzcat for tarballs
[vlc] / contrib / src / ffmpeg / rules.mak
index 1e179626b44f06f70715c1b935aa470e2e3de176..628f60695c6ace358686e3e167287ebdc7574ffc 100644 (file)
@@ -1,12 +1,21 @@
 # FFmpeg
 
-#FFMPEG_SNAPURL := http://git.videolan.org/?p=ffmpeg.git;a=snapshot;h=HEAD;sf=tgz
-FFMPEG_SNAPURL := http://git.libav.org/?p=libav.git;a=snapshot;h=HEAD;sf=tgz
+#Uncomment the one you want
+#USE_LIBAV ?= 1
+#USE_FFMPEG ?= 1
+
+ifdef USE_FFMPEG
+HASH=HEAD
+FFMPEG_SNAPURL := http://git.videolan.org/?p=ffmpeg.git;a=snapshot;h=$(HASH);sf=tgz
+else
+HASH=HEAD
+FFMPEG_SNAPURL := http://git.libav.org/?p=libav.git;a=snapshot;h=$(HASH);sf=tgz
+endif
 
 FFMPEGCONF = \
        --cc="$(CC)" \
+       --pkg-config="$(PKG_CONFIG)" \
        --disable-doc \
-       --disable-decoder=bink \
        --disable-encoder=vorbis \
        --enable-libgsm \
        --enable-libopenjpeg \
@@ -16,17 +25,23 @@ FFMPEGCONF = \
        --disable-avfilter \
        --disable-filters \
        --disable-bsfs \
-       --disable-bzlib
+       --disable-bzlib \
+       --disable-avresample
+
+ifdef USE_FFMPEG
+FFMPEGCONF += \
+       --disable-swresample \
+       --disable-iconv
+endif
 
-# Those tools are named differently in FFmpeg and Libav
-#      --disable-ffserver \
-#      --disable-ffplay \
-#      --disable-ffprobe
 DEPS_ffmpeg = zlib gsm openjpeg
 
 # Optional dependencies
+ifndef BUILD_NETWORK
+FFMPEGCONF += --disable-network
+endif
 ifdef BUILD_ENCODERS
-FFMPEGCONF += --enable-libmp3lame --enable-libvpx --disable-decoder=libvpx
+FFMPEGCONF += --enable-libmp3lame --enable-libvpx --disable-decoder=libvpx --disable-decoder=libvpx_vp8 --disable-decoder=libvpx_vp9
 DEPS_ffmpeg += lame $(DEPS_lame) vpx $(DEPS_vpx)
 else
 FFMPEGCONF += --disable-encoders --disable-muxers
@@ -35,16 +50,16 @@ endif
 # Small size
 ifdef ENABLE_SMALL
 FFMPEGCONF += --enable-small
+endif
 ifeq ($(ARCH),arm)
 ifdef HAVE_ARMV7A
 FFMPEGCONF += --enable-thumb
 endif
 endif
-endif
 
 ifdef HAVE_CROSS_COMPILE
-FFMPEGCONF += --enable-cross-compile
-ifndef HAVE_IOS
+FFMPEGCONF += --enable-cross-compile --disable-programs
+ifndef HAVE_DARWIN_OS
 FFMPEGCONF += --cross-prefix=$(HOST)-
 endif
 endif
@@ -52,11 +67,22 @@ endif
 # ARM stuff
 ifeq ($(ARCH),arm)
 FFMPEGCONF += --arch=arm
+ifdef HAVE_NEON
+FFMPEGCONF += --enable-neon
+endif
 ifdef HAVE_ARMV7A
-FFMPEGCONF += --cpu=cortex-a8 --enable-neon
+FFMPEGCONF += --cpu=cortex-a8
+endif
+ifdef HAVE_ARMV6
+FFMPEGCONF += --cpu=armv6 --disable-neon
 endif
 endif
 
+# ARM64 stuff
+ifeq ($(ARCH),aarch64)
+FFMPEGCONF += --arch=aarch64
+endif
+
 # MIPS stuff
 ifeq ($(ARCH),mipsel)
 FFMPEGCONF += --arch=mips
@@ -69,19 +95,30 @@ FFMPEGCONF += --arch=x86
 endif
 endif
 
+# x86_64 stuff
+ifeq ($(ARCH),x86_64)
+ifndef HAVE_DARWIN_OS
+FFMPEGCONF += --arch=x86_64
+endif
+endif
+
 # Darwin
 ifdef HAVE_DARWIN_OS
 FFMPEGCONF += --arch=$(ARCH) --target-os=darwin
-ifneq ($(findstring $(ARCH),i386 x86_64),)
-FFMPEGCONF += --enable-memalign-hack
+ifdef USE_FFMPEG
+FFMPEGCONF += --disable-lzma
 endif
 ifeq ($(ARCH),x86_64)
 FFMPEGCONF += --cpu=core2
 endif
-endif
 ifdef HAVE_IOS
-ifeq ($(ARCH),arm)
-FFMPEGCONF += --enable-pic --as="$(AS)"
+FFMPEGCONF += --enable-pic --extra-ldflags="$(EXTRA_CFLAGS)"
+ifdef HAVE_NEON
+FFMPEGCONF += --as="$(AS)"
+endif
+endif
+ifdef HAVE_MACOSX
+FFMPEGCONF += --enable-vda
 endif
 endif
 
@@ -110,25 +147,33 @@ else # !Windows
 FFMPEGCONF += --enable-pthreads
 endif
 
+# Solaris
+ifdef HAVE_SOLARIS
+ifeq ($(ARCH),x86_64)
+FFMPEGCONF += --cpu=core2
+endif
+FFMPEGCONF += --target-os=sunos --enable-pic
+endif
+
 # Build
 PKGS += ffmpeg
-ifeq ($(call need_pkg,"libavcodec >= 52.25.0 libavformat >= 52.30.0 libswscale"),)
+ifeq ($(call need_pkg,"libavcodec >= 54.25.0 libavformat >= 53.21.0 libswscale"),)
 PKGS_FOUND += ffmpeg
 endif
 
-$(TARBALLS)/ffmpeg-git.tar.gz:
-       $(call download,$(FFMPEG_SNAPURL))
+FFMPEGCONF += --nm="$(NM)" --ar="$(AR)"
 
-FFMPEG_VERSION := git
+$(TARBALLS)/ffmpeg-$(HASH).tar.gz:
+       $(call download,$(FFMPEG_SNAPURL))
 
-.sum-ffmpeg: $(TARBALLS)/ffmpeg-$(FFMPEG_VERSION).tar.gz
+.sum-ffmpeg: $(TARBALLS)/ffmpeg-$(HASH).tar.gz
        $(warning Not implemented.)
        touch $@
 
-ffmpeg: ffmpeg-$(FFMPEG_VERSION).tar.gz .sum-ffmpeg
-       rm -Rf $@ $@-git
-       mkdir -p $@-git
-       $(ZCAT) "$<" | (cd $@-git && tar xv --strip-components=1)
+ffmpeg: ffmpeg-$(HASH).tar.gz .sum-ffmpeg
+       rm -Rf $@ $@-$(HASH)
+       mkdir -p $@-$(HASH)
+       $(XZCAT) "$<" | (cd $@-$(HASH) && tar xv --strip-components=1)
        $(MOVE)
 
 .ffmpeg: ffmpeg