Fix the check for clang complier in FFmpeg build file

Also updated the `README` file to accurately specify the use of NDK r23c and the default setting `ANDROID_ABI=21` for NDK r26b.

PiperOrigin-RevId: 592845796
This commit is contained in:
rohks 2023-12-21 06:32:33 -08:00 committed by Copybara-Service
parent 0b88e09a82
commit 639d380762
2 changed files with 10 additions and 3 deletions

View File

@ -29,7 +29,8 @@ FFMPEG_MODULE_PATH="$(pwd)/libraries/decoder_ffmpeg/src/main"
```
* Download the [Android NDK][] and set its location in a shell variable. This
build configuration has been tested on NDK r26b (r23c if ANDROID_ABI is 16).
build configuration has been tested on NDK r26b (r23c if ANDROID_ABI is less
than 21).
```
NDK_PATH="<path to Android NDK>"
@ -45,7 +46,7 @@ HOST_PLATFORM="linux-x86_64"
not exceed it):
```
ANDROID_ABI=16
ANDROID_ABI=21
```
* Fetch FFmpeg and checkout an appropriate branch. We cannot guarantee

View File

@ -47,13 +47,19 @@ COMMON_OPTIONS="
--disable-vulkan
"
TOOLCHAIN_PREFIX="${NDK_PATH}/toolchains/llvm/prebuilt/${HOST_PLATFORM}/bin"
if [[ ! -d "${TOOLCHAIN_PREFIX}" ]]
then
echo "Please set correct NDK_PATH, $NDK_PATH is incorrect"
exit 1
fi
for decoder in "${ENABLED_DECODERS[@]}"
do
COMMON_OPTIONS="${COMMON_OPTIONS} --enable-decoder=${decoder}"
done
ARMV7_CLANG="${TOOLCHAIN_PREFIX}/armv7a-linux-androideabi${ANDROID_ABI}-clang"
if [[ -e "${TOOLCHAIN_PREFIX}" && ! -e "$ARMV7_CLANG" ]]
if [[ ! -e "$ARMV7_CLANG" ]]
then
echo "AVMv7 Clang compiler with path $ARMV7_CLANG does not exist"
echo "It's likely your NDK version doesn't support ANDROID_ABI $ANDROID_ABI"