From ccc5e472b0a4c0e07cbf5760b017b9dd720e5d80 Mon Sep 17 00:00:00 2001 From: vigneshv Date: Wed, 15 Mar 2017 10:28:49 -0700 Subject: [PATCH] extensions/vp9: Fix open source build scripts Fixes github issue #2339 [https://github.com/google/ExoPlayer/issues/2339] Fixes github issue #2551 [https://github.com/google/ExoPlayer/issues/2551] * Update the instructions to check out specific versions of libvpx and libyuv that are known to work with our build scripts. * Forcing a particular version of libyuv because recent versions of libyuv are dependent on libjpeg (which isn't needed for the purpose of this extension). * Going forward, let's keep generate_libvpx_android_configs.sh in sync with whatever version is specifed in the instructions in README.md (as of now it is v1.6.1). ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=150208517 --- extensions/vp9/README.md | 16 +++++++++++++++- .../main/jni/generate_libvpx_android_configs.sh | 12 ++++++++---- extensions/vp9/src/main/jni/libvpx.mk | 10 ++++++++-- 3 files changed, 31 insertions(+), 7 deletions(-) diff --git a/extensions/vp9/README.md b/extensions/vp9/README.md index 97c6b46280..90ded8fdc0 100644 --- a/extensions/vp9/README.md +++ b/extensions/vp9/README.md @@ -40,6 +40,18 @@ git clone https://chromium.googlesource.com/webm/libvpx libvpx && \ git clone https://chromium.googlesource.com/libyuv/libyuv libyuv ``` +* Checkout the appropriate branches of libvpx and libyuv (the scripts and + makefiles bundled in this repo are known to work only at these versions of the + libraries - we will update this periodically as newer versions of + libvpx/libyuv are released): + +``` +cd "${VP9_EXT_PATH}/jni/libvpx" && \ +git checkout tags/v1.6.1 -b v1.6.1 && \ +cd "${VP9_EXT_PATH}/jni/libyuv" && \ +git checkout e2611a73 +``` + * Run a script that generates necessary configuration files for libvpx: ``` @@ -79,5 +91,7 @@ dependencies { `generate_libvpx_android_configs.sh` * Clean and re-build the project. * If you want to use your own version of libvpx or libyuv, place it in - `${VP9_EXT_PATH}/jni/libvpx` or `${VP9_EXT_PATH}/jni/libyuv` respectively. + `${VP9_EXT_PATH}/jni/libvpx` or `${VP9_EXT_PATH}/jni/libyuv` respectively. But + please note that `generate_libvpx_android_configs.sh` and the makefiles need + to be modified to work with arbitrary versions of libvpx and libyuv. diff --git a/extensions/vp9/src/main/jni/generate_libvpx_android_configs.sh b/extensions/vp9/src/main/jni/generate_libvpx_android_configs.sh index f0fb2761db..566396e0bf 100755 --- a/extensions/vp9/src/main/jni/generate_libvpx_android_configs.sh +++ b/extensions/vp9/src/main/jni/generate_libvpx_android_configs.sh @@ -40,7 +40,7 @@ config[0]+=" --enable-neon-asm" arch[1]="armeabi" config[1]="--target=armv7-android-gcc --sdk-path=$ndk --disable-neon" -config[1]+=" --disable-neon-asm --disable-media" +config[1]+=" --disable-neon-asm" arch[2]="mips" config[2]="--force-target=mips32-android-gcc --sdk-path=$ndk" @@ -78,12 +78,12 @@ convert_asm() { for i in $(seq 0 ${limit}); do while read file; do case "${file}" in - *.asm.s) + *.asm.[sS]) # Some files may already have been processed (there are duplicated # .asm.s files for vp8 in the armeabi/armeabi-v7a configurations). file="libvpx/${file}" if [[ ! -e "${file}" ]]; then - asm_file="${file%.s}" + asm_file="${file%.[sS]}" cat "${asm_file}" | libvpx/build/make/ads2gas.pl > "${file}" remove_trailing_whitespace "${file}" rm "${asm_file}" @@ -105,7 +105,11 @@ for i in $(seq 0 ${limit}); do echo "configure ${config[${i}]} ${common_params}" ../../libvpx/configure ${config[${i}]} ${common_params} rm -f libvpx_srcs.txt - make libvpx_srcs.txt + for f in ${allowed_files}; do + # the build system supports multiple different configurations. avoid + # failing out when, for example, vp8_rtcd.h is not part of a configuration + make "${f}" || true + done # remove files that aren't needed rm -rf !(${allowed_files// /|}) diff --git a/extensions/vp9/src/main/jni/libvpx.mk b/extensions/vp9/src/main/jni/libvpx.mk index 6cc706ffa8..887de56218 100644 --- a/extensions/vp9/src/main/jni/libvpx.mk +++ b/extensions/vp9/src/main/jni/libvpx.mk @@ -35,16 +35,22 @@ LOCAL_SRC_FILES += $(addprefix libvpx/, $(filter-out vpx_config.c, \ $(filter %.c, $(libvpx_codec_srcs)))) # include assembly files if they exist -# "%.asm.s" covers neon assembly and "%.asm" covers x86 assembly +# "%.asm.[sS]" covers neon assembly and "%.asm" covers x86 assembly LOCAL_SRC_FILES += $(addprefix libvpx/, \ $(filter %.asm.s %.asm, $(libvpx_codec_srcs))) +LOCAL_SRC_FILES += $(addprefix libvpx/, \ + $(filter %.asm.S %.asm, $(libvpx_codec_srcs))) ifneq ($(findstring armeabi-v7a, $(TARGET_ARCH_ABI)),) -# append .neon to *_neon.c and *.s +# append .neon to *_neon.c and *.[sS] LOCAL_SRC_FILES := $(subst _neon.c,_neon.c.neon,$(LOCAL_SRC_FILES)) LOCAL_SRC_FILES := $(subst .s,.s.neon,$(LOCAL_SRC_FILES)) +LOCAL_SRC_FILES := $(subst .S,.S.neon,$(LOCAL_SRC_FILES)) endif +# remove duplicates +LOCAL_SRC_FILES := $(sort $(LOCAL_SRC_FILES)) + LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/libvpx \ $(LOCAL_PATH)/libvpx/vpx