fix android github action errors

This commit is contained in:
Taner Sener 2021-08-15 01:07:35 +03:00
parent 98bb5c7619
commit 4ce973e9d8
17 changed files with 157 additions and 168 deletions

View File

@ -4,12 +4,11 @@ on: [ push, pull_request ]
jobs: jobs:
build-main-on-linux: build-main-on-linux:
name: android main name: android main on linux
runs-on: ${{ matrix.os }} runs-on: ubuntu-20.04
strategy: strategy:
matrix: matrix:
os: [ ubuntu-20.04 ] ndk-version: [ 'r21e-linux-x86_64', 'r22b-linux-x86_64', 'r23-linux' ]
ndk-version: [ 'r22-linux-x86_64', 'r22b-linux-x86_64', 'r23-linux' ]
defaults: defaults:
run: run:
shell: bash shell: bash
@ -23,28 +22,22 @@ jobs:
- name: set up android ndk - name: set up android ndk
run: | run: |
curl -s "https://dl.google.com/android/repository/android-ndk-${{ matrix.ndk-version }}.zip" -o ndk.zip 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 unzip -q -o ndk.zip -d .ndk
DIR=$(ls .ndk.dir) echo "ANDROID_NDK_ROOT=$PWD/.ndk/$(ls .ndk)" >> $GITHUB_ENV
mv .ndk.dir/$DIR ~/.ndk
env:
ANDROID_NDK_ROOT: ~/.ndk
- name: run the build script - name: run the build script
run: ./android.sh -d --disable-arm-v7a --disable-arm-v7a-neon --disable-arm64-v8a run: ./android.sh -d --enable-android-media-codec --enable-android-zlib
- name: print success logs - name: print build logs
if: ${{ success() }} if: ${{ always() }}
run: cat build.log run: cat build.log
- name: print failure logs - name: print ffbuild logs
if: ${{ failure() }} if: ${{ failure() }}
run: | run: '[[ -f ./src/ffmpeg/ffbuild/config.log ]] && tail -50 ./src/ffmpeg/ffbuild/config.log'
tail -50 build.log
tail -50 ./src/ffmpeg/ffbuild/config.log
build-lts-on-linux: build-lts-on-linux:
name: android lts name: android lts on linux
runs-on: ${{ matrix.os }} runs-on: ubuntu-20.04
strategy: strategy:
matrix: matrix:
os: [ ubuntu-20.04 ] ndk-version: [ 'r21e-linux-x86_64', 'r22b-linux-x86_64', 'r23-linux' ]
ndk-version: [ 'r22-linux-x86_64', 'r22b-linux-x86_64', 'r23-linux' ]
defaults: defaults:
run: run:
shell: bash shell: bash
@ -58,28 +51,22 @@ jobs:
- name: set up android ndk - name: set up android ndk
run: | run: |
curl -s "https://dl.google.com/android/repository/android-ndk-${{ matrix.ndk-version }}.zip" -o ndk.zip 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 unzip -q -o ndk.zip -d .ndk
DIR=$(ls .ndk.dir) echo "ANDROID_NDK_ROOT=$PWD/.ndk/$(ls .ndk)" >> $GITHUB_ENV
mv .ndk.dir/$DIR ~/.ndk
env:
ANDROID_NDK_ROOT: ~/.ndk
- name: run the build script - name: run the build script
run: ./android.sh -d -l --disable-arm-v7a --disable-arm-v7a-neon --disable-arm64-v8a run: ./android.sh -d --lts --enable-android-media-codec --enable-android-zlib
- name: print success logs - name: print build logs
if: ${{ success() }} if: ${{ always() }}
run: cat build.log run: cat build.log
- name: print failure logs - name: print ffbuild logs
if: ${{ failure() }} if: ${{ failure() }}
run: | run: '[[ -f ./src/ffmpeg/ffbuild/config.log ]] && tail -50 ./src/ffmpeg/ffbuild/config.log'
tail -50 build.log
tail -50 ./src/ffmpeg/ffbuild/config.log
build-main-on-macos: build-main-on-macos:
name: android main name: android main on macos
runs-on: ${{ matrix.os }} runs-on: macos-10.15
strategy: strategy:
matrix: matrix:
os: [ macos-10.15 ] ndk-version: [ 'r21e-darwin-x86_64', 'r22b-darwin-x86_64', 'r23-darwin' ]
ndk-url: [ 'r22-darwin-x86_64', 'r22b-darwin-x86_64', 'r23-darwin' ]
defaults: defaults:
run: run:
shell: bash shell: bash
@ -93,28 +80,22 @@ jobs:
- name: set up android ndk - name: set up android ndk
run: | run: |
curl -s "https://dl.google.com/android/repository/android-ndk-${{ matrix.ndk-version }}.zip" -o ndk.zip 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 unzip -q -o ndk.zip -d .ndk
DIR=$(ls .ndk.dir) echo "ANDROID_NDK_ROOT=$PWD/.ndk/$(ls .ndk)" >> $GITHUB_ENV
mv .ndk.dir/$DIR ~/.ndk
env:
ANDROID_NDK_ROOT: ~/.ndk
- name: run the build script - name: run the build script
run: ./android.sh -d --disable-arm-v7a --disable-arm-v7a-neon --disable-arm64-v8a run: ./android.sh -d --enable-android-media-codec --enable-android-zlib
- name: print success logs - name: print build logs
if: ${{ success() }} if: ${{ always() }}
run: cat build.log run: cat build.log
- name: print failure logs - name: print ffbuild logs
if: ${{ failure() }} if: ${{ failure() }}
run: | run: '[[ -f ./src/ffmpeg/ffbuild/config.log ]] && tail -50 ./src/ffmpeg/ffbuild/config.log'
tail -50 build.log
tail -50 ./src/ffmpeg/ffbuild/config.log
build-lts-on-macos: build-lts-on-macos:
name: android lts name: android lts on macos
runs-on: ${{ matrix.os }} runs-on: macos-10.15
strategy: strategy:
matrix: matrix:
os: [ macos-10.15 ] ndk-version: [ 'r21e-darwin-x86_64', 'r22b-darwin-x86_64', 'r23-darwin' ]
ndk-url: [ 'r22-darwin-x86_64', 'r22b-darwin-x86_64', 'r23-darwin' ]
defaults: defaults:
run: run:
shell: bash shell: bash
@ -128,18 +109,13 @@ jobs:
- name: set up android ndk - name: set up android ndk
run: | run: |
curl -s "https://dl.google.com/android/repository/android-ndk-${{ matrix.ndk-version }}.zip" -o ndk.zip 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 unzip -q -o ndk.zip -d .ndk
DIR=$(ls .ndk.dir) echo "ANDROID_NDK_ROOT=$PWD/.ndk/$(ls .ndk)" >> $GITHUB_ENV
mv .ndk.dir/$DIR ~/.ndk
env:
ANDROID_NDK_ROOT: ~/.ndk
- name: run the build script - name: run the build script
run: ./android.sh -d -l --disable-arm-v7a --disable-arm-v7a-neon --disable-arm64-v8a run: ./android.sh -d --lts --enable-android-media-codec --enable-android-zlib
- name: print success logs - name: print build logs
if: ${{ success() }} if: ${{ always() }}
run: cat build.log run: cat build.log
- name: print failure logs - name: print ffbuild logs
if: ${{ failure() }} if: ${{ failure() }}
run: | run: '[[ -f ./src/ffmpeg/ffbuild/config.log ]] && tail -50 ./src/ffmpeg/ffbuild/config.log'
tail -50 build.log
tail -50 ./src/ffmpeg/ffbuild/config.log

