diff --git a/.github/workflows/android-build-scripts.yml b/.github/workflows/android-build-scripts.yml index 7d1c46f..62f34b6 100644 --- a/.github/workflows/android-build-scripts.yml +++ b/.github/workflows/android-build-scripts.yml @@ -4,12 +4,11 @@ on: [ push, pull_request ] jobs: build-main-on-linux: - name: android main - runs-on: ${{ matrix.os }} + name: android main on linux + runs-on: ubuntu-20.04 strategy: matrix: - os: [ ubuntu-20.04 ] - ndk-version: [ 'r22-linux-x86_64', 'r22b-linux-x86_64', 'r23-linux' ] + ndk-version: [ 'r21e-linux-x86_64', 'r22b-linux-x86_64', 'r23-linux' ] defaults: run: shell: bash @@ -23,28 +22,22 @@ jobs: - name: set up android ndk run: | curl -s "https://dl.google.com/android/repository/android-ndk-${{ matrix.ndk-version }}.zip" -o ndk.zip - unzip -q -o ndk.zip -d .ndk.dir - DIR=$(ls .ndk.dir) - mv .ndk.dir/$DIR ~/.ndk - env: - ANDROID_NDK_ROOT: ~/.ndk + unzip -q -o ndk.zip -d .ndk + echo "ANDROID_NDK_ROOT=$PWD/.ndk/$(ls .ndk)" >> $GITHUB_ENV - name: run the build script - run: ./android.sh -d --disable-arm-v7a --disable-arm-v7a-neon --disable-arm64-v8a - - name: print success logs - if: ${{ success() }} + run: ./android.sh -d --enable-android-media-codec --enable-android-zlib + - name: print build logs + if: ${{ always() }} run: cat build.log - - name: print failure logs + - name: print ffbuild logs if: ${{ failure() }} - run: | - tail -50 build.log - tail -50 ./src/ffmpeg/ffbuild/config.log + run: '[[ -f ./src/ffmpeg/ffbuild/config.log ]] && tail -50 ./src/ffmpeg/ffbuild/config.log' build-lts-on-linux: - name: android lts - runs-on: ${{ matrix.os }} + name: android lts on linux + runs-on: ubuntu-20.04 strategy: matrix: - os: [ ubuntu-20.04 ] - ndk-version: [ 'r22-linux-x86_64', 'r22b-linux-x86_64', 'r23-linux' ] + ndk-version: [ 'r21e-linux-x86_64', 'r22b-linux-x86_64', 'r23-linux' ] defaults: run: shell: bash @@ -58,28 +51,22 @@ jobs: - name: set up android ndk run: | curl -s "https://dl.google.com/android/repository/android-ndk-${{ matrix.ndk-version }}.zip" -o ndk.zip - unzip -q -o ndk.zip -d .ndk.dir - DIR=$(ls .ndk.dir) - mv .ndk.dir/$DIR ~/.ndk - env: - ANDROID_NDK_ROOT: ~/.ndk + unzip -q -o ndk.zip -d .ndk + echo "ANDROID_NDK_ROOT=$PWD/.ndk/$(ls .ndk)" >> $GITHUB_ENV - name: run the build script - run: ./android.sh -d -l --disable-arm-v7a --disable-arm-v7a-neon --disable-arm64-v8a - - name: print success logs - if: ${{ success() }} + run: ./android.sh -d --lts --enable-android-media-codec --enable-android-zlib + - name: print build logs + if: ${{ always() }} run: cat build.log - - name: print failure logs + - name: print ffbuild logs if: ${{ failure() }} - run: | - tail -50 build.log - tail -50 ./src/ffmpeg/ffbuild/config.log + run: '[[ -f ./src/ffmpeg/ffbuild/config.log ]] && tail -50 ./src/ffmpeg/ffbuild/config.log' build-main-on-macos: - name: android main - runs-on: ${{ matrix.os }} + name: android main on macos + runs-on: macos-10.15 strategy: matrix: - os: [ macos-10.15 ] - ndk-url: [ 'r22-darwin-x86_64', 'r22b-darwin-x86_64', 'r23-darwin' ] + ndk-version: [ 'r21e-darwin-x86_64', 'r22b-darwin-x86_64', 'r23-darwin' ] defaults: run: shell: bash @@ -93,28 +80,22 @@ jobs: - name: set up android ndk run: | curl -s "https://dl.google.com/android/repository/android-ndk-${{ matrix.ndk-version }}.zip" -o ndk.zip - unzip -q -o ndk.zip -d .ndk.dir - DIR=$(ls .ndk.dir) - mv .ndk.dir/$DIR ~/.ndk - env: - ANDROID_NDK_ROOT: ~/.ndk + unzip -q -o ndk.zip -d .ndk + echo "ANDROID_NDK_ROOT=$PWD/.ndk/$(ls .ndk)" >> $GITHUB_ENV - name: run the build script - run: ./android.sh -d --disable-arm-v7a --disable-arm-v7a-neon --disable-arm64-v8a - - name: print success logs - if: ${{ success() }} + run: ./android.sh -d --enable-android-media-codec --enable-android-zlib + - name: print build logs + if: ${{ always() }} run: cat build.log - - name: print failure logs + - name: print ffbuild logs if: ${{ failure() }} - run: | - tail -50 build.log - tail -50 ./src/ffmpeg/ffbuild/config.log + run: '[[ -f ./src/ffmpeg/ffbuild/config.log ]] && tail -50 ./src/ffmpeg/ffbuild/config.log' build-lts-on-macos: - name: android lts - runs-on: ${{ matrix.os }} + name: android lts on macos + runs-on: macos-10.15 strategy: matrix: - os: [ macos-10.15 ] - ndk-url: [ 'r22-darwin-x86_64', 'r22b-darwin-x86_64', 'r23-darwin' ] + ndk-version: [ 'r21e-darwin-x86_64', 'r22b-darwin-x86_64', 'r23-darwin' ] defaults: run: shell: bash @@ -128,18 +109,13 @@ jobs: - name: set up android ndk run: | curl -s "https://dl.google.com/android/repository/android-ndk-${{ matrix.ndk-version }}.zip" -o ndk.zip - unzip -q -o ndk.zip -d .ndk.dir - DIR=$(ls .ndk.dir) - mv .ndk.dir/$DIR ~/.ndk - env: - ANDROID_NDK_ROOT: ~/.ndk + unzip -q -o ndk.zip -d .ndk + echo "ANDROID_NDK_ROOT=$PWD/.ndk/$(ls .ndk)" >> $GITHUB_ENV - name: run the build script - run: ./android.sh -d -l --disable-arm-v7a --disable-arm-v7a-neon --disable-arm64-v8a - - name: print success logs - if: ${{ success() }} + run: ./android.sh -d --lts --enable-android-media-codec --enable-android-zlib + - name: print build logs + if: ${{ always() }} run: cat build.log - - name: print failure logs + - name: print ffbuild logs if: ${{ failure() }} - run: | - tail -50 build.log - tail -50 ./src/ffmpeg/ffbuild/config.log + run: '[[ -f ./src/ffmpeg/ffbuild/config.log ]] && tail -50 ./src/ffmpeg/ffbuild/config.log' diff --git a/.github/workflows/ios-build-scripts.yml b/.github/workflows/ios-build-scripts.yml index 79a5507..37ed5ad 100644 --- a/.github/workflows/ios-build-scripts.yml +++ b/.github/workflows/ios-build-scripts.yml @@ -17,21 +17,19 @@ jobs: - name: set up xcode run: echo "export DEVELOPER_DIR=/Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer" > ~/.xcode.for.ffmpeg.kit.sh - name: run the build script - run: ./ios.sh -d -x --disable-arm64 --disable-arm64e --disable-i386 --disable-x86-64 - - name: print success logs - if: ${{ success() }} + run: ./ios.sh --xcframework --enable-ios-audiotoolbox --enable-ios-avfoundation --enable-ios-bzip2 --enable-ios-libiconv --enable-ios-videotoolbox --enable-ios-zlib + - name: print build logs + if: ${{ always() }} run: cat build.log - - name: print failure logs + - name: print ffbuild logs if: ${{ failure() }} - run: | - tail -50 build.log - tail -50 ./src/ffmpeg/ffbuild/config.log + run: '[[ -f ./src/ffmpeg/ffbuild/config.log ]] && tail -50 ./src/ffmpeg/ffbuild/config.log' build-lts-on-macos: name: ios lts runs-on: macos-10.15 strategy: matrix: - xcode: [ '10.3', '11.7', '12.4' ] + xcode: [ '10.3', '11.7' ] defaults: run: shell: bash @@ -40,12 +38,10 @@ jobs: - name: set up xcode run: echo "export DEVELOPER_DIR=/Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer" > ~/.xcode.for.ffmpeg.kit.sh - name: run the build script - run: ./ios.sh -d -l --disable-arm64 --disable-arm64e --disable-i386 - - name: print success logs - if: ${{ success() }} + run: ./ios.sh --lts --enable-ios-audiotoolbox --enable-ios-bzip2 --enable-ios-libiconv --enable-ios-videotoolbox --enable-ios-zlib + - name: print build logs + if: ${{ always() }} run: cat build.log - - name: print failure logs + - name: print ffbuild logs if: ${{ failure() }} - run: | - tail -50 build.log - tail -50 ./src/ffmpeg/ffbuild/config.log + run: '[[ -f ./src/ffmpeg/ffbuild/config.log ]] && tail -50 ./src/ffmpeg/ffbuild/config.log' diff --git a/.github/workflows/macos-build-scripts.yml b/.github/workflows/macos-build-scripts.yml index 212275a..23d2537 100644 --- a/.github/workflows/macos-build-scripts.yml +++ b/.github/workflows/macos-build-scripts.yml @@ -17,21 +17,19 @@ jobs: - name: set up xcode run: echo "export DEVELOPER_DIR=/Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer" > ~/.xcode.for.ffmpeg.kit.sh - name: run the build script - run: ./macos.sh -d -x --disable-arm64 - - name: print success logs - if: ${{ success() }} + run: ./macos.sh --xcframework --enable-macos-audiotoolbox --enable-macos-avfoundation --enable-macos-bzip2 --enable-macos-coreimage --enable-macos-libiconv --enable-macos-opencl --enable-macos-opengl --enable-macos-videotoolbox --enable-macos-zlib + - name: print build logs + if: ${{ always() }} run: cat build.log - - name: print failure logs + - name: print ffbuild logs if: ${{ failure() }} - run: | - tail -50 build.log - tail -50 ./src/ffmpeg/ffbuild/config.log + run: '[[ -f ./src/ffmpeg/ffbuild/config.log ]] && tail -50 ./src/ffmpeg/ffbuild/config.log' build-lts-on-macos: name: macos lts runs-on: macos-10.15 strategy: matrix: - xcode: [ '10.3', '12.4' ] + xcode: [ '10.3', '11.7' ] defaults: run: shell: bash @@ -40,12 +38,10 @@ jobs: - name: set up xcode run: echo "export DEVELOPER_DIR=/Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer" > ~/.xcode.for.ffmpeg.kit.sh - name: run the build script - run: ./macos.sh -d -l - - name: print success logs - if: ${{ success() }} + run: ./macos.sh --lts --enable-macos-audiotoolbox --enable-macos-bzip2 --enable-macos-coreimage --enable-macos-libiconv --enable-macos-opencl --enable-macos-opengl --enable-macos-videotoolbox --enable-macos-zlib + - name: print build logs + if: ${{ always() }} run: cat build.log - - name: print failure logs + - name: print ffbuild logs if: ${{ failure() }} - run: | - tail -50 build.log - tail -50 ./src/ffmpeg/ffbuild/config.log + run: '[[ -f ./src/ffmpeg/ffbuild/config.log ]] && tail -50 ./src/ffmpeg/ffbuild/config.log' diff --git a/.github/workflows/tvos-build-scripts.yml b/.github/workflows/tvos-build-scripts.yml index 223438e..041d5e8 100644 --- a/.github/workflows/tvos-build-scripts.yml +++ b/.github/workflows/tvos-build-scripts.yml @@ -17,21 +17,19 @@ jobs: - name: set up xcode run: echo "export DEVELOPER_DIR=/Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer" > ~/.xcode.for.ffmpeg.kit.sh - name: run the build script - run: ./tvos.sh -d -x --disable-arm64 - - name: print success logs - if: ${{ success() }} + run: ./tvos.sh --xcframework --enable-tvos-bzip2 --enable-tvos-audiotoolbox --enable-tvos-libiconv --enable-tvos-videotoolbox --enable-tvos-zlib + - name: print build logs + if: ${{ always() }} run: cat build.log - - name: print failure logs + - name: print ffbuild logs if: ${{ failure() }} - run: | - tail -50 build.log - tail -50 ./src/ffmpeg/ffbuild/config.log + run: '[[ -f ./src/ffmpeg/ffbuild/config.log ]] && tail -50 ./src/ffmpeg/ffbuild/config.log' build-lts-on-macos: name: tvos lts runs-on: macos-10.15 strategy: matrix: - xcode: [ '10.3', '12.4' ] + xcode: [ '10.3', '11.7' ] defaults: run: shell: bash @@ -40,12 +38,10 @@ jobs: - name: set up xcode run: echo "export DEVELOPER_DIR=/Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer" > ~/.xcode.for.ffmpeg.kit.sh - name: run the build script - run: ./tvos.sh -d -l --disable-arm64 - - name: print success logs - if: ${{ success() }} + run: ./tvos.sh --lts --enable-tvos-bzip2 --enable-tvos-audiotoolbox --enable-tvos-libiconv --enable-tvos-zlib + - name: print build logs + if: ${{ always() }} run: cat build.log - - name: print failure logs + - name: print ffbuild logs if: ${{ failure() }} - run: | - tail -50 build.log - tail -50 ./src/ffmpeg/ffbuild/config.log + run: '[[ -f ./src/ffmpeg/ffbuild/config.log ]] && tail -50 ./src/ffmpeg/ffbuild/config.log' diff --git a/README.md b/README.md index 55b4280..d918a7a 100644 --- a/README.md +++ b/README.md @@ -121,15 +121,19 @@ This table shows the differences between two variants. | Android API Level | 24 | 16 | | Android Camera Access | Yes | - | | Android Architectures | arm-v7a-neon
arm64-v8a
x86
x86-64 | arm-v7a
arm-v7a-neon
arm64-v8a
x86
x86-64 | -| Xcode Compatibility | 11.0 or later | 7.3.1 or later | -| iOS SDK | 12.1 | 9.3 | +| Xcode Compatibility | 11.0 or later | 9.0 or later | +| iOS SDK | 12.1 | 11.0 | | iOS AVFoundation | Yes | - | | iOS Architectures | arm64
arm64-simulator
arm64-mac-catalyst
x86-64
x86-64-mac-catalyst | armv7
arm64
i386
x86-64 | +| iOS Bundle Format | XCFrameworks | Frameworks | | macOS SDK | 10.15 | 10.11 | | macOS AVFoundation | Yes | - | | macOS Architectures | arm64
x86-64 | x86-64 | -| tvOS SDK | 10.2 | 9.2 | +| macOS Bundle Format | XCFrameworks | Frameworks | +| tvOS SDK | 11.0 | 9.2 | +| tvOS VideoToolbox | Yes | - | | tvOS Architectures | arm64
x86-64
arm64-simulator | arm64
x86-64 | +| tvOS Bundle Format | XCFrameworks | Frameworks | ### 9. Test Applications diff --git a/android.sh b/android.sh index 00ffd30..d2abaf8 100755 --- a/android.sh +++ b/android.sh @@ -22,7 +22,7 @@ enable_default_android_libraries enable_main_build # DETECT ANDROID NDK VERSION -DETECTED_NDK_VERSION=$(grep -Eo "Revision.*" "${ANDROID_NDK_ROOT}"/source.properties | sed 's/Revision//g;s/=//g;s/ //g') +export DETECTED_NDK_VERSION=$(grep -Eo "Revision.*" "${ANDROID_NDK_ROOT}"/source.properties | sed 's/Revision//g;s/=//g;s/ //g') echo -e "\nINFO: Using Android NDK v${DETECTED_NDK_VERSION} provided at ${ANDROID_NDK_ROOT}\n" 1>>"${BASEDIR}"/build.log 2>&1 echo -e "INFO: Build options: $*\n" 1>>"${BASEDIR}"/build.log 2>&1 @@ -231,13 +231,11 @@ if [[ ${ENABLED_ARCHITECTURES[ARCH_ARM_V7A]} -eq 1 ]] || [[ ${ENABLED_ARCHITECTU fi if [[ ${ENABLED_ARCHITECTURES[ARCH_ARM_V7A]} -eq 1 ]]; then mkdir -p "${BASEDIR}"/android/build 1>>"${BASEDIR}"/build.log 2>&1 - cat >"${BASEDIR}"/android/build/.armv7 <>"${BASEDIR}"/build.log 2>&1 - cat >"${BASEDIR}"/android/build/.armv7neon <"${BASEDIR}"/android/build/.lts <>"${BASEDIR}"/build.log 2>&1 + create_file "${BASEDIR}"/android/build/.lts fi # BUILD FFMPEG-KIT diff --git a/android/ffmpeg-kit-android-lib/src/main/cpp/ffmpegkit.c b/android/ffmpeg-kit-android-lib/src/main/cpp/ffmpegkit.c index 1a28f12..0b7b54b 100644 --- a/android/ffmpeg-kit-android-lib/src/main/cpp/ffmpegkit.c +++ b/android/ffmpeg-kit-android-lib/src/main/cpp/ffmpegkit.c @@ -53,7 +53,7 @@ struct CallbackData { }; /** Session control variables */ -const int SESSION_MAP_SIZE = 1000; +#define SESSION_MAP_SIZE 1000 static atomic_short sessionMap[SESSION_MAP_SIZE]; static atomic_int sessionInTransitMessageCountMap[SESSION_MAP_SIZE]; diff --git a/android/ffmpeg-kit-android-lib/src/main/cpp/fftools_ffmpeg.c b/android/ffmpeg-kit-android-lib/src/main/cpp/fftools_ffmpeg.c index 12e4e2a..88968ec 100644 --- a/android/ffmpeg-kit-android-lib/src/main/cpp/fftools_ffmpeg.c +++ b/android/ffmpeg-kit-android-lib/src/main/cpp/fftools_ffmpeg.c @@ -504,7 +504,12 @@ static BOOL WINAPI CtrlHandler(DWORD fdwCtrlType) void term_init(void) { #if defined __linux__ - struct sigaction action = {0}; + #if defined __aarch64__ || defined __amd64__ || defined __x86_64__ + struct sigaction action = {0}; + #else + struct sigaction action = {{0}}; + #endif + action.sa_handler = sigterm_handler; /* block other interrupts while processing this one */ diff --git a/apple/src/FFmpegKitConfig.m b/apple/src/FFmpegKitConfig.m index 8c9bef2..2c1f9ae 100644 --- a/apple/src/FFmpegKitConfig.m +++ b/apple/src/FFmpegKitConfig.m @@ -54,7 +54,7 @@ static NSMutableArray* sessionHistoryList; static NSRecursiveLock* sessionHistoryLock; /** Session control variables */ -const int SESSION_MAP_SIZE = 1000; +#define SESSION_MAP_SIZE 1000 static atomic_short sessionMap[SESSION_MAP_SIZE]; static atomic_int sessionInTransitMessageCountMap[SESSION_MAP_SIZE]; diff --git a/apple/src/fftools_ffmpeg.c b/apple/src/fftools_ffmpeg.c index 659fd01..96bd063 100644 --- a/apple/src/fftools_ffmpeg.c +++ b/apple/src/fftools_ffmpeg.c @@ -501,7 +501,12 @@ static BOOL WINAPI CtrlHandler(DWORD fdwCtrlType) void term_init(void) { #if defined __linux__ - struct sigaction action = {0}; + #if defined __aarch64__ || defined __amd64__ || defined __x86_64__ + struct sigaction action = {0}; + #else + struct sigaction action = {{0}}; + #endif + action.sa_handler = sigterm_handler; /* block other interrupts while processing this one */ diff --git a/ios.sh b/ios.sh index c6ddb73..1c99e21 100755 --- a/ios.sh +++ b/ios.sh @@ -28,7 +28,7 @@ if [[ -f ${XCODE_FOR_FFMPEG_KIT} ]]; then fi # DETECT IOS SDK VERSION -DETECTED_IOS_SDK_VERSION="$(xcrun --sdk iphoneos --show-sdk-version 2>>"${BASEDIR}"/build.log)" +DETECTED_IOS_SDK_VERSION="$(xcrun --sdk iphoneos --show-sdk-version 2>>${BASEDIR}/build.log)" echo -e "\nINFO: Using SDK ${DETECTED_IOS_SDK_VERSION} by Xcode provided at $(xcode-select -p)\n" 1>>"${BASEDIR}"/build.log 2>&1 echo -e "INFO: Build options: $*\n" 1>>"${BASEDIR}"/build.log 2>&1 @@ -130,14 +130,6 @@ while [ ! $# -eq 0 ]; do shift done -# VALIDATE THAT LTS RELEASES ARE BUILT USING THE CORRECT VERSION -if [[ -n ${FFMPEG_KIT_LTS_BUILD} ]] && [[ "${DETECTED_IOS_SDK_VERSION}" != "${IOS_MIN_VERSION}" ]]; then - if [[ -z ${BUILD_FORCE} ]]; then - echo -e "\n(*) LTS packages should be built using SDK ${IOS_MIN_VERSION} but current configuration uses SDK ${DETECTED_IOS_SDK_VERSION}\n" - exit 1 - fi -fi - # PROCESS FULL OPTION AS LAST OPTION if [[ -n ${BUILD_FULL} ]]; then for library in {0..58}; do diff --git a/macos.sh b/macos.sh index 2f14e70..ccc2f8a 100755 --- a/macos.sh +++ b/macos.sh @@ -28,7 +28,7 @@ if [[ -f ${XCODE_FOR_FFMPEG_KIT} ]]; then fi # DETECT MACOS SDK VERSION -DETECTED_MACOS_SDK_VERSION="$(xcrun --sdk macosx --show-sdk-version 2>>"${BASEDIR}"/build.log)" +DETECTED_MACOS_SDK_VERSION="$(xcrun --sdk macosx --show-sdk-version 2>>${BASEDIR}/build.log)" echo -e "\nINFO: Using SDK ${DETECTED_MACOS_SDK_VERSION} by Xcode provided at $(xcode-select -p)\n" 1>>"${BASEDIR}"/build.log 2>&1 echo -e "\nINFO: Build options: $*\n" 1>>"${BASEDIR}"/build.log 2>&1 @@ -130,14 +130,6 @@ while [ ! $# -eq 0 ]; do shift done -# VALIDATE THAT LTS RELEASES ARE BUILT USING THE CORRECT VERSION -if [[ -n ${FFMPEG_KIT_LTS_BUILD} ]] && [[ "${DETECTED_MACOS_SDK_VERSION}" != "${MACOS_MIN_VERSION}" ]]; then - if [[ -z ${BUILD_FORCE} ]]; then - echo -e "\n(*) LTS packages should be built using SDK ${MACOS_MIN_VERSION} but current configuration uses SDK ${DETECTED_MACOS_SDK_VERSION}\n" - exit 1 - fi -fi - # PROCESS FULL OPTION AS LAST OPTION if [[ -n ${BUILD_FULL} ]]; then for library in {0..58}; do diff --git a/scripts/function-android.sh b/scripts/function-android.sh index 90ff9d5..b602dc0 100755 --- a/scripts/function-android.sh +++ b/scripts/function-android.sh @@ -207,7 +207,14 @@ get_common_cflags() { local LTS_BUILD__FLAG="-DFFMPEG_KIT_LTS " fi - echo "-fno-integrated-as -fstrict-aliasing -DANDROID_NDK -fPIC -DANDROID ${LTS_BUILD__FLAG}-D__ANDROID__ -D__ANDROID_API__=${API}" + case ${DETECTED_NDK_VERSION} in + 23*) + echo "-fstrict-aliasing -DANDROID_NDK -fPIC -DANDROID ${LTS_BUILD__FLAG}-D__ANDROID__ -D__ANDROID_MIN_SDK_VERSION__=${API}" + ;; + *) + echo "-fno-integrated-as -fstrict-aliasing -DANDROID_NDK -fPIC -DANDROID ${LTS_BUILD__FLAG}-D__ANDROID__ -D__ANDROID_API__=${API}" + ;; + esac } get_arch_specific_cflags() { @@ -222,10 +229,24 @@ get_arch_specific_cflags() { echo "-march=armv8-a -DFFMPEG_KIT_ARM64_V8A" ;; x86) - echo "-march=i686 -mtune=intel -mssse3 -mfpmath=sse -m32 -DFFMPEG_KIT_X86" + case ${DETECTED_NDK_VERSION} in + 23*) + echo "-march=i686 -mssse3 -mfpmath=sse -m32 -DFFMPEG_KIT_X86" + ;; + *) + echo "-march=i686 -mtune=intel -mssse3 -mfpmath=sse -m32 -DFFMPEG_KIT_X86" + ;; + esac ;; x86-64) - echo "-march=x86-64 -msse4.2 -mpopcnt -m64 -mtune=intel -DFFMPEG_KIT_X86_64" + case ${DETECTED_NDK_VERSION} in + 23*) + echo "-march=x86-64 -msse4.2 -mpopcnt -m64 -DFFMPEG_KIT_X86_64" + ;; + *) + echo "-march=x86-64 -msse4.2 -mpopcnt -m64 -mtune=intel -DFFMPEG_KIT_X86_64" + ;; + esac ;; esac } @@ -294,7 +315,7 @@ get_app_specific_cflags() { rubberband) APP_FLAGS="-std=c99 -Wno-unused-function" ;; - shine) + libvpx | shine) APP_FLAGS="-Wno-unused-function" ;; soxr | snappy | libwebp) @@ -814,9 +835,8 @@ Name: x265 Description: H.265/HEVC video encoder Version: ${X265_VERSION} -Requires: Libs: -L\${libdir} -lx265 -Libs.private: -lm -lgcc -lgcc -ldl -lgcc -lgcc -ldl -lc++_shared +Libs.private: -lm -ldl -llog -lm -lc++_shared Cflags: -I\${includedir} EOF } @@ -953,7 +973,6 @@ set_toolchain_paths() { HOST=$(get_host) - export AR=${HOST}-ar export CC=$(get_clang_host)-clang export CXX=$(get_clang_host)-clang++ @@ -968,12 +987,22 @@ set_toolchain_paths() { export ac_cv_c_bigendian=no ;; esac - - export LD=${HOST}-ld - export RANLIB=${HOST}-ranlib - export STRIP=${HOST}-strip - export NM=${HOST}-nm - + case ${DETECTED_NDK_VERSION} in + 23*) + export AR=llvm-ar + export LD=lld + export RANLIB=llvm-ranlib + export STRIP=llvm-strip + export NM=llvm-nm + ;; + *) + export AR=${HOST}-ar + export LD=${HOST}-ld + export RANLIB=${HOST}-ranlib + export STRIP=${HOST}-strip + export NM=${HOST}-nm + ;; + esac export INSTALL_PKG_CONFIG_DIR="${BASEDIR}"/prebuilt/$(get_build_directory)/pkgconfig export ZLIB_PACKAGE_CONFIG_PATH="${INSTALL_PKG_CONFIG_DIR}/zlib.pc" @@ -1006,6 +1035,6 @@ build_android_lts_support() { LDFLAGS=$(get_ldflags ${LIB_NAME}) # BUILD - "$(get_clang_host)"-clang ${CFLAGS} -Wno-unused-command-line-argument -c "${BASEDIR}"/android/ffmpeg-kit-android-lib/src/main/cpp/android_lts_support.c -o "${BASEDIR}"/android/ffmpeg-kit-android-lib/src/main/cpp/android_lts_support.o ${LDFLAGS} 1>>"${BASEDIR}"/build.log 2>&1 - "${HOST}"-ar rcs "${BASEDIR}"/android/ffmpeg-kit-android-lib/src/main/cpp/libandroidltssupport.a "${BASEDIR}"/android/ffmpeg-kit-android-lib/src/main/cpp/android_lts_support.o 1>>"${BASEDIR}"/build.log 2>&1 + "${CC}" ${CFLAGS} -Wno-unused-command-line-argument -c "${BASEDIR}"/android/ffmpeg-kit-android-lib/src/main/cpp/android_lts_support.c -o "${BASEDIR}"/android/ffmpeg-kit-android-lib/src/main/cpp/android_lts_support.o ${LDFLAGS} 1>>"${BASEDIR}"/build.log 2>&1 + "${AR}" rcs "${BASEDIR}"/android/ffmpeg-kit-android-lib/src/main/cpp/libandroidltssupport.a "${BASEDIR}"/android/ffmpeg-kit-android-lib/src/main/cpp/android_lts_support.o 1>>"${BASEDIR}"/build.log 2>&1 } diff --git a/scripts/function-ios.sh b/scripts/function-ios.sh index 6dfd327..37d8b05 100755 --- a/scripts/function-ios.sh +++ b/scripts/function-ios.sh @@ -65,8 +65,8 @@ enable_main_build() { enable_lts_build() { export FFMPEG_KIT_LTS_BUILD="1" - # XCODE 7.3 HAS IOS SDK 9.3 - export IOS_MIN_VERSION=9.3 + # XCODE 9.0 HAS IOS SDK 11.0 + export IOS_MIN_VERSION=11.0 } get_common_includes() { diff --git a/scripts/function-tvos.sh b/scripts/function-tvos.sh index 509dff8..cc87adc 100755 --- a/scripts/function-tvos.sh +++ b/scripts/function-tvos.sh @@ -47,7 +47,7 @@ set explicitly. When compilation ends, libraries are created under the prebuilt } enable_main_build() { - export TVOS_MIN_VERSION=10.2 + export TVOS_MIN_VERSION=11.0 } enable_lts_build() { diff --git a/scripts/function.sh b/scripts/function.sh index 7c854d9..de2f196 100755 --- a/scripts/function.sh +++ b/scripts/function.sh @@ -1781,3 +1781,11 @@ overwrite_file() { rm -f "$2" cp "$1" "$2" } + +# +# 1. destination file +# +create_file() { + rm -f "$1" + echo "" > "$1" 1>>"${BASEDIR}"/build.log 2>&1 +} diff --git a/tvos.sh b/tvos.sh index 1ba4685..3cf39a7 100755 --- a/tvos.sh +++ b/tvos.sh @@ -28,7 +28,7 @@ if [[ -f ${XCODE_FOR_FFMPEG_KIT} ]]; then fi # DETECT TVOS SDK VERSION -DETECTED_TVOS_SDK_VERSION="$(xcrun --sdk appletvos --show-sdk-version 2>>"${BASEDIR}"/build.log)" +DETECTED_TVOS_SDK_VERSION="$(xcrun --sdk appletvos --show-sdk-version 2>>${BASEDIR}/build.log)" echo -e "\nINFO: Using SDK ${DETECTED_TVOS_SDK_VERSION} by Xcode provided at $(xcode-select -p)\n" 1>>"${BASEDIR}"/build.log 2>&1 echo -e "\nINFO: Build options: $*\n" 1>>"${BASEDIR}"/build.log 2>&1 @@ -130,14 +130,6 @@ while [ ! $# -eq 0 ]; do shift done -# VALIDATE THAT LTS RELEASES ARE BUILT USING THE CORRECT VERSION -if [[ -n ${FFMPEG_KIT_LTS_BUILD} ]] && [[ "${DETECTED_TVOS_SDK_VERSION}" != "${TVOS_MIN_VERSION}" ]]; then - if [[ -z ${BUILD_FORCE} ]]; then - echo -e "\n(*) LTS packages should be built using SDK ${TVOS_MIN_VERSION} but current configuration uses SDK ${DETECTED_TVOS_SDK_VERSION}\n" - exit 1 - fi -fi - # PROCESS FULL OPTION AS LAST OPTION if [[ -n ${BUILD_FULL} ]]; then for library in {0..58}; do