Commit 88216f12 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

contribs: Import VLC"s ffmpeg/libav rules

This is a temporary dependency until we have a functionnal VLC
producer/consumer for MLT
parent f9c4e682
# FFmpeg
#Uncomment the one you want
#USE_LIBAV ?= 1
#USE_FFMPEG ?= 1
ifdef USE_FFMPEG
FFMPEG_HASH=HEAD
FFMPEG_SNAPURL := http://git.videolan.org/?p=ffmpeg.git;a=snapshot;h=$(FFMPEG_HASH);sf=tgz
FFMPEG_GITURL := git://git.videolan.org/ffmpeg.git
else
FFMPEG_HASH=HEAD
FFMPEG_SNAPURL := http://git.libav.org/?p=libav.git;a=snapshot;h=$(FFMPEG_HASH);sf=tgz
FFMPEG_GITURL := git://git.libav.org/libav.git
endif
FFMPEGCONF = \
--cc="$(CC)" \
--pkg-config="$(PKG_CONFIG)" \
--disable-doc \
--disable-encoder=vorbis \
--disable-decoder=opus \
--disable-debug \
--disable-avdevice \
--disable-devices \
--disable-avfilter \
--disable-filters \
--disable-protocol=concat \
--disable-bsfs \
--disable-bzlib \
--disable-avresample
ifdef USE_FFMPEG
FFMPEGCONF += \
--disable-swresample \
--disable-iconv
ifdef HAVE_DARWIN_OS
FFMPEGCONF += \
--disable-videotoolbox
endif
endif
DEPS_ffmpeg =
# Optional dependencies
FFMPEGCONF += --disable-network
FFMPEGCONF += --disable-encoders --disable-muxers
# Small size
ifdef WITH_OPTIMIZATION
ifdef ENABLE_SMALL
FFMPEGCONF += --enable-small
endif
ifeq ($(ARCH),arm)
ifdef HAVE_ARMV7A
FFMPEGCONF += --enable-thumb
endif
endif
else
FFMPEGCONF += --optflags=-O0
endif
ifdef HAVE_CROSS_COMPILE
FFMPEGCONF += --enable-cross-compile --disable-programs
ifndef HAVE_DARWIN_OS
FFMPEGCONF += --cross-prefix=$(HOST)-
endif
endif
# ARM stuff
ifeq ($(ARCH),arm)
FFMPEGCONF += --arch=arm
ifdef HAVE_NEON
FFMPEGCONF += --enable-neon
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
ifeq ($(ARCH),mipsel)
FFMPEGCONF += --arch=mips
endif
# x86 stuff
ifeq ($(ARCH),i386)
ifndef HAVE_DARWIN_OS
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
ifdef USE_FFMPEG
FFMPEGCONF += --disable-lzma
endif
ifeq ($(ARCH),x86_64)
FFMPEGCONF += --cpu=core2
endif
ifdef HAVE_IOS
FFMPEGCONF += --enable-pic --extra-ldflags="$(EXTRA_CFLAGS)"
ifdef HAVE_NEON
FFMPEGCONF += --as="$(AS)"
endif
endif
ifdef HAVE_MACOSX
FFMPEGCONF += --enable-vda
endif
endif
# Linux
ifdef HAVE_LINUX
FFMPEGCONF += --target-os=linux --enable-pic
endif
ifdef HAVE_ANDROID
ifeq ($(ANDROID_ABI), x86)
FFMPEGCONF += --disable-mmx --disable-mmxext
endif
endif
# Windows
ifdef HAVE_WIN32
FFMPEGCONF += --target-os=mingw32 --enable-memalign-hack
FFMPEGCONF += --enable-w32threads --disable-dxva2
ifdef HAVE_WIN64
FFMPEGCONF += --cpu=athlon64 --arch=x86_64
else
ifeq ($(ARCH),i386) # 32bits intel
FFMPEGCONF+= --cpu=i686 --arch=x86
else
ifdef HAVE_ARMV7A
FFMPEGCONF+= --arch=arm
endif
endif
endif
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 >= 55.0.0 libavformat >= 53.21.0 libswscale"),)
PKGS_FOUND += ffmpeg
endif
FFMPEGCONF += --nm="$(NM)" --ar="$(AR)"
$(TARBALLS)/ffmpeg-$(FFMPEG_HASH).tar.xz:
$(call download_git,$(FFMPEG_GITURL),,$(FFMPEG_HASH))
.sum-ffmpeg: $(TARBALLS)/ffmpeg-$(FFMPEG_HASH).tar.xz
$(warning Not implemented.)
touch $@
ffmpeg: ffmpeg-$(FFMPEG_HASH).tar.xz .sum-ffmpeg
rm -Rf $@ $@-$(FFMPEG_HASH)
mkdir -p $@-$(FFMPEG_HASH)
$(XZCAT) "$<" | (cd $@-$(FFMPEG_HASH) && tar xv --strip-components=1)
$(MOVE)
.ffmpeg: ffmpeg
cd $< && $(HOSTVARS) ./configure \
--extra-ldflags="$(LDFLAGS)" $(FFMPEGCONF) \
--prefix="$(PREFIX)" --enable-static --disable-shared
cd $< && $(MAKE) install-libs install-headers
touch $@
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment