build and use ffmpeg extension

pointing at my own repo for RNTP to enable extensions in exoplayer
new prepare script needs to be run to build ffmpeg
This commit is contained in:
austinried 2021-09-07 14:40:22 +09:00
parent 721a42f60f
commit 9d58e15b39
5 changed files with 34 additions and 4 deletions

3
.gitignore vendored
View File

@ -57,3 +57,6 @@ buck-out/
# CocoaPods
/ios/Pods/
# ffmpeg build
/ndk

View File

@ -225,6 +225,7 @@ dependencies {
exclude group:'com.google.android.exoplayer'
}
implementation project(':exoplayer-library-core')
implementation project(':exoplayer-extension-ffmpeg')
compileOnly project(':exoplayer-library-dash')
compileOnly project(':exoplayer-library-hls')
compileOnly project(':exoplayer-library-smoothstreaming')

View File

@ -42,7 +42,7 @@
"react-native-safe-area-context": "^3.2.0",
"react-native-screens": "^3.4.0",
"react-native-tab-view": "^2.16.0",
"react-native-track-player": "^2.0.3",
"react-native-track-player": "https://github.com/austinried/react-native-track-player",
"react-native-vector-icons": "^8.1.0",
"react-native-webview": "^11.13.0",
"uuid": "^8.3.2",

View File

@ -0,0 +1,27 @@
#!/bin/bash
set -e
dir=$(dirname "$(readlink -f "$0")")
root=$(realpath "$dir/..")
FFMPEG_EXT_PATH="$root/submodules/ExoPlayer/extensions/ffmpeg/src/main/jni"
HOST_PLATFORM="linux-x86_64"
ENABLED_DECODERS=(alac)
ndkLocalPath="$root/ndk/android-ndk-r21e"
ndkDownloadZip="$root/ndk/ndk.zip"
if [ -z "$NDK_PATH" ] && [ ! -e "$ndkLocalPath" ]; then
mkdir -p "$root/ndk"
wget https://dl.google.com/android/repository/android-ndk-r21e-linux-x86_64.zip -O "$ndkDownloadZip"
unzip -d "$root/ndk" "$ndkDownloadZip"
rm "$ndkDownloadZip"
fi
if [ -z "$NDK_PATH" ] && [ -e "$ndkLocalPath" ]; then
NDK_PATH="$root/ndk/android-ndk-r21e"
fi
cd "${FFMPEG_EXT_PATH}"
./build_ffmpeg.sh "${FFMPEG_EXT_PATH}" "${NDK_PATH}" "${HOST_PLATFORM}" "${ENABLED_DECODERS[@]}"
"${NDK_PATH}/ndk-build" APP_ABI="armeabi-v7a arm64-v8a x86 x86_64" -j4

View File

@ -5592,10 +5592,9 @@ react-native-tab-view@^2.16.0:
resolved "https://registry.yarnpkg.com/react-native-tab-view/-/react-native-tab-view-2.16.0.tgz#cae72c7084394bd328fac5fefb86cd966df37a86"
integrity sha512-ac2DmT7+l13wzIFqtbfXn4wwfgtPoKzWjjZyrK1t+T8sdemuUvD4zIt+UImg03fu3s3VD8Wh/fBrIdcqQyZJWg==
react-native-track-player@^2.0.3:
"react-native-track-player@https://github.com/austinried/react-native-track-player":
version "2.0.3"
resolved "https://registry.yarnpkg.com/react-native-track-player/-/react-native-track-player-2.0.3.tgz#a2648e2468f8502359b4678655573501d46f0c64"
integrity sha512-XV+92szbnf4FcByzfT62fN+iT9o0WhoMgDFl63Jf4gk6vw6VOFchPOoHKHW0XqgnO4vIit8CFc8u945l8vSSuQ==
resolved "https://github.com/austinried/react-native-track-player#24cbbb4a4065ade9a38d2bcdeffa5b6a2f5c3d13"
react-native-vector-icons@^8.1.0:
version "8.1.0"