diff --git a/extensions/av1/README.md b/extensions/av1/README.md index e20d6b258e..f48364e626 100644 --- a/extensions/av1/README.md +++ b/extensions/av1/README.md @@ -41,15 +41,17 @@ cd "${AV1_EXT_PATH}/jni/libgav1" && \ git clone https://github.com/abseil/abseil-cpp.git third_party/abseil-cpp ``` -libgav1 and [JNI wrapper library][] are built using [CMake][] set-up with -[Ninja][]. After following the instructions above to fetch libgav1, gradle will -build the extension automatically when run on the command line or via Android -Studio. +* [Install CMake][]. + +Having followed these steps, gradle will build the extension automatically when +run on the command line or via Android Studio, using [CMake][] and [Ninja][] +to configure and build libgav1 and the extension's [JNI wrapper library][]. [top level README]: https://github.com/google/ExoPlayer/blob/release-v2/README.md -[JNI wrapper library]: https://github.com/google/ExoPlayer/blob/release-v2/extensions/av1/src/main/jni/gav1_jni.cc +[Install CMake]: https://developer.android.com/studio/projects/install-ndk [CMake]: https://cmake.org/ [Ninja]: https://ninja-build.org +[JNI wrapper library]: https://github.com/google/ExoPlayer/blob/dev-v2/extensions/av1/src/main/jni/gav1_jni.cc ## Using the extension ## diff --git a/extensions/av1/build.gradle b/extensions/av1/build.gradle index a0f42509b6..0b539d551b 100644 --- a/extensions/av1/build.gradle +++ b/extensions/av1/build.gradle @@ -54,15 +54,10 @@ android { } } -// Check that the Android NDK, CMake and libgav1 are present, to avoid gradle -// sync failures if the tools aren't installed or libgav1 is missing. To use -// the extension it is necessary to install the NDK and CMake from the SDK -// Manager and fetch libgav1 following the steps in README. -def ndkDirectory = project.android.ndkDirectory -def sdkDirectory = project.android.sdkDirectory -if (ndkDirectory != null && !ndkDirectory.toString().isEmpty() - && new File(sdkDirectory.toString() + '/cmake').exists() - && project.file('src/main/jni/libgav1').exists()) { +// Configure the native build only if libgav1 is present, to avoid gradle sync +// failures if libgav1 hasn't been checked out according to the README and CMake +// isn't installed. +if (project.file('src/main/jni/libgav1').exists()) { android.externalNativeBuild.cmake.path = 'src/main/jni/CMakeLists.txt' android.externalNativeBuild.cmake.version = '3.7.1+' }