Skip to content

Commit

Permalink
fix android github action errors
Browse files Browse the repository at this point in the history
  • Loading branch information
tanersener committed Aug 15, 2021
1 parent 98bb5c7 commit 4ce973e
Show file tree
Hide file tree
Showing 17 changed files with 157 additions and 168 deletions.
104 changes: 40 additions & 64 deletions .github/workflows/android-build-scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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'
26 changes: 11 additions & 15 deletions .github/workflows/ios-build-scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'
26 changes: 11 additions & 15 deletions .github/workflows/macos-build-scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'
26 changes: 11 additions & 15 deletions .github/workflows/tvos-build-scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<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 |
| 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<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 AVFoundation | Yes | - |
| 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 Bundle Format | XCFrameworks | Frameworks |

### 9. Test Applications

Expand Down
12 changes: 5 additions & 7 deletions android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 <<EOF
EOF
create_file "${BASEDIR}"/android/build/.armv7
fi
if [[ ${ENABLED_ARCHITECTURES[ARCH_ARM_V7A_NEON]} -eq 1 ]]; then
mkdir -p "${BASEDIR}"/android/build 1>>"${BASEDIR}"/build.log 2>&1
cat >"${BASEDIR}"/android/build/.armv7neon <<EOF
EOF
create_file "${BASEDIR}"/android/build/.armv7neon
fi
if [[ ${ENABLED_ARCHITECTURES[ARCH_ARM64_V8A]} -eq 1 ]]; then
ANDROID_ARCHITECTURES+="$(get_android_arch 2) "
Expand All @@ -249,8 +247,8 @@ if [[ ${ENABLED_ARCHITECTURES[ARCH_X86_64]} -eq 1 ]]; then
ANDROID_ARCHITECTURES+="$(get_android_arch 4) "
fi
if [[ ! -z ${FFMPEG_KIT_LTS_BUILD} ]]; then
cat >"${BASEDIR}"/android/build/.lts <<EOF
EOF
mkdir -p "${BASEDIR}"/android/build 1>>"${BASEDIR}"/build.log 2>&1
create_file "${BASEDIR}"/android/build/.lts
fi

# BUILD FFMPEG-KIT
Expand Down
2 changes: 1 addition & 1 deletion android/ffmpeg-kit-android-lib/src/main/cpp/ffmpegkit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand Down
7 changes: 6 additions & 1 deletion android/ffmpeg-kit-android-lib/src/main/cpp/fftools_ffmpeg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion apple/src/FFmpegKitConfig.m
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
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];

Expand Down
Loading

0 comments on commit 4ce973e

Please sign in to comment.