mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-08 15:50:16 +02:00
Add experimental MPV player backend (#161)
Experimental MPV player backend Related to #14, #22, & #85 You can switch to MPV in advanced settings and toggle using hardware decoding or not. This uses code and buildscripts from https://github.com/mpv-android/mpv-android, plus other third party libraries to build MPV
This commit is contained in:
parent
d7b333e519
commit
6be2662d4e
84 changed files with 3987 additions and 289 deletions
79
.github/actions/native-build/action.yml
vendored
Normal file
79
.github/actions/native-build/action.yml
vendored
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
name: "Native build"
|
||||
description: "Performs native builds"
|
||||
inputs:
|
||||
cache:
|
||||
description: "Whether to use the cache or not"
|
||||
required: true
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Load ffmpeg module cache
|
||||
id: cache_ffmpeg_module
|
||||
if: ${{ inputs.cache }}
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: |
|
||||
app/libs
|
||||
key: ${{ runner.os }}-ffmpeg-${{ hashFiles('**/libs.versions.toml', '**/scripts/ffmpeg/build_ffmpeg_decoder.sh') }}
|
||||
- name: Build ffmpeg decoder
|
||||
id: ffmpeg-decoder
|
||||
if: steps.cache_ffmpeg_module.outputs.cache-hit != 'true'
|
||||
shell: bash
|
||||
run: |
|
||||
cd scripts/ffmpeg
|
||||
./build_ffmpeg_decoder.sh "${{ env.ANDROID_SDK_ROOT }}/ndk/${{ env.NDK_VERSION }}"
|
||||
- name: Save ffmpeg module cache
|
||||
id: cache_ffmpeg_module_save
|
||||
uses: actions/cache/save@v4
|
||||
with:
|
||||
path: |
|
||||
app/libs
|
||||
key: ${{ steps.cache_ffmpeg_module.outputs.cache-primary-key }}
|
||||
|
||||
- name: Load libmpv module cache
|
||||
id: cache_libmpv_module
|
||||
if: ${{ inputs.cache }}
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: |
|
||||
app/src/main/libs
|
||||
key: ${{ runner.os }}-libmpv-${{ hashFiles('**/scripts/mpv/*.sh', '**/scripts/mpv/include/*', '**/scripts/mpv/scripts/*', 'app/src/main/jni/*') }}
|
||||
|
||||
- name: Install dependencies
|
||||
if: steps.cache_libmpv_module.outputs.cache-hit != 'true'
|
||||
shell: bash
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install jsonschema jinja2
|
||||
sudo apt update
|
||||
sudo apt install -y build-essential autoconf pkg-config libtool ninja-build unzip wget meson
|
||||
- name: Get libmpv dependencies
|
||||
if: steps.cache_libmpv_module.outputs.cache-hit != 'true'
|
||||
shell: bash
|
||||
run: |
|
||||
cd scripts/mpv
|
||||
./get_dependencies.sh
|
||||
- name: Build libmpv dependencies
|
||||
if: steps.cache_libmpv_module.outputs.cache-hit != 'true'
|
||||
shell: bash
|
||||
run: |
|
||||
cd scripts/mpv
|
||||
./buildall.sh --clean --arch arm64 mpv
|
||||
./buildall.sh mpv
|
||||
cd ../..
|
||||
env PREFIX32="$(realpath scripts/mpv/prefix/armv7l)" PREFIX64="$(realpath scripts/mpv/prefix/arm64)" ndk-build -C app/src/main -j
|
||||
|
||||
- name: Setup jniLibs
|
||||
shell: bash
|
||||
run: |
|
||||
cd app/src/main
|
||||
mkdir -p jniLibs
|
||||
cp -r libs/* jniLibs
|
||||
#ln -s libs jniLibs
|
||||
- name: Save libmpv module cache
|
||||
id: cache_libmpv_module_save
|
||||
uses: actions/cache/save@v4
|
||||
with:
|
||||
path: |
|
||||
app/src/main/libs
|
||||
key: ${{ steps.cache_libmpv_module.outputs.cache-primary-key }}
|
||||
31
.github/actions/setup/action.yml
vendored
Normal file
31
.github/actions/setup/action.yml
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
name: Setup
|
||||
description: "Setup the environment"
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
# Setup the SDKs
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.12'
|
||||
- name: Setup JDK
|
||||
uses: actions/setup-java@v5
|
||||
with:
|
||||
distribution: zulu
|
||||
java-version: '21'
|
||||
cache: 'gradle'
|
||||
- name: Set versions
|
||||
shell: bash
|
||||
run: |
|
||||
echo "BUILD_TOOLS_VERSION=36.0.0" >> $GITHUB_ENV
|
||||
echo "NDK_VERSION=29.0.14206865" >> $GITHUB_ENV
|
||||
- name: Setup Android SDK
|
||||
uses: android-actions/setup-android@v3
|
||||
with:
|
||||
packages: "tools platform-tools build-tools;${{ env.BUILD_TOOLS_VERSION }} ndk;${{ env.NDK_VERSION }}"
|
||||
- name: Add NDK to path
|
||||
shell: bash
|
||||
run: |
|
||||
echo "Adding to path: ${{ env.ANDROID_SDK_ROOT }}/ndk/${{ env.NDK_VERSION }}:${{ env.ANDROID_SDK_ROOT }}/ndk/${{ env.NDK_VERSION }}/toolchains/llvm/prebuilt/linux-x86_64/bin"
|
||||
echo "${{ env.ANDROID_SDK_ROOT }}/ndk/${{ env.NDK_VERSION }}:${{ env.ANDROID_SDK_ROOT }}/ndk/${{ env.NDK_VERSION }}/toolchains/llvm/prebuilt/linux-x86_64/bin" >> $GITHUB_PATH
|
||||
Loading…
Add table
Add a link
Reference in a new issue