# FFmpeg
-HASH=HEAD
+#Uncomment the one you want
+#USE_LIBAV ?= 1
+#USE_FFMPEG ?= 1
-#FFMPEG_SNAPURL := http://git.videolan.org/?p=ffmpeg.git;a=snapshot;h=$(HASH);sf=tgz
+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 \
--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
# 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
ifdef HAVE_ARMV7A
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
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
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
+FFMPEGCONF += --nm="$(NM)" --ar="$(AR)"
+
$(TARBALLS)/ffmpeg-$(HASH).tar.gz:
$(call download,$(FFMPEG_SNAPURL))
ffmpeg: ffmpeg-$(HASH).tar.gz .sum-ffmpeg
rm -Rf $@ $@-$(HASH)
mkdir -p $@-$(HASH)
- $(ZCAT) "$<" | (cd $@-$(HASH) && tar xv --strip-components=1)
+ $(XZCAT) "$<" | (cd $@-$(HASH) && tar xv --strip-components=1)
$(MOVE)
.ffmpeg: ffmpeg