|
|
@ -3,18 +3,40 @@ |
|
|
|
# This script parses arguments that were passed to ffmpeg-android-maker.sh |
|
|
|
# This script parses arguments that were passed to ffmpeg-android-maker.sh |
|
|
|
# and exports a bunch of varables that are used elsewhere. |
|
|
|
# and exports a bunch of varables that are used elsewhere. |
|
|
|
|
|
|
|
|
|
|
|
# Local variables with default values. Can be overridden with specific arguments |
|
|
|
# Local variables with default values (except ABIS_TO_BUILD). |
|
|
|
# See the end of this file for more description |
|
|
|
# Can be overridden with specific arguments. |
|
|
|
EXTERNAL_LIBRARIES=() |
|
|
|
# See the end of this file for more description. |
|
|
|
|
|
|
|
ABIS_TO_BUILD=() |
|
|
|
|
|
|
|
API_LEVEL=16 |
|
|
|
SOURCE_TYPE=TAR |
|
|
|
SOURCE_TYPE=TAR |
|
|
|
SOURCE_VALUE=4.2.2 |
|
|
|
SOURCE_VALUE=4.2.2 |
|
|
|
API_LEVEL=16 |
|
|
|
EXTERNAL_LIBRARIES=() |
|
|
|
|
|
|
|
|
|
|
|
for argument in "$@" |
|
|
|
for argument in "$@" |
|
|
|
do |
|
|
|
do |
|
|
|
case $argument in |
|
|
|
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. |
|
|
|
# Use this value as Android platform version during compilation. |
|
|
|
--android-api-level=*) |
|
|
|
--android-api-level=*|-android=*) |
|
|
|
API_LEVEL="${argument#*=}" |
|
|
|
API_LEVEL="${argument#*=}" |
|
|
|
shift |
|
|
|
shift |
|
|
|
;; |
|
|
|
;; |
|
|
@ -37,19 +59,19 @@ do |
|
|
|
shift |
|
|
|
shift |
|
|
|
;; |
|
|
|
;; |
|
|
|
# Arguments below enable certain external libraries to build into FFmpeg |
|
|
|
# Arguments below enable certain external libraries to build into FFmpeg |
|
|
|
--enable-libaom) |
|
|
|
--enable-libaom|-aom) |
|
|
|
EXTERNAL_LIBRARIES+=( "libaom" ) |
|
|
|
EXTERNAL_LIBRARIES+=( "libaom" ) |
|
|
|
shift |
|
|
|
shift |
|
|
|
;; |
|
|
|
;; |
|
|
|
--enable-libdav1d) |
|
|
|
--enable-libdav1d|-dav1d) |
|
|
|
EXTERNAL_LIBRARIES+=( "libdav1d" ) |
|
|
|
EXTERNAL_LIBRARIES+=( "libdav1d" ) |
|
|
|
shift |
|
|
|
shift |
|
|
|
;; |
|
|
|
;; |
|
|
|
--enable-libmp3lame) |
|
|
|
--enable-libmp3lame|-mp3lame) |
|
|
|
EXTERNAL_LIBRARIES+=( "libmp3lame" ) |
|
|
|
EXTERNAL_LIBRARIES+=( "libmp3lame" ) |
|
|
|
shift |
|
|
|
shift |
|
|
|
;; |
|
|
|
;; |
|
|
|
--enable-libopus) |
|
|
|
--enable-libopus|-opus) |
|
|
|
EXTERNAL_LIBRARIES+=( "libopus" ) |
|
|
|
EXTERNAL_LIBRARIES+=( "libopus" ) |
|
|
|
shift |
|
|
|
shift |
|
|
|
;; |
|
|
|
;; |
|
|
@ -59,11 +81,20 @@ do |
|
|
|
esac |
|
|
|
esac |
|
|
|
done |
|
|
|
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 |
|
|
|
# Saving the information FFmpeg's source code downloading |
|
|
|
export FFMPEG_SOURCE_TYPE=$SOURCE_TYPE |
|
|
|
export FFMPEG_SOURCE_TYPE=$SOURCE_TYPE |
|
|
|
export FFMPEG_SOURCE_VALUE=$SOURCE_VALUE |
|
|
|
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 |
|
|
|
# Elements from this list are used for strings substitution |
|
|
|
export FFMPEG_EXTERNAL_LIBRARIES=${EXTERNAL_LIBRARIES[@]} |
|
|
|
export FFMPEG_EXTERNAL_LIBRARIES=${EXTERNAL_LIBRARIES[@]} |
|
|
|
|
|
|
|
|
|
|
|