add ffmpeg option to android build script

(cherry picked from commit cdb7563cf7)
This commit is contained in:
Ely Ronnen 2021-12-04 20:33:10 +02:00 committed by akallabeth
parent 8cb12fb0ea
commit 84dd5910d8
3 changed files with 19 additions and 1 deletions

View File

@ -808,7 +808,6 @@ if(ANDROID)
set(PULSE_FEATURE_TYPE "DISABLED")
set(CUPS_FEATURE_TYPE "DISABLED")
set(PCSC_FEATURE_TYPE "DISABLED")
set(FFMPEG_FEATURE_TYPE "DISABLED")
set(VAAPI_FEATURE_TYPE "DISABLED")
set(OPENSLES_FEATURE_TYPE "REQUIRED")
endif()

View File

@ -7,6 +7,7 @@ OPENSSL_TAG=master
WITH_JPEG=0
WITH_OPENH264=0
WITH_OPENSSL=0
WITH_FFMPEG=0
SRC_DIR=$(dirname "${BASH_SOURCE[0]}")
SRC_DIR=$(realpath "$SRC_DIR")
@ -43,6 +44,14 @@ do
ANDROID_NDK_OPENH264=$1
shift
;;
--ffmpeg)
WITH_FFMPEG=1
shift
;;
--ffmpeg-path)
FFMPEG_PATH="$2"
shift
;;
--openssl)
WITH_OPENSSL=1
shift
@ -133,6 +142,15 @@ do
CMAKE_CMD_ARGS="$CMAKE_CMD_ARGS -DWITH_OPENH264=ON"
else
CMAKE_CMD_ARGS="$CMAKE_CMD_ARGS -DWITH_OPENH264=OFF"
fi
if [ $WITH_FFMPEG -ne 0 ];
then
CMAKE_CMD_ARGS="$CMAKE_CMD_ARGS -DWITH_FFMPEG=ON"
CMAKE_CMD_ARGS="$CMAKE_CMD_ARGS -DAVCODEC_INCLUDE_DIRS=$FFMPEG_PATH/$ARCH/include -DAVCODEC_LIBRARY_DIRS=$FFMPEG_PATH/$ARCH/lib"
CMAKE_CMD_ARGS="$CMAKE_CMD_ARGS -DAVUTIL_INCLUDE_DIRS=$FFMPEG_PATH/$ARCH/include -DAVUTIL_LIBRARY_DIRS=$FFMPEG_PATH/$ARCH/lib"
CMAKE_CMD_ARGS="$CMAKE_CMD_ARGS -DSWRESAMPLE_INCLUDE_DIRS=$FFMPEG_PATH/$ARCH/include -DSWRESAMPLE_LIBRARY_DIRS=$FFMPEG_PATH/$ARCH/lib"
else
CMAKE_CMD_ARGS="$CMAKE_CMD_ARGS -DWITH_FFMPEG=OFF"
fi
if [ $WITH_OPENSSL -ne 0 ];
then

View File

@ -10,6 +10,7 @@
# create seperate configurations for each NDK API level
# and architecture you want to support.
WITH_JPEG=0
WITH_FFMPEG=0
WITH_OPENH264=1
WITH_OPENSSL=1
BUILD_DEPS=1