diff --git a/.github/workflows/android-build-scripts.yml b/.github/workflows/android-build-scripts.yml index 74f7d12..c5ca558 100644 --- a/.github/workflows/android-build-scripts.yml +++ b/.github/workflows/android-build-scripts.yml @@ -5,9 +5,21 @@ on: branches: - development - main + paths: + - '.github/workflows/android-build-scripts.yml' + - 'android/**' + - 'scripts/**' + - 'tools/**' + - 'android.sh' pull_request: branches: - main + paths: + - '.github/workflows/android-build-scripts.yml' + - 'android/**' + - 'scripts/**' + - 'tools/**' + - 'android.sh' jobs: build-main-on-linux: @@ -126,3 +138,32 @@ jobs: - name: print ffbuild logs if: ${{ failure() }} run: '[[ -f ./src/ffmpeg/ffbuild/config.log ]] && tail -50 ./src/ffmpeg/ffbuild/config.log' + build-main-without-ffmpeg-kit-protocols-on-linux: + name: build without ffmpeg-kit protocols + runs-on: ubuntu-20.04 + strategy: + matrix: + ndk-version: [ 'r22b-linux-x86_64' ] + defaults: + run: + shell: bash + steps: + - uses: actions/checkout@v2 + - name: set up adopt jdk 8 + uses: actions/setup-java@v2.2.0 + with: + distribution: 'adopt' + java-version: '8' + - 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 + echo "ANDROID_NDK_ROOT=$PWD/.ndk/$(ls .ndk)" >> $GITHUB_ENV + - name: run the build script + run: ./android.sh --no-ffmpeg-kit-protocols --disable-x86 --disable-x86-64 --disable-arm-v7a --disable-arm-v7a-neon + - name: print build logs + if: ${{ always() }} + run: cat build.log + - name: print ffbuild logs + if: ${{ failure() }} + 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 1160b7a..3d2f0f6 100644 --- a/.github/workflows/ios-build-scripts.yml +++ b/.github/workflows/ios-build-scripts.yml @@ -5,9 +5,23 @@ on: branches: - development - main + paths: + - '.github/workflows/ios-build-scripts.yml' + - 'apple/**' + - 'scripts/**' + - 'tools/**' + - 'apple.sh' + - 'ios.sh' pull_request: branches: - main + paths: + - '.github/workflows/ios-build-scripts.yml' + - 'apple/**' + - 'scripts/**' + - 'tools/**' + - 'apple.sh' + - 'ios.sh' jobs: build-main-on-macos-bigsur: diff --git a/.github/workflows/macos-build-scripts.yml b/.github/workflows/macos-build-scripts.yml index 7ba06ff..39d7e55 100644 --- a/.github/workflows/macos-build-scripts.yml +++ b/.github/workflows/macos-build-scripts.yml @@ -5,9 +5,23 @@ on: branches: - development - main + paths: + - '.github/workflows/macos-build-scripts.yml' + - 'apple/**' + - 'scripts/**' + - 'tools/**' + - 'apple.sh' + - 'macos.sh' pull_request: branches: - main + paths: + - '.github/workflows/macos-build-scripts.yml' + - 'apple/**' + - 'scripts/**' + - 'tools/**' + - 'apple.sh' + - 'macos.sh' jobs: build-main-on-macos-bigsur: diff --git a/.github/workflows/periodic-builds-apple.yml b/.github/workflows/periodic-builds-apple.yml index cf1e24d..11048ee 100644 --- a/.github/workflows/periodic-builds-apple.yml +++ b/.github/workflows/periodic-builds-apple.yml @@ -20,11 +20,11 @@ jobs: with: ref: ${{ matrix.branches }} - name: prerequisites - run: brew install autoconf automake libtool pkg-config curl git cmake gcc gperf texinfo yasm nasm bison autogen wget meson ninja + run: brew install autoconf automake libtool pkg-config curl git cmake gcc gperf texinfo yasm nasm bison autogen wget meson ninja ragel --overwrite - 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: PATH="/usr/local/opt/bison/bin:$PATH" ./ios.sh -x --full --enable-gpl --disable-lib-srt + run: PATH="/usr/local/opt/bison/bin:$PATH" XML_CATALOG_FILES="/usr/local/etc/xml/catalog" ./ios.sh -x --full --enable-gpl --disable-lib-srt - name: print build logs if: ${{ always() }} run: cat build.log @@ -46,11 +46,11 @@ jobs: with: ref: ${{ matrix.branches }} - name: prerequisites - run: brew install autoconf automake libtool pkg-config curl git cmake gcc gperf texinfo yasm nasm bison autogen wget meson ninja + run: brew install autoconf automake libtool pkg-config curl git cmake gcc gperf texinfo yasm nasm bison autogen wget meson ninja ragel --overwrite - 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: PATH="/usr/local/opt/bison/bin:$PATH" ./ios.sh -l --full --enable-gpl --disable-lib-srt + run: PATH="/usr/local/opt/bison/bin:$PATH" XML_CATALOG_FILES="/usr/local/etc/xml/catalog" ./ios.sh -l --full --enable-gpl --disable-lib-srt - name: print build logs if: ${{ always() }} run: cat build.log @@ -72,11 +72,11 @@ jobs: with: ref: ${{ matrix.branches }} - name: prerequisites - run: brew install autoconf automake libtool pkg-config curl git cmake gcc gperf texinfo yasm nasm bison autogen wget meson ninja + run: brew install autoconf automake libtool pkg-config curl git cmake gcc gperf texinfo yasm nasm bison autogen wget meson ninja ragel --overwrite - 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: PATH="/usr/local/opt/bison/bin:$PATH" ./macos.sh -x --full --enable-gpl --disable-lib-srt + run: PATH="/usr/local/opt/bison/bin:$PATH" XML_CATALOG_FILES="/usr/local/etc/xml/catalog" ./macos.sh -x --full --enable-gpl --disable-lib-srt - name: print build logs if: ${{ always() }} run: cat build.log @@ -98,11 +98,11 @@ jobs: with: ref: ${{ matrix.branches }} - name: prerequisites - run: brew install autoconf automake libtool pkg-config curl git cmake gcc gperf texinfo yasm nasm bison autogen wget meson ninja + run: brew install autoconf automake libtool pkg-config curl git cmake gcc gperf texinfo yasm nasm bison autogen wget meson ninja ragel --overwrite - 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: PATH="/usr/local/opt/bison/bin:$PATH" ./macos.sh -l --full --enable-gpl --disable-lib-srt + run: PATH="/usr/local/opt/bison/bin:$PATH" XML_CATALOG_FILES="/usr/local/etc/xml/catalog" ./macos.sh -l --full --enable-gpl --disable-lib-srt - name: print build logs if: ${{ always() }} run: cat build.log @@ -124,11 +124,11 @@ jobs: with: ref: ${{ matrix.branches }} - name: prerequisites - run: brew install autoconf automake libtool pkg-config curl git cmake gcc gperf texinfo yasm nasm bison autogen wget meson ninja + run: brew install autoconf automake libtool pkg-config curl git cmake gcc gperf texinfo yasm nasm bison autogen wget meson ninja ragel --overwrite - 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: PATH="/usr/local/opt/bison/bin:$PATH" ./tvos.sh -x --full --enable-gpl --disable-lib-srt + run: PATH="/usr/local/opt/bison/bin:$PATH" XML_CATALOG_FILES="/usr/local/etc/xml/catalog" ./tvos.sh -x --full --enable-gpl --disable-lib-srt - name: print build logs if: ${{ always() }} run: cat build.log @@ -150,11 +150,11 @@ jobs: with: ref: ${{ matrix.branches }} - name: prerequisites - run: brew install autoconf automake libtool pkg-config curl git cmake gcc gperf texinfo yasm nasm bison autogen wget meson ninja + run: brew install autoconf automake libtool pkg-config curl git cmake gcc gperf texinfo yasm nasm bison autogen wget meson ninja ragel --overwrite - 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: PATH="/usr/local/opt/bison/bin:$PATH" ./tvos.sh -l --full --enable-gpl --disable-lib-srt + run: PATH="/usr/local/opt/bison/bin:$PATH" XML_CATALOG_FILES="/usr/local/etc/xml/catalog" ./tvos.sh -l --full --enable-gpl --disable-lib-srt - name: print build logs if: ${{ always() }} run: cat build.log diff --git a/.github/workflows/tvos-build-scripts.yml b/.github/workflows/tvos-build-scripts.yml index 20f341f..a8523c7 100644 --- a/.github/workflows/tvos-build-scripts.yml +++ b/.github/workflows/tvos-build-scripts.yml @@ -5,9 +5,23 @@ on: branches: - development - main + paths: + - '.github/workflows/tvos-build-scripts.yml' + - 'apple/**' + - 'scripts/**' + - 'tools/**' + - 'apple.sh' + - 'tvos.sh' pull_request: branches: - main + paths: + - '.github/workflows/tvos-build-scripts.yml' + - 'apple/**' + - 'scripts/**' + - 'tools/**' + - 'apple.sh' + - 'tvos.sh' jobs: build-main-on-macos-bigsur: diff --git a/android/README.md b/android/README.md index 7c14acb..11ad82c 100644 --- a/android/README.md +++ b/android/README.md @@ -77,7 +77,7 @@ All libraries created by `android.sh` can be found under the `prebuilt` director } dependencies { - implementation 'com.arthenica:ffmpeg-kit-full:4.5.1' + implementation 'com.arthenica:ffmpeg-kit-full:4.5.1-1' } ``` diff --git a/android/build.gradle b/android/build.gradle index 416b90c..338aa18 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,7 +1,7 @@ buildscript { repositories { google() - jcenter() + mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:4.2.2' @@ -11,7 +11,7 @@ buildscript { allprojects { repositories { google() - jcenter() + mavenCentral() } } diff --git a/apple/README.md b/apple/README.md index 821ae37..1edd4c2 100644 --- a/apple/README.md +++ b/apple/README.md @@ -66,7 +66,7 @@ Please note that `FFmpegKit` project repository includes the source code of `FFm Use your package manager (brew, etc.) to install the following packages. ``` -autoconf automake libtool pkg-config curl cmake gcc gperf texinfo yasm nasm bison autogen git wget autopoint meson ninja +autoconf automake libtool pkg-config curl cmake gcc gperf texinfo yasm nasm bison autogen git wget gettext meson ninja ``` #### 2.2 Options diff --git a/scripts/android/ffmpeg.sh b/scripts/android/ffmpeg.sh index 7b6d2d7..6ec6967 100755 --- a/scripts/android/ffmpeg.sh +++ b/scripts/android/ffmpeg.sh @@ -405,7 +405,7 @@ ${SED_INLINE} "s/\$version/$FFMPEG_VERSION/g" "${BASEDIR}"/src/"${LIB_NAME}"/ffb # 3. Enable ffmpeg-kit protocols if [[ ${NO_FFMPEG_KIT_PROTOCOLS} == "1" ]]; then - ${SED_INLINE} "s/ av_set_fd_close/\/\/av_set_fd_close/g" "${BASEDIR}"/android/ffmpeg-kit-android-lib/src/main/cpp/ffmpegkit.c 1>>"${BASEDIR}"/build.log 2>&1 + ${SED_INLINE} "s| av_set_saf|//av_set_saf|g" "${BASEDIR}"/android/ffmpeg-kit-android-lib/src/main/cpp/ffmpegkit.c 1>>"${BASEDIR}"/build.log 2>&1 echo -e "\nINFO: Disabled custom ffmpeg-kit protocols\n" 1>>"${BASEDIR}"/build.log 2>&1 else cat ../../tools/protocols/libavformat_file.c >> libavformat/file.c diff --git a/scripts/apple/ffmpeg.sh b/scripts/apple/ffmpeg.sh index 7142f69..990e922 100755 --- a/scripts/apple/ffmpeg.sh +++ b/scripts/apple/ffmpeg.sh @@ -99,6 +99,7 @@ x86-64-mac-catalyst) esac CONFIGURE_POSTFIX="" +HIGH_PRIORITY_LDFLAGS="" # SET CONFIGURE OPTIONS for library in {0..61}; do @@ -294,6 +295,7 @@ for library in {0..61}; do expat) FFMPEG_CFLAGS+=" $(pkg-config --cflags expat 2>>"${BASEDIR}"/build.log)" FFMPEG_LDFLAGS+=" $(pkg-config --libs --static expat 2>>"${BASEDIR}"/build.log)" + HIGH_PRIORITY_LDFLAGS+=" $(pkg-config --libs --static expat 2>>"${BASEDIR}"/build.log)" ;; libogg) FFMPEG_CFLAGS+=" $(pkg-config --cflags ogg 2>>"${BASEDIR}"/build.log)" @@ -449,7 +451,7 @@ COMMON_LDFLAGS=$(get_common_ldflags) # UPDATE BUILD FLAGS export CFLAGS="${ARCH_CFLAGS} ${APP_CFLAGS} ${COMMON_CFLAGS} ${OPTIMIZATION_CFLAGS} ${MIN_VERSION_CFLAGS}${FFMPEG_CFLAGS} ${COMMON_INCLUDES}" export CXXFLAGS=$(get_cxxflags "${LIB_NAME}") -export LDFLAGS="${ARCH_LDFLAGS}${FFMPEG_LDFLAGS} ${LINKED_LIBRARIES} ${COMMON_LDFLAGS} ${BITCODE_FLAGS} ${OPTIMIZATION_FLAGS}" +export LDFLAGS="${ARCH_LDFLAGS}${HIGH_PRIORITY_LDFLAGS}${FFMPEG_LDFLAGS} ${LINKED_LIBRARIES} ${COMMON_LDFLAGS} ${BITCODE_FLAGS} ${OPTIMIZATION_FLAGS}" echo -n -e "\n${LIB_NAME}: "