View File

@ -17,21 +17,19 @@ jobs:
- name: set up xcode - name: set up xcode
run: echo "export DEVELOPER_DIR=/Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer" > ~/.xcode.for.ffmpeg.kit.sh run: echo "export DEVELOPER_DIR=/Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer" > ~/.xcode.for.ffmpeg.kit.sh
- name: run the build script - name: run the build script
run: ./ios.sh -d -x --disable-arm64 --disable-arm64e --disable-i386 --disable-x86-64 run: ./ios.sh --xcframework --enable-ios-audiotoolbox --enable-ios-avfoundation --enable-ios-bzip2 --enable-ios-libiconv --enable-ios-videotoolbox --enable-ios-zlib
- name: print success logs - name: print build logs
if: ${{ success() }} if: ${{ always() }}
run: cat build.log run: cat build.log
- name: print failure logs - name: print ffbuild logs
if: ${{ failure() }} if: ${{ failure() }}
run: | run: '[[ -f ./src/ffmpeg/ffbuild/config.log ]] && tail -50 ./src/ffmpeg/ffbuild/config.log'
tail -50 build.log
tail -50 ./src/ffmpeg/ffbuild/config.log
build-lts-on-macos: build-lts-on-macos:
name: ios lts name: ios lts
runs-on: macos-10.15 runs-on: macos-10.15
strategy: strategy:
matrix: matrix:
xcode: [ '10.3', '11.7', '12.4' ] xcode: [ '10.3', '11.7' ]
defaults: defaults:
run: run:
shell: bash shell: bash
@ -40,12 +38,10 @@ jobs:
- name: set up xcode - name: set up xcode
run: echo "export DEVELOPER_DIR=/Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer" > ~/.xcode.for.ffmpeg.kit.sh run: echo "export DEVELOPER_DIR=/Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer" > ~/.xcode.for.ffmpeg.kit.sh
- name: run the build script - name: run the build script
run: ./ios.sh -d -l --disable-arm64 --disable-arm64e --disable-i386 run: ./ios.sh --lts --enable-ios-audiotoolbox --enable-ios-bzip2 --enable-ios-libiconv --enable-ios-videotoolbox --enable-ios-zlib
- name: print success logs - name: print build logs
if: ${{ success() }} if: ${{ always() }}
run: cat build.log run: cat build.log
- name: print failure logs - name: print ffbuild logs
if: ${{ failure() }} if: ${{ failure() }}
run: | run: '[[ -f ./src/ffmpeg/ffbuild/config.log ]] && tail -50 ./src/ffmpeg/ffbuild/config.log'
tail -50 build.log
tail -50 ./src/ffmpeg/ffbuild/config.log

