# ExoPlayer VP9 extension # ## Description ## The VP9 extension is a [Renderer][] implementation that helps you bundle libvpx (the VP9 decoding library) into your app and use it along with ExoPlayer to play VP9 video on Android devices. [Renderer]: https://google.github.io/ExoPlayer/doc/reference/com/google/android/exoplayer2/Renderer.html ## Build instructions ## To use this extension you need to clone the ExoPlayer repository and depend on its modules locally. Instructions for doing this can be found in ExoPlayer's [top level README][]. In addition, it's necessary to build the extension's native components as follows: * Set the following environment variables: ``` cd "" EXOPLAYER_ROOT="$(pwd)" VP9_EXT_PATH="${EXOPLAYER_ROOT}/extensions/vp9/src/main" ``` * Download the [Android NDK][] and set its location in an environment variable: ``` NDK_PATH="" ``` * Fetch libvpx and libyuv: ``` cd "${VP9_EXT_PATH}/jni" && \ git clone https://chromium.googlesource.com/webm/libvpx libvpx && \ git clone https://chromium.googlesource.com/libyuv/libyuv libyuv ``` * Checkout the appropriate branches of libvpx and libyuv (the scripts and makefiles bundled in this repo are known to work only at these versions of the libraries - we will update this periodically as newer versions of libvpx/libyuv are released): ``` cd "${VP9_EXT_PATH}/jni/libvpx" && \ git checkout tags/v1.6.1 -b v1.6.1 && \ cd "${VP9_EXT_PATH}/jni/libyuv" && \ git checkout 996a2bbd ``` * Run a script that generates necessary configuration files for libvpx: ``` cd ${VP9_EXT_PATH}/jni && \ ./generate_libvpx_android_configs.sh "${NDK_PATH}" ``` * Build the JNI native libraries from the command line: ``` cd "${VP9_EXT_PATH}"/jni && \ ${NDK_PATH}/ndk-build APP_ABI=all -j4 ``` [top level README]: https://github.com/google/ExoPlayer/blob/release-v2/README.md [Android NDK]: https://developer.android.com/tools/sdk/ndk/index.html ## Notes ## * Every time there is a change to the libvpx checkout: * Android config scripts should be re-generated by running `generate_libvpx_android_configs.sh` * Clean and re-build the project. * If you want to use your own version of libvpx or libyuv, place it in `${VP9_EXT_PATH}/jni/libvpx` or `${VP9_EXT_PATH}/jni/libyuv` respectively. But please note that `generate_libvpx_android_configs.sh` and the makefiles need to be modified to work with arbitrary versions of libvpx and libyuv.