diff --git a/.github/actions/native-build/action.yml b/.github/actions/native-build/action.yml index 09f0a370..51494e1a 100644 --- a/.github/actions/native-build/action.yml +++ b/.github/actions/native-build/action.yml @@ -14,12 +14,13 @@ runs: with: path: | app/libs - key: ${{ runner.os }}-ffmpeg-${{ hashFiles('**/libs.versions.toml', '**/build_ffmpeg_decoder.sh') }} + 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 diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index aa6a830f..d6302d73 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -25,10 +25,24 @@ After forking and cloning your fork, you can import the project into Android Stu You need a compatible Android Studio version for the configured AGP. This is generally `Narwhal 3 Feature Drop | 2025.1.3` or newer. See https://developer.android.com/build/releases/gradle-plugin and [`libs.versions.toml](./gradle/libs.versions.toml). -### FFmpeg decoder module +### Native components -The app ships with [media3 ffmpeg decoder module](https://github.com/androidx/media/blob/release/libraries/decoder_ffmpeg/README.md). +Wholphin includes some optional native components that are compiled outside of the normal Android gradle build process. + +These components are not generally required to build or test the app during development. + +If you want to build any of them locally, you must have the [Android NDK](https://developer.android.com/ndk) installed. + +#### FFmpeg decoder module + +Wholphin ships with [media3 ffmpeg decoder module](https://github.com/androidx/media/blob/release/libraries/decoder_ffmpeg/README.md). It is not required to build the extension in order to build the app locally. -You can build the module on MacOS or Linux with the [`./build_ffmpeg_decoder.sh`](./build_ffmpeg_decoder.sh) script. You must have the [Android NDK](https://developer.android.com/ndk) installed. +You can build the module on MacOS or Linux with the [`build_ffmpeg_decoder.sh`](./scripts/ffmpeg/build_ffmpeg_decoder.sh) script. + +#### MPV player backend + +Wholphin has a playback engine that uses [`libmpv`](https://github.com/mpv-player/mpv). The app uses JNI code from [`mpv-android`](https://github.com/mpv-android/mpv-android) and has an implementation of `androidx.media3.common.Player` to swap out for `ExoPlayer`. + +See the [build scripts](scripts/mpv/) for details on building this component. diff --git a/scripts/ffmpeg/README.md b/scripts/ffmpeg/README.md new file mode 100644 index 00000000..d1fdac02 --- /dev/null +++ b/scripts/ffmpeg/README.md @@ -0,0 +1,3 @@ +# FFmpeg ExoPlayer decoder extension module + +Builds the ffmpeg decoder extension module for `ExoPlayer` which supports extra codecs during playback. diff --git a/build_ffmpeg_decoder.sh b/scripts/ffmpeg/build_ffmpeg_decoder.sh similarity index 100% rename from build_ffmpeg_decoder.sh rename to scripts/ffmpeg/build_ffmpeg_decoder.sh