View File

@ -17,21 +17,19 @@ jobs:
- name: set up xcode - name: set up xcode
run: echo "export DEVELOPER_DIR=/Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer" > ~/.xcode.for.ffmpeg.kit.sh run: echo "export DEVELOPER_DIR=/Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer" > ~/.xcode.for.ffmpeg.kit.sh
- name: run the build script - name: run the build script
run: ./macos.sh -d -x --disable-arm64 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 success logs - name: print build logs
if: ${{ success() }} if: ${{ always() }}
run: cat build.log run: cat build.log
- name: print failure logs - name: print ffbuild logs
if: ${{ failure() }} if: ${{ failure() }}
run: | run: '[[ -f ./src/ffmpeg/ffbuild/config.log ]] && tail -50 ./src/ffmpeg/ffbuild/config.log'
tail -50 build.log
tail -50 ./src/ffmpeg/ffbuild/config.log
build-lts-on-macos: build-lts-on-macos:
name: macos lts name: macos lts
runs-on: macos-10.15 runs-on: macos-10.15
strategy: strategy:
matrix: matrix:
xcode: [ '10.3', '12.4' ] xcode: [ '10.3', '11.7' ]
defaults: defaults:
run: run:
shell: bash shell: bash
@ -40,12 +38,10 @@ jobs:
- name: set up xcode - name: set up xcode
run: echo "export DEVELOPER_DIR=/Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer" > ~/.xcode.for.ffmpeg.kit.sh run: echo "export DEVELOPER_DIR=/Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer" > ~/.xcode.for.ffmpeg.kit.sh
- name: run the build script - name: run the build script
run: ./macos.sh -d -l 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 success logs - name: print build logs
if: ${{ success() }} if: ${{ always() }}
run: cat build.log run: cat build.log
- name: print failure logs - name: print ffbuild logs
if: ${{ failure() }} if: ${{ failure() }}
run: | run: '[[ -f ./src/ffmpeg/ffbuild/config.log ]] && tail -50 ./src/ffmpeg/ffbuild/config.log'
tail -50 build.log
tail -50 ./src/ffmpeg/ffbuild/config.log

