mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-08 15:50:16 +02:00
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
48 lines
1.3 KiB
Bash
Executable file
48 lines
1.3 KiB
Bash
Executable file
#!/bin/bash -e
|
|
|
|
. ../../include/path.sh
|
|
|
|
if [ "$1" == "build" ]; then
|
|
true
|
|
elif [ "$1" == "clean" ]; then
|
|
rm -rf _build$ndk_suffix
|
|
exit 0
|
|
else
|
|
exit 255
|
|
fi
|
|
|
|
mkdir -p _build$ndk_suffix
|
|
cd _build$ndk_suffix
|
|
|
|
cpu=armv7-a
|
|
[[ "$ndk_triple" == "aarch64"* ]] && cpu=armv8-a
|
|
[[ "$ndk_triple" == "x86_64"* ]] && cpu=generic
|
|
[[ "$ndk_triple" == "i686"* ]] && cpu="i686 --disable-asm"
|
|
|
|
cpuflags=
|
|
[[ "$ndk_triple" == "arm"* ]] && cpuflags="$cpuflags -mfpu=neon -mcpu=cortex-a8"
|
|
|
|
args=(
|
|
--target-os=android --enable-cross-compile
|
|
--cross-prefix=$ndk_triple- --cc=$CC --pkg-config=pkg-config --nm=llvm-nm
|
|
--arch=${ndk_triple%%-*} --cpu=$cpu
|
|
--extra-cflags="-I$prefix_dir/include $cpuflags" --extra-ldflags="-L$prefix_dir/lib"
|
|
|
|
--enable-{jni,mediacodec,mbedtls,libdav1d} --disable-vulkan
|
|
--disable-static --enable-shared --enable-{gpl,version3}
|
|
|
|
# disable unneeded parts
|
|
--disable-{stripping,doc,programs}
|
|
# to keep the build lean we disable some feature quite aggressively:
|
|
# - muxers, encoders: mpv-android does not have any way to use these
|
|
# - devices: no practical use on Android
|
|
--disable-{muxers,encoders,devices}
|
|
# useful to taking screenshots
|
|
--enable-encoder=mjpeg,png
|
|
# useful for the `dump-cache` command
|
|
--enable-muxer=mov,matroska,mpegts
|
|
)
|
|
../configure "${args[@]}"
|
|
|
|
make -j$cores
|
|
make DESTDIR="$prefix_dir" install
|