|
|
|
@ -1,29 +1,28 @@ |
|
|
|
|
#!/usr/bin/env bash |
|
|
|
|
|
|
|
|
|
case $ANDROID_ABI in |
|
|
|
|
x86) |
|
|
|
|
x86) |
|
|
|
|
# Disabling assembler optimizations, because they have text relocations |
|
|
|
|
EXTRA_BUILD_CONFIGURATION_FLAGS="$EXTRA_BUILD_CONFIGURATION_FLAGS --disable-neon --disable-asm" |
|
|
|
|
;; |
|
|
|
|
x86_64) |
|
|
|
|
x86_64) |
|
|
|
|
EXTRA_BUILD_CONFIGURATION_FLAGS="$EXTRA_BUILD_CONFIGURATION_FLAGS --disable-neon --disable-asm" |
|
|
|
|
;; |
|
|
|
|
armeabi-v7a) |
|
|
|
|
armeabi-v7a) |
|
|
|
|
EXTRA_BUILD_CONFIGURATION_FLAGS="$EXTRA_BUILD_CONFIGURATION_FLAGS --enable-neon --disable-asm --enable-inline-asm" |
|
|
|
|
;; |
|
|
|
|
arm64-v8a) |
|
|
|
|
arm64-v8a) |
|
|
|
|
EXTRA_BUILD_CONFIGURATION_FLAGS="$EXTRA_BUILD_CONFIGURATION_FLAGS --enable-neon --disable-asm --enable-inline-asm" |
|
|
|
|
;; |
|
|
|
|
esac |
|
|
|
|
|
|
|
|
|
if [ "$FFMPEG_GPL_ENABLED" = true ] ; then |
|
|
|
|
if [ "$FFMPEG_GPL_ENABLED" = true ]; then |
|
|
|
|
EXTRA_BUILD_CONFIGURATION_FLAGS="$EXTRA_BUILD_CONFIGURATION_FLAGS --enable-gpl" |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
# Preparing flags for enabling requested libraries |
|
|
|
|
ADDITIONAL_COMPONENTS= |
|
|
|
|
for LIBARY_NAME in ${FFMPEG_EXTERNAL_LIBRARIES[@]} |
|
|
|
|
do |
|
|
|
|
for LIBARY_NAME in ${FFMPEG_EXTERNAL_LIBRARIES[@]}; do |
|
|
|
|
ADDITIONAL_COMPONENTS+=" --enable-$LIBARY_NAME" |
|
|
|
|
case $LIBARY_NAME in |
|
|
|
|
libx264) |
|
|
|
@ -163,6 +162,10 @@ DEP_LD_FLAGS="-L${BUILD_DIR_EXTERNAL}/${ANDROID_ABI}/lib $FFMPEG_EXTRA_LD_FLAGS" |
|
|
|
|
--enable-jni \ |
|
|
|
|
--enable-nonfree \ |
|
|
|
|
--enable-mediacodec \ |
|
|
|
|
--enable-decoder=h264_mediacodec \ |
|
|
|
|
--enable-decoder=hevc_mediacodec \ |
|
|
|
|
--enable-encoder=h264_mediacodec \ |
|
|
|
|
--enable-encoder=hevc_mediacodec \ |
|
|
|
|
--enable-version3 \ |
|
|
|
|
--pkg-config=${PKG_CONFIG_EXECUTABLE} \ |
|
|
|
|
${EXTRA_BUILD_CONFIGURATION_FLAGS} \ |
|
|
|
@ -172,7 +175,6 @@ ${MAKE_EXECUTABLE} clean |
|
|
|
|
${MAKE_EXECUTABLE} -j${HOST_NPROC} |
|
|
|
|
${MAKE_EXECUTABLE} install |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export STATIC_LIB_DIR=${BUILD_DIR_FFMPEG}/${ANDROID_ABI}/lib |
|
|
|
|
export EXTERNAL_LIB_DIR=${INSTALL_DIR}/lib |
|
|
|
|
echo STATIC_LIB_DIR=${STATIC_LIB_DIR} |
|
|
|
@ -180,15 +182,14 @@ echo EXTERNAL_LIB_DIR=${EXTERNAL_LIB_DIR} |
|
|
|
|
echo FAM_CC=${FAM_CC} |
|
|
|
|
|
|
|
|
|
EXTERNAL_STATIC_LIB_PATH="" |
|
|
|
|
for LIBARY_NAME in ${FFMPEG_EXTERNAL_LIBRARIES[@]} |
|
|
|
|
do |
|
|
|
|
for LIBARY_NAME in ${FFMPEG_EXTERNAL_LIBRARIES[@]}; do |
|
|
|
|
EXTERNAL_STATIC_LIB_PATH+="${EXTERNAL_LIB_DIR}/${LIBARY_NAME}.a " |
|
|
|
|
done |
|
|
|
|
echo EXTERNAL_STATIC_LIB_PATH=${EXTERNAL_STATIC_LIB_PATH} |
|
|
|
|
|
|
|
|
|
${FAM_CC} -shared -o ${STATIC_LIB_DIR}/${OUTPUT_SO_NAME} \ |
|
|
|
|
-Wl,--whole-archive \ |
|
|
|
|
${EXTERNAL_STATIC_LIB_PATH}\ |
|
|
|
|
${EXTERNAL_STATIC_LIB_PATH} \ |
|
|
|
|
${STATIC_LIB_DIR}/libavutil.a \ |
|
|
|
|
${STATIC_LIB_DIR}/libavcodec.a \ |
|
|
|
|
${STATIC_LIB_DIR}/libavfilter.a \ |
|
|
|
@ -202,4 +203,3 @@ mkdir -p ${OUTPUT_CONFIG_HEADERS_DIR} |
|
|
|
|
cp config.h ${OUTPUT_CONFIG_HEADERS_DIR}/config.h |
|
|
|
|
|
|
|
|
|
${FAM_STRIP} --strip-unneeded ${STATIC_LIB_DIR}/${OUTPUT_SO_NAME} |
|
|
|
|
|
|
|
|
|