Learning links


*#! /bin/bash*
NDK_ROOT=/Users/black/Documents/ffmpeg/ndk/android-ndk-r17c
*The #TOOLCHAIN variable points to the directory where cross-compiled GCC is in the NDK *
TOOLCHAIN=$NDK_ROOT/ toolchains/arm - Linux - androideabi - 4.9 / prebuilt/Darwin - x86_64 / *# FLAGS and INCLUDES variables from engineering. AS the NDK externativeBuild/cmake/debug/armeabi v7a/build. The ninja in the copy, it is important to note * * * * * address
FLAGS="-isystem $NDK_ROOT/sysroot/usr/include/arm-linux-androideabi -D__ANDROID_API__=27 -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mthumb -Wa,--noexecstack -Wformat -Werror=format-security -std=c++11  -O0 -fPIC"

INCLUDES="-isystem $NDK_ROOT/sources/cxx-stl/llvm-libc++/include -isystem $NDK_ROOT/sources/android/support/include -isystem $NDK_ROOT/sources/cxx-stl/llvm-libc++abi/include"

*# execute configure script to generate makefile*
*#--prefix: installation directory *
*#--enable-small: optimize size *
*#--disable-programs: Instead of compiling ffmpeg programs (command-line tools), we need static (dynamic) libraries. *
*#--disable-avdevice: Disables the avdevice module, which is useless in Android *
*#--disable-encoders: Disable all encoders (playback does not require encoding)*
*#--disable-muxers: disable all multiplexers (wrappers), no files like MP4 need to be generated, so disable *
*#--disable-filters: turn off video filters *
*#--enable-cross-compile: enable cross-compile (ffmPEG is more ** cross-platform **, not all libraries have such a happy option) *
*GCC = XXX/XXX/XXX - GCC = XXX/XXX/XXX -*
*#disable-shared enable-static This is the default value. *
*#--sysroot:*
*#--extra-cflags: arguments passed to GCC *
*#--arch --target-os :*
PREFIX=./android/armeabi-v7a2
./configure \
--prefix=$PREFIX \
--prefix=$PREFIX\ --enable-small \ --disable-programs \ --disable-avdevice \ --disable-encoders \ --disable-muxers \ --disable-filters \  --enable-cross-compile \ --cross-prefix=$TOOLCHAIN/bin/arm-linux-androideabi- \
--disable-shared \
--enable-static \
--sysroot=$NDK_ROOT/platforms/android-27/arch-arm \
--extra-cflags="$FLAGS $INCLUDES" \
--extra-cflags="-isysroot $NDK_ROOT/sysroot" \
--arch=arm \
--target-os=android \

make clean
make install

Copy the code