View File

@ -17,21 +17,19 @@ jobs:
- name: set up xcode - name: set up xcode
run: echo "export DEVELOPER_DIR=/Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer" > ~/.xcode.for.ffmpeg.kit.sh run: echo "export DEVELOPER_DIR=/Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer" > ~/.xcode.for.ffmpeg.kit.sh
- name: run the build script - name: run the build script
run: ./tvos.sh -d -x --disable-arm64 run: ./tvos.sh --xcframework --enable-tvos-bzip2 --enable-tvos-audiotoolbox --enable-tvos-libiconv --enable-tvos-videotoolbox --enable-tvos-zlib
- name: print success logs - name: print build logs
if: ${{ success() }} if: ${{ always() }}
run: cat build.log run: cat build.log
- name: print failure logs - name: print ffbuild logs
if: ${{ failure() }} if: ${{ failure() }}
run: | run: '[[ -f ./src/ffmpeg/ffbuild/config.log ]] && tail -50 ./src/ffmpeg/ffbuild/config.log'
tail -50 build.log
tail -50 ./src/ffmpeg/ffbuild/config.log
build-lts-on-macos: build-lts-on-macos:
name: tvos lts name: tvos lts
runs-on: macos-10.15 runs-on: macos-10.15
strategy: strategy:
matrix: matrix:
xcode: [ '10.3', '12.4' ] xcode: [ '10.3', '11.7' ]
defaults: defaults:
run: run:
shell: bash shell: bash
@ -40,12 +38,10 @@ jobs:
- name: set up xcode - name: set up xcode
run: echo "export DEVELOPER_DIR=/Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer" > ~/.xcode.for.ffmpeg.kit.sh run: echo "export DEVELOPER_DIR=/Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer" > ~/.xcode.for.ffmpeg.kit.sh
- name: run the build script - name: run the build script
run: ./tvos.sh -d -l --disable-arm64 run: ./tvos.sh --lts --enable-tvos-bzip2 --enable-tvos-audiotoolbox --enable-tvos-libiconv --enable-tvos-zlib
- name: print success logs - name: print build logs
if: ${{ success() }} if: ${{ always() }}
run: cat build.log run: cat build.log
- name: print failure logs - name: print ffbuild logs
if: ${{ failure() }} if: ${{ failure() }}
run: | run: '[[ -f ./src/ffmpeg/ffbuild/config.log ]] && tail -50 ./src/ffmpeg/ffbuild/config.log'
tail -50 build.log
tail -50 ./src/ffmpeg/ffbuild/config.log

View File

