android-vlc 精簡

來源:互聯網
上載者:User

 

首先精簡ffmpeg rules.mak

改為:

[plain]  # FFmpeg 
 
HASH=HEAD 
 
#FFMPEG_SNAPURL := http://git.videolan.org/?p=ffmpeg.git;a=snapshot;h=$(HASH);sf=tgz 
FFMPEG_SNAPURL := http://git.libav.org/?p=libav.git;a=snapshot;h=$(HASH);sf=tgz 
 
FFMPEGCONF = \ 
    --cc="$(CC)" \ 
    --disable-doc \ 
    --enable-libgsm \ 
    --enable-libopenjpeg \ 
    --disable-debug \ 
    --disable-avdevice \ 
    --disable-devices \ 
    --disable-avfilter \ 
    --disable-filters \ 
    --disable-bsfs \ 
    --disable-bzlib 
 
# Those tools are named differently in FFmpeg and Libav 
#   --disable-ffserver \ 
#   --disable-ffplay \ 
#   --disable-ffprobe 
DEPS_ffmpeg = zlib gsm openjpeg 
 
# Optional dependencies 
ifdef BUILD_ENCODERS 
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 --enable-encoder=png    
FFMPEGCONF += --disable-decoders --enable-decoder=h264  
FFMPEGCONF += --disable-muxers 
FFMPEGCONF += --disable-demuxers --enable-demuxer=rtp --enable-demuxer=rtsp 
FFMPEGCONF += --disable-protocols --enable-protocol=rtp --enable-protocol=rtsp 
FFMPEGCONF += --disable-parsers --enable-parser=h264 --enable-parser=mpeg4video  
endif 
 
# Small size 
ifdef ENABLE_SMALL 
FFMPEGCONF += --enable-small 
ifeq ($(ARCH),arm) 
ifdef HAVE_ARMV7A 
FFMPEGCONF += --enable-thumb 
endif 
endif 
endif 
 
ifdef HAVE_CROSS_COMPILE 
FFMPEGCONF += --enable-cross-compile 
ifndef HAVE_IOS 
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 
endif 
 
# MIPS stuff 
ifeq ($(ARCH),mipsel) 
FFMPEGCONF += --arch=mips 
endif 
 
# x86 stuff 
ifeq ($(ARCH),i386) 
ifndef HAVE_DARWIN_OS 
FFMPEGCONF += --arch=x86 
endif 
endif 
 
# Darwin 
ifdef HAVE_DARWIN_OS 
FFMPEGCONF += --arch=$(ARCH) --target-os=darwin 
ifneq ($(findstring $(ARCH),i386 x86_64),) 
FFMPEGCONF += --enable-memalign-hack 
endif 
ifeq ($(ARCH),x86_64) 
FFMPEGCONF += --cpu=core2 
endif 
endif 
ifdef HAVE_IOS 
ifeq ($(ARCH),arm) 
FFMPEGCONF += --enable-pic --as="$(AS)" 
endif 
endif 
 
# Linux 
ifdef HAVE_LINUX 
FFMPEGCONF += --target-os=linux --enable-pic 
 
endif 
 
# Windows 
ifdef HAVE_WIN32 
ifndef HAVE_MINGW_W64 
DEPS_ffmpeg += directx 
endif 
FFMPEGCONF += --target-os=mingw32 --enable-memalign-hack 
FFMPEGCONF += --enable-w32threads --enable-dxva2 \ 
    --disable-decoder=dca 
 
ifdef HAVE_WIN64 
FFMPEGCONF += --cpu=athlon64 --arch=x86_64 
else # !WIN64 
FFMPEGCONF+= --cpu=i686 --arch=x86 
endif 
 
else # !Windows 
FFMPEGCONF += --enable-pthreads 
endif 
 
# Build 
PKGS += ffmpeg 
ifeq ($(call need_pkg,"libavcodec >= 52.25.0 libavformat >= 52.30.0 libswscale"),) 
PKGS_FOUND += ffmpeg 
endif 
 
$(TARBALLS)/ffmpeg-$(HASH).tar.gz: 
    $(call download,$(FFMPEG_SNAPURL)) 
 
.sum-ffmpeg: $(TARBALLS)/ffmpeg-$(HASH).tar.gz 
    $(warning Not implemented.) 
    touch $@ 
 
