From 9f925950a2dad64c565f74b8106ab06044af0bb4 Mon Sep 17 00:00:00 2001 From: Javernaut Date: Sun, 19 Apr 2020 15:37:20 +0300 Subject: [PATCH 1/5] Typo fix --- scripts/parse-arguments.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/parse-arguments.sh b/scripts/parse-arguments.sh index bf89b6f..f0dca8b 100755 --- a/scripts/parse-arguments.sh +++ b/scripts/parse-arguments.sh @@ -10,30 +10,30 @@ SOURCE_TYPE=TAR SOURCE_VALUE=4.2.2 API_LEVEL=16 -for artument in "$@" +for argument in "$@" do - case $artument in + case $argument in # Use this value as Android platform version during compilation. --android-api-level=*) - API_LEVEL="${artument#*=}" + API_LEVEL="${argument#*=}" shift ;; # Checkout the particular tag in the FFmpeg's git repository --source-git-tag=*) SOURCE_TYPE=GIT_TAG - SOURCE_VALUE="${artument#*=}" + SOURCE_VALUE="${argument#*=}" shift ;; # Checkout the particular branch in the FFmpeg's git repository --source-git-branch=*) SOURCE_TYPE=GIT_BRANCH - SOURCE_VALUE="${artument#*=}" + SOURCE_VALUE="${argument#*=}" shift ;; # Download the particular tar archive by its version --source-tar=*) SOURCE_TYPE=TAR - SOURCE_VALUE="${artument#*=}" + SOURCE_VALUE="${argument#*=}" shift ;; # Arguments below enable certain external libraries to build into FFmpeg @@ -50,7 +50,7 @@ do shift ;; *) - echo "Unknown argument $artument" + echo "Unknown argument $argument" ;; esac done From 226a46215912c0103a1be4d70f5c49e0bde29724 Mon Sep 17 00:00:00 2001 From: Javernaut Date: Sun, 19 Apr 2020 15:47:57 +0300 Subject: [PATCH 2/5] Shorter aruments support --- scripts/parse-arguments.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/parse-arguments.sh b/scripts/parse-arguments.sh index f0dca8b..acc3e4d 100755 --- a/scripts/parse-arguments.sh +++ b/scripts/parse-arguments.sh @@ -14,7 +14,7 @@ for argument in "$@" do case $argument in # Use this value as Android platform version during compilation. - --android-api-level=*) + --android-api-level=*|-android=*) API_LEVEL="${argument#*=}" shift ;; @@ -37,15 +37,15 @@ do shift ;; # Arguments below enable certain external libraries to build into FFmpeg - --enable-libaom) + --enable-libaom|-aom) EXTERNAL_LIBRARIES+=( "libaom" ) shift ;; - --enable-libdav1d) + --enable-libdav1d|-dav1d) EXTERNAL_LIBRARIES+=( "libdav1d" ) shift ;; - --enable-libmp3lame) + --enable-libmp3lame|-mp3lame) EXTERNAL_LIBRARIES+=( "libmp3lame" ) shift ;; From 22e16fdfcbb85b89ab0a8abbf16e37568ebde619 Mon Sep 17 00:00:00 2001 From: Javernaut Date: Sun, 19 Apr 2020 17:19:40 +0300 Subject: [PATCH 3/5] Passing desired ABIs as an argument --- ffmpeg-android-maker.sh | 8 ++------ scripts/parse-arguments.sh | 41 +++++++++++++++++++++++++++++++++----- 2 files changed, 38 insertions(+), 11 deletions(-) diff --git a/ffmpeg-android-maker.sh b/ffmpeg-android-maker.sh index 8cba281..ad7f947 100755 --- a/ffmpeg-android-maker.sh +++ b/ffmpeg-android-maker.sh @@ -97,12 +97,8 @@ do cd ${BASE_DIR} done -# ABIs to build FFmpeg for. -# x86 is the first, because it is likely to have Text Relocations. -# In this case the rest ABIs will not be assembled at all. -ABIS_TO_BUILD=( "x86" "x86_64" "armeabi-v7a" "arm64-v8a" ) - -for ABI in ${ABIS_TO_BUILD[@]} +# Main build loop +for ABI in ${FFMPEG_ABIS_TO_BUILD[@]} do # Exporting variables for the current ABI source ${SCRIPTS_DIR}/export-build-variables.sh ${ABI} diff --git a/scripts/parse-arguments.sh b/scripts/parse-arguments.sh index acc3e4d..20be61d 100755 --- a/scripts/parse-arguments.sh +++ b/scripts/parse-arguments.sh @@ -3,16 +3,38 @@ # This script parses arguments that were passed to ffmpeg-android-maker.sh # and exports a bunch of varables that are used elsewhere. -# Local variables with default values. Can be overridden with specific arguments -# See the end of this file for more description -EXTERNAL_LIBRARIES=() +# Local variables with default values (except ABIS_TO_BUILD). +# Can be overridden with specific arguments. +# See the end of this file for more description. +ABIS_TO_BUILD=() +API_LEVEL=16 SOURCE_TYPE=TAR SOURCE_VALUE=4.2.2 -API_LEVEL=16 +EXTERNAL_LIBRARIES=() for argument in "$@" do case $argument in + # Build for only specified ABIs (separated by comma) + --target-abis=*|-abis=*) + IFS=',' read -ra ABIS <<< "${argument#*=}" + for abi in "${ABIS[@]}"; do + case $abi in + x86|x86_64|armeabi-v7a|arm64-v8a) + ABIS_TO_BUILD+=( "$abi" ) + ;; + arm) + ABIS_TO_BUILD+=( "armeabi-v7a" ) + ;; + arm64) + ABIS_TO_BUILD+=( "arm64-v8a" ) + ;; + *) + echo "Unknown ABI: $abi" + ;; + esac + done + ;; # Use this value as Android platform version during compilation. --android-api-level=*|-android=*) API_LEVEL="${argument#*=}" @@ -55,11 +77,20 @@ do esac done +# if ABIS_TO_BUILD list is empty, then fill it with all supported ABIs +# The x86 is the first, because it is more likely to have Text Relocations. +# In this case the rest ABIs will not be assembled at all. +if [ ${#ABIS_TO_BUILD[@]} -eq 0 ]; then + ABIS_TO_BUILD=( "x86" "x86_64" "armeabi-v7a" "arm64-v8a" ) +fi +# The FFmpeg will be build for ABIs in this list +export FFMPEG_ABIS_TO_BUILD=${ABIS_TO_BUILD[@]} + # Saving the information FFmpeg's source code downloading export FFMPEG_SOURCE_TYPE=$SOURCE_TYPE export FFMPEG_SOURCE_VALUE=$SOURCE_VALUE -# A list of external libraries to build into the FFMpeg +# A list of external libraries to build into the FFmpeg # Elements from this list are used for strings substitution export FFMPEG_EXTERNAL_LIBRARIES=${EXTERNAL_LIBRARIES[@]} From da8de48807940c2bf8e17195cc693eadba31602d Mon Sep 17 00:00:00 2001 From: Javernaut Date: Sun, 19 Apr 2020 17:21:07 +0300 Subject: [PATCH 4/5] Using shorter arguments in .travis.yml --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index cf6c930..d02af5e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,4 +17,4 @@ install: - curl http://archive.ubuntu.com/ubuntu/pool/universe/n/nasm/nasm_2.14.02-1_amd64.deb --output $HOME/nasm_2.14.02-1_amd64.deb - sudo dpkg -i $HOME/nasm_2.14.02-1_amd64.deb script: - - bash -e ffmpeg-android-maker.sh --enable-libdav1d --enable-libmp3lame --enable-libaom --android-api-level=18 + - bash -e ffmpeg-android-maker.sh -dav1d -mp3lame -aom -android=18 From 628f49f8a5fca89422a502ae0024b0e3629840ee Mon Sep 17 00:00:00 2001 From: Javernaut Date: Sun, 19 Apr 2020 17:47:19 +0300 Subject: [PATCH 5/5] Updating libaom to v1.0.0-errata1-avif --- scripts/libaom/android.cmake | 4 ++-- scripts/libaom/download.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/libaom/android.cmake b/scripts/libaom/android.cmake index 0ac7225..06fcbdb 100644 --- a/scripts/libaom/android.cmake +++ b/scripts/libaom/android.cmake @@ -10,8 +10,8 @@ include("$ENV{ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake") # AS_EXECUTABLE (AV1 Codec Library's variable) should point to an assembler # For x86 and x86_64 ABIs it needs yasm -# For armeabi-v7a and arm64-v8a is is ok to use GNU assembler -# When ANDROID_ABI is x86 or _86_64, +# For armeabi-v7a and arm64-v8a it is ok to use GNU assembler +# When ANDROID_ABI is x86 or x86_64, # then CMAKE_ASM_NASM_COMPILER variable will point to the yasm compiler (it is set by android.toolchain.cmake) if(DEFINED CMAKE_ASM_NASM_COMPILER) set(AS_EXECUTABLE ${CMAKE_ASM_NASM_COMPILER}) diff --git a/scripts/libaom/download.sh b/scripts/libaom/download.sh index 4229dea..6cbeabf 100755 --- a/scripts/libaom/download.sh +++ b/scripts/libaom/download.sh @@ -6,8 +6,8 @@ # This 2 variables have to be changed at once. # The first one is produced by 'git describe' command while being in the commit represented by the second one. -AOM_VERSION=v1.0.0-2780-ge1ec46ae2 -AOM_HASH=e1ec46ae24bb406057c3c256e69cd359b342a8d3 +AOM_VERSION=v1.0.0-errata1-avif +AOM_HASH=4eb1e7795b9700d532af38a2d9489458a8038233 echo "Using libaom $AOM_VERSION" AOM_SOURCES=libaom-${AOM_VERSION}