From 56e82f9ed0af85253ab06e1c7b0875fdf4c27f6e Mon Sep 17 00:00:00 2001 From: hanbowen Date: Thu, 16 Jun 2022 16:24:20 +0800 Subject: [PATCH 1/6] add libbluray --- scripts/libbluray/build.sh | 24 ++++++++++++++++++++++++ scripts/libbluray/download.sh | 10 ++++++++++ scripts/parse-arguments.sh | 5 +++++ 3 files changed, 39 insertions(+) create mode 100755 scripts/libbluray/build.sh create mode 100755 scripts/libbluray/download.sh diff --git a/scripts/libbluray/build.sh b/scripts/libbluray/build.sh new file mode 100755 index 0000000..8791124 --- /dev/null +++ b/scripts/libbluray/build.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +LIBLURAY_ADDITIONAL_FLAGS= + +CC=${FAM_CC} \ +AR=${FAM_AR} \ +AS=${X264_AS} \ +RANLIB=${FAM_RANLIB} \ +STRIP=${FAM_STRIP} \ +LIBS="-lz" \ +./configure \ + --prefix=${INSTALL_DIR} \ + --host=${TARGET} \ + --with-sysroot=${SYSROOT_PATH} \ + --enable-static \ + --with-pic \ + --without-libxml2 \ + --without-fontconfig \ + --disable-bdjava-jar \ + ${LIBLURAY_ADDITIONAL_FLAGS} || exit 1 + +${MAKE_EXECUTABLE} clean +${MAKE_EXECUTABLE} -j${HOST_NPROC} +${MAKE_EXECUTABLE} install diff --git a/scripts/libbluray/download.sh b/scripts/libbluray/download.sh new file mode 100755 index 0000000..cf86e19 --- /dev/null +++ b/scripts/libbluray/download.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +source ${SCRIPTS_DIR}/common-functions.sh + +LIBBLURAY_VERSION=1.3.1 + +downloadTarArchive \ + "libbluray" \ + "https://download.videolan.org/pub/videolan/libbluray/${LIBBLURAY_VERSION}/libbluray-${LIBBLURAY_VERSION}.tar.bz2" + diff --git a/scripts/parse-arguments.sh b/scripts/parse-arguments.sh index b8cdc43..862f06d 100755 --- a/scripts/parse-arguments.sh +++ b/scripts/parse-arguments.sh @@ -25,6 +25,7 @@ SUPPORTED_LIBRARIES_FREE=( "libwebp" "libfreetype" "libfribidi" + "libbluray" ) # All GPL libraries that are supported @@ -111,6 +112,10 @@ for argument in "$@"; do EXTERNAL_LIBRARIES+=("libx264") FFMPEG_GPL_ENABLED=true ;; + --enable-libbluray | -libbluray) + EXTERNAL_LIBRARIES+=("libfreetype") + EXTERNAL_LIBRARIES+=("libbluray") + ;; --enable-all-free | -all-free) EXTERNAL_LIBRARIES+=" ${SUPPORTED_LIBRARIES_FREE[@]}" ;; From 442d228292673c9f65b66bb55a214e42cc773b06 Mon Sep 17 00:00:00 2001 From: hanbowen Date: Thu, 16 Jun 2022 16:25:17 +0800 Subject: [PATCH 2/6] add ffmpeg flag --enable-jni --enable-mediacodec --- scripts/ffmpeg/build.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/ffmpeg/build.sh b/scripts/ffmpeg/build.sh index 18f7b29..e312a54 100755 --- a/scripts/ffmpeg/build.sh +++ b/scripts/ffmpeg/build.sh @@ -42,6 +42,8 @@ DEP_LD_FLAGS="-L${BUILD_DIR_EXTERNAL}/${ANDROID_ABI}/lib $FFMPEG_EXTRA_LD_FLAGS" --extra-cflags="-O3 -fPIC $DEP_CFLAGS" \ --extra-ldflags="$DEP_LD_FLAGS" \ --enable-shared \ + --enable-jni \ + --enable-mediacodec \ --disable-static \ --pkg-config=${PKG_CONFIG_EXECUTABLE} \ ${EXTRA_BUILD_CONFIGURATION_FLAGS} \ From 7b253ef3c920f16610af305b0d53992e192f2a56 Mon Sep 17 00:00:00 2001 From: hanbowen Date: Thu, 16 Jun 2022 16:43:31 +0800 Subject: [PATCH 3/6] add ci --- .github/workflows/publish_release.yml | 48 +++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/publish_release.yml diff --git a/.github/workflows/publish_release.yml b/.github/workflows/publish_release.yml new file mode 100644 index 0000000..bd7bc01 --- /dev/null +++ b/.github/workflows/publish_release.yml @@ -0,0 +1,48 @@ +jobs: + release: + runs-on: ubuntu-latest + strategy: + matrix: + abi: [ "armeabi-v7a", "arm64-v8a", "x86", "x86_64" ] + fail-fast: true + steps: + - uses: actions/checkout@v2 + + - name: Setup the environment + run: | + sudo pip3 install meson==0.58.2 + sudo apt-get install nasm ninja-build + + - name: Executing the script + run: | + export ANDROID_SDK_HOME=$ANDROID_HOME + export ANDROID_NDK_HOME=$ANDROID_NDK_LATEST_HOME + ./ffmpeg-android-maker.sh -all-free -all-gpl -android=21 -abis=${{ matrix.abi }} + - name: Pack artifacts + run: tar -cf build.tar.gz build/ + + - name: Create Draft Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: + release_name: + draft: true + prerelease: false + + - uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./build.tar.gz + asset_name: build.tar.gz + asset_content_type: application/gz + + - uses: eregon/publish-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + release_id: ${{ steps.create_release.outputs.id }} From 86c44d0e5f2c91b8110414f8e7969afa970a9fcd Mon Sep 17 00:00:00 2001 From: hanbowen Date: Thu, 16 Jun 2022 16:49:40 +0800 Subject: [PATCH 4/6] trigger on manual --- .github/workflows/publish_release.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/publish_release.yml b/.github/workflows/publish_release.yml index bd7bc01..04feac6 100644 --- a/.github/workflows/publish_release.yml +++ b/.github/workflows/publish_release.yml @@ -1,3 +1,9 @@ +name: build release binaries +on: + workflow_dispatch: + inputs: + message: + required: false jobs: release: runs-on: ubuntu-latest From 7a4bf957206bffad0b10a6862359fa9198423f74 Mon Sep 17 00:00:00 2001 From: hanbowen Date: Thu, 16 Jun 2022 16:53:30 +0800 Subject: [PATCH 5/6] add options input --- .github/workflows/publish_release.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish_release.yml b/.github/workflows/publish_release.yml index 04feac6..88e4b81 100644 --- a/.github/workflows/publish_release.yml +++ b/.github/workflows/publish_release.yml @@ -2,14 +2,15 @@ name: build release binaries on: workflow_dispatch: inputs: - message: - required: false + build_options: + required: true + default: -libbluray -android=21 jobs: release: runs-on: ubuntu-latest strategy: matrix: - abi: [ "armeabi-v7a", "arm64-v8a", "x86", "x86_64" ] + abi: [ "armeabi-v7a", "arm64-v8a" ] fail-fast: true steps: - uses: actions/checkout@v2 @@ -23,7 +24,7 @@ jobs: run: | export ANDROID_SDK_HOME=$ANDROID_HOME export ANDROID_NDK_HOME=$ANDROID_NDK_LATEST_HOME - ./ffmpeg-android-maker.sh -all-free -all-gpl -android=21 -abis=${{ matrix.abi }} + ./ffmpeg-android-maker.sh ${{ build_options }} -abis=${{ matrix.abi }} - name: Pack artifacts run: tar -cf build.tar.gz build/ From 0ed117bea152ee9c61676001371fee04d5022b41 Mon Sep 17 00:00:00 2001 From: hanbowen Date: Thu, 16 Jun 2022 17:01:09 +0800 Subject: [PATCH 6/6] fix grammer --- .github/workflows/publish_release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish_release.yml b/.github/workflows/publish_release.yml index 88e4b81..682e6de 100644 --- a/.github/workflows/publish_release.yml +++ b/.github/workflows/publish_release.yml @@ -3,8 +3,9 @@ on: workflow_dispatch: inputs: build_options: + description: 'ffmepg build script options' required: true - default: -libbluray -android=21 + default: '-libbluray -android=21' jobs: release: runs-on: ubuntu-latest