ffmpeg: ffmpeg-$(HASH).tar.gz .sum-ffmpeg 
    rm -Rf $@ $@-$(HASH) 
    mkdir -p $@-$(HASH) 
    $(ZCAT) "$<" | (cd $@-$(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 $@ 

# FFmpeg

HASH=HEAD

#FFMPEG_SNAPURL := http://git.videolan.org/?p=ffmpeg.git;a=snapshot;h=$(HASH);sf=tgz
FFMPEG_SNAPURL := http://git.libav.org/?p=libav.git;a=snapshot;h=$(HASH);sf=tgz

FFMPEGCONF = \
 --cc="$(CC)" \
 --disable-doc \
 --enable-libgsm \
 --enable-libopenjpeg \
 --disable-debug \
 --disable-avdevice \
 --disable-devices \
 --disable-avfilter \
 --disable-filters \
 --disable-bsfs \
 --disable-bzlib

# Those tools are named differently in FFmpeg and Libav
# --disable-ffserver \
# --disable-ffplay \
# --disable-ffprobe
DEPS_ffmpeg = zlib gsm openjpeg

# Optional dependencies
ifdef BUILD_ENCODERS
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 --enable-encoder=png 
FFMPEGCONF += --disable-decoders --enable-decoder=h264
FFMPEGCONF += --disable-muxers
FFMPEGCONF += --disable-demuxers --enable-demuxer=rtp --enable-demuxer=rtsp
FFMPEGCONF += --disable-protocols --enable-protocol=rtp --enable-protocol=rtsp
FFMPEGCONF += --disable-parsers --enable-parser=h264 --enable-parser=mpeg4video
endif

# Small size
ifdef ENABLE_SMALL
FFMPEGCONF += --enable-small
ifeq ($(ARCH),arm)
ifdef HAVE_ARMV7A
FFMPEGCONF += --enable-thumb
endif
endif
endif

ifdef HAVE_CROSS_COMPILE
FFMPEGCONF += --enable-cross-compile
ifndef HAVE_IOS
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
endif

# MIPS stuff
ifeq ($(ARCH),mipsel)
FFMPEGCONF += --arch=mips
endif

# x86 stuff
ifeq ($(ARCH),i386)
ifndef HAVE_DARWIN_OS
FFMPEGCONF += --arch=x86
endif
endif

# Darwin
ifdef HAVE_DARWIN_OS
FFMPEGCONF += --arch=$(ARCH) --target-os=darwin
ifneq ($(findstring $(ARCH),i386 x86_64),)
FFMPEGCONF += --enable-memalign-hack
endif
ifeq ($(ARCH),x86_64)
FFMPEGCONF += --cpu=core2
endif
endif
ifdef HAVE_IOS
ifeq ($(ARCH),arm)
FFMPEGCONF += --enable-pic --as="$(AS)"
endif
endif

# Linux
ifdef HAVE_LINUX
FFMPEGCONF += --target-os=linux --enable-pic

endif

# Windows
ifdef HAVE_WIN32
ifndef HAVE_MINGW_W64
DEPS_ffmpeg += directx
endif
FFMPEGCONF += --target-os=mingw32 --enable-memalign-hack
FFMPEGCONF += --enable-w32threads --enable-dxva2 \
 --disable-decoder=dca

ifdef HAVE_WIN64
FFMPEGCONF += --cpu=athlon64 --arch=x86_64
else # !WIN64
FFMPEGCONF+= --cpu=i686 --arch=x86
endif

else # !Windows
FFMPEGCONF += --enable-pthreads
endif

# Build
PKGS += ffmpeg
ifeq ($(call need_pkg,"libavcodec >= 52.25.0 libavformat >= 52.30.0 libswscale"),)
PKGS_FOUND += ffmpeg
endif

$(TARBALLS)/ffmpeg-$(HASH).tar.gz:
 $(call download,$(FFMPEG_SNAPURL))

.sum-ffmpeg: $(TARBALLS)/ffmpeg-$(HASH).tar.gz
 $(warning Not implemented.)
 touch $@

ffmpeg: ffmpeg-$(HASH).tar.gz .sum-ffmpeg
 rm -Rf $@ $@-$(HASH)
 mkdir -p $@-$(HASH)
 $(ZCAT) "$<" | (cd $@-$(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 $@

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.