@ -121,15 +121,19 @@ This table shows the differences between two variants.
| Android API Level | 24 | 16 | | Android API Level | 24 | 16 |
| Android Camera Access | Yes | - | | Android Camera Access | Yes | - |
| Android Architectures | arm-v7a-neon<br/>arm64-v8a<br/>x86<br/>x86-64 | arm-v7a<br/>arm-v7a-neon<br/>arm64-v8a<br/>x86<br/>x86-64 | | Android Architectures | arm-v7a-neon<br/>arm64-v8a<br/>x86<br/>x86-64 | arm-v7a<br/>arm-v7a-neon<br/>arm64-v8a<br/>x86<br/>x86-64 |
| Xcode Compatibility | 11.0 or later | 7.3.1 or later | | Xcode Compatibility | 11.0 or later | 9.0 or later |
| iOS SDK | 12.1 | 9.3 | | iOS SDK | 12.1 | 11.0 |
| iOS AVFoundation | Yes | - | | iOS AVFoundation | Yes | - |
| iOS Architectures | arm64<br/>arm64-simulator<br/>arm64-mac-catalyst<br/>x86-64<br/>x86-64-mac-catalyst | armv7<br/>arm64<br/>i386<br/>x86-64 | | iOS Architectures | arm64<br/>arm64-simulator<br/>arm64-mac-catalyst<br/>x86-64<br/>x86-64-mac-catalyst | armv7<br/>arm64<br/>i386<br/>x86-64 |
| iOS Bundle Format | XCFrameworks | Frameworks |
| macOS SDK | 10.15 | 10.11 | | macOS SDK | 10.15 | 10.11 |
| macOS AVFoundation | Yes | - | | macOS AVFoundation | Yes | - |
| macOS Architectures | arm64<br/>x86-64 | x86-64 | | macOS Architectures | arm64<br/>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<br/>x86-64<br/>arm64-simulator | arm64<br/>x86-64 | | tvOS Architectures | arm64<br/>x86-64<br/>arm64-simulator | arm64<br/>x86-64 |
| tvOS Bundle Format | XCFrameworks | Frameworks |
### 9. Test Applications ### 9. Test Applications

View File

@ -22,7 +22,7 @@ enable_default_android_libraries
enable_main_build enable_main_build
# DETECT ANDROID NDK VERSION # 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 "\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 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 fi
if [[ ${ENABLED_ARCHITECTURES[ARCH_ARM_V7A]} -eq 1 ]]; then if [[ ${ENABLED_ARCHITECTURES[ARCH_ARM_V7A]} -eq 1 ]]; then
mkdir -p "${BASEDIR}"/android/build 1>>"${BASEDIR}"/build.log 2>&1 mkdir -p "${BASEDIR}"/android/build 1>>"${BASEDIR}"/build.log 2>&1
cat >"${BASEDIR}"/android/build/.armv7 <<EOF create_file "${BASEDIR}"/android/build/.armv7
EOF
fi fi
if [[ ${ENABLED_ARCHITECTURES[ARCH_ARM_V7A_NEON]} -eq 1 ]]; then if [[ ${ENABLED_ARCHITECTURES[ARCH_ARM_V7A_NEON]} -eq 1 ]]; then
mkdir -p "${BASEDIR}"/android/build 1>>"${BASEDIR}"/build.log 2>&1 mkdir -p "${BASEDIR}"/android/build 1>>"${BASEDIR}"/build.log 2>&1
cat >"${BASEDIR}"/android/build/.armv7neon <<EOF create_file "${BASEDIR}"/android/build/.armv7neon
EOF
fi fi
if [[ ${ENABLED_ARCHITECTURES[ARCH_ARM64_V8A]} -eq 1 ]]; then if [[ ${ENABLED_ARCHITECTURES[ARCH_ARM64_V8A]} -eq 1 ]]; then
ANDROID_ARCHITECTURES+="$(get_android_arch 2) " ANDROID_ARCHITECTURES+="$(get_android_arch 2) "
@ -249,8 +247,8 @@ if [[ ${ENABLED_ARCHITECTURES[ARCH_X86_64]} -eq 1 ]]; then
ANDROID_ARCHITECTURES+="$(get_android_arch 4) " ANDROID_ARCHITECTURES+="$(get_android_arch 4) "
fi fi
if [[ ! -z ${FFMPEG_KIT_LTS_BUILD} ]]; then if [[ ! -z ${FFMPEG_KIT_LTS_BUILD} ]]; then
cat >"${BASEDIR}"/android/build/.lts <<EOF mkdir -p "${BASEDIR}"/android/build 1>>"${BASEDIR}"/build.log 2>&1
EOF create_file "${BASEDIR}"/android/build/.lts
fi fi
# BUILD FFMPEG-KIT # BUILD FFMPEG-KIT

View File

@ -53,7 +53,7 @@ struct CallbackData {
}; };
/** Session control variables */ /** Session control variables */
const int SESSION_MAP_SIZE = 1000; #define SESSION_MAP_SIZE 1000
static atomic_short sessionMap[SESSION_MAP_SIZE]; static atomic_short sessionMap[SESSION_MAP_SIZE];
static atomic_int sessionInTransitMessageCountMap[SESSION_MAP_SIZE]; static atomic_int sessionInTransitMessageCountMap[SESSION_MAP_SIZE];

View File

@ -504,7 +504,12 @@ static BOOL WINAPI CtrlHandler(DWORD fdwCtrlType)
void term_init(void) void term_init(void)
{ {
#if defined __linux__ #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; action.sa_handler = sigterm_handler;
/* block other interrupts while processing this one */ /* block other interrupts while processing this one */

View File

@ -54,7 +54,7 @@ static NSMutableArray* sessionHistoryList;
static NSRecursiveLock* sessionHistoryLock; static NSRecursiveLock* sessionHistoryLock;
/** Session control variables */ /** Session control variables */
const int SESSION_MAP_SIZE = 1000; #define SESSION_MAP_SIZE 1000
static atomic_short sessionMap[SESSION_MAP_SIZE]; static atomic_short sessionMap[SESSION_MAP_SIZE];
static atomic_int sessionInTransitMessageCountMap[SESSION_MAP_SIZE]; static atomic_int sessionInTransitMessageCountMap[SESSION_MAP_SIZE];

View File

@ -501,7 +501,12 @@ static BOOL WINAPI CtrlHandler(DWORD fdwCtrlType)
void term_init(void) void term_init(void)
{ {
#if defined __linux__ #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; action.sa_handler = sigterm_handler;
/* block other interrupts while processing this one */ /* block other interrupts while processing this one */

10
ios.sh
View File

@ -28,7 +28,7 @@ if [[ -f ${XCODE_FOR_FFMPEG_KIT} ]]; then
fi fi
# DETECT IOS SDK VERSION # 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 "\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 echo -e "INFO: Build options: $*\n" 1>>"${BASEDIR}"/build.log 2>&1
@ -130,14 +130,6 @@ while [ ! $# -eq 0 ]; do
shift shift
done 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 # PROCESS FULL OPTION AS LAST OPTION
if [[ -n ${BUILD_FULL} ]]; then if [[ -n ${BUILD_FULL} ]]; then
for library in {0..58}; do for library in {0..58}; do

View File

@ -28,7 +28,7 @@ if [[ -f ${XCODE_FOR_FFMPEG_KIT} ]]; then
fi fi
# DETECT MACOS SDK VERSION # 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: 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 echo -e "\nINFO: Build options: $*\n" 1>>"${BASEDIR}"/build.log 2>&1
@ -130,14 +130,6 @@ while [ ! $# -eq 0 ]; do
shift shift
done 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 # PROCESS FULL OPTION AS LAST OPTION
if [[ -n ${BUILD_FULL} ]]; then if [[ -n ${BUILD_FULL} ]]; then
for library in {0..58}; do for library in {0..58}; do

View File

@ -207,7 +207,14 @@ get_common_cflags() {
local LTS_BUILD__FLAG="-DFFMPEG_KIT_LTS " local LTS_BUILD__FLAG="-DFFMPEG_KIT_LTS "
fi 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() { get_arch_specific_cflags() {
@ -222,10 +229,24 @@ get_arch_specific_cflags() {
echo "-march=armv8-a -DFFMPEG_KIT_ARM64_V8A" echo "-march=armv8-a -DFFMPEG_KIT_ARM64_V8A"
;; ;;
x86) 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) 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 esac
} }
@ -294,7 +315,7 @@ get_app_specific_cflags() {
rubberband) rubberband)
APP_FLAGS="-std=c99 -Wno-unused-function" APP_FLAGS="-std=c99 -Wno-unused-function"
;; ;;
shine) libvpx | shine)
APP_FLAGS="-Wno-unused-function" APP_FLAGS="-Wno-unused-function"
;; ;;
soxr | snappy | libwebp) soxr | snappy | libwebp)
@ -814,9 +835,8 @@ Name: x265
Description: H.265/HEVC video encoder Description: H.265/HEVC video encoder
Version: ${X265_VERSION} Version: ${X265_VERSION}
Requires:
Libs: -L\${libdir} -lx265 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} Cflags: -I\${includedir}
EOF EOF
} }
@ -953,7 +973,6 @@ set_toolchain_paths() {
HOST=$(get_host) HOST=$(get_host)
export AR=${HOST}-ar
export CC=$(get_clang_host)-clang export CC=$(get_clang_host)-clang
export CXX=$(get_clang_host)-clang++ export CXX=$(get_clang_host)-clang++
@ -968,12 +987,22 @@ set_toolchain_paths() {
export ac_cv_c_bigendian=no export ac_cv_c_bigendian=no
;; ;;
esac esac
case ${DETECTED_NDK_VERSION} in
export LD=${HOST}-ld 23*)
export RANLIB=${HOST}-ranlib export AR=llvm-ar
export STRIP=${HOST}-strip export LD=lld
export NM=${HOST}-nm 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 INSTALL_PKG_CONFIG_DIR="${BASEDIR}"/prebuilt/$(get_build_directory)/pkgconfig
export ZLIB_PACKAGE_CONFIG_PATH="${INSTALL_PKG_CONFIG_DIR}/zlib.pc" export ZLIB_PACKAGE_CONFIG_PATH="${INSTALL_PKG_CONFIG_DIR}/zlib.pc"
@ -1006,6 +1035,6 @@ build_android_lts_support() {
LDFLAGS=$(get_ldflags ${LIB_NAME}) LDFLAGS=$(get_ldflags ${LIB_NAME})
# BUILD # 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 "${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
"${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 "${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
} }

View File

@ -65,8 +65,8 @@ enable_main_build() {
enable_lts_build() { enable_lts_build() {
export FFMPEG_KIT_LTS_BUILD="1" export FFMPEG_KIT_LTS_BUILD="1"
# XCODE 7.3 HAS IOS SDK 9.3 # XCODE 9.0 HAS IOS SDK 11.0
export IOS_MIN_VERSION=9.3 export IOS_MIN_VERSION=11.0
} }
get_common_includes() { get_common_includes() {

View File

@ -47,7 +47,7 @@ set explicitly. When compilation ends, libraries are created under the prebuilt
} }
enable_main_build() { enable_main_build() {
export TVOS_MIN_VERSION=10.2 export TVOS_MIN_VERSION=11.0
} }
enable_lts_build() { enable_lts_build() {

View File

@ -1781,3 +1781,11 @@ overwrite_file() {
rm -f "$2" rm -f "$2"
cp "$1" "$2" cp "$1" "$2"
} }
#
# 1. destination file
#
create_file() {
rm -f "$1"
echo "" > "$1" 1>>"${BASEDIR}"/build.log 2>&1
}

10
tvos.sh
View File

@ -28,7 +28,7 @@ if [[ -f ${XCODE_FOR_FFMPEG_KIT} ]]; then
fi fi
# DETECT TVOS SDK VERSION # 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: 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 echo -e "\nINFO: Build options: $*\n" 1>>"${BASEDIR}"/build.log 2>&1
@ -130,14 +130,6 @@ while [ ! $# -eq 0 ]; do
shift shift
done 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 # PROCESS FULL OPTION AS LAST OPTION
if [[ -n ${BUILD_FULL} ]]; then if [[ -n ${BUILD_FULL} ]]; then
for library in {0..58}; do for library in {0..58}; do