diff --git a/extensions/av1/README.md b/extensions/av1/README.md index f9bef64791..c7b59baca2 100644 --- a/extensions/av1/README.md +++ b/extensions/av1/README.md @@ -23,29 +23,28 @@ dependencies as follows: * Set the following environment variables: ``` -cd "" -EXOPLAYER_ROOT="$(pwd)" -AV1_EXT_PATH="${EXOPLAYER_ROOT}/extensions/av1/src/main" +cd "" +AV1_MODULE_PATH="$(pwd)/extensions/av1/src/main" ``` * Fetch cpu_features library: ``` -cd "${AV1_EXT_PATH}/jni" && \ +cd "${AV1_MODULE_PATH}/jni" && \ git clone https://github.com/google/cpu_features ``` * Fetch libgav1: ``` -cd "${AV1_EXT_PATH}/jni" && \ +cd "${AV1_MODULE_PATH}/jni" && \ git clone https://chromium.googlesource.com/codecs/libgav1 ``` * Fetch Abseil: ``` -cd "${AV1_EXT_PATH}/jni/libgav1" && \ +cd "${AV1_MODULE_PATH}/jni/libgav1" && \ git clone https://github.com/abseil/abseil-cpp.git third_party/abseil-cpp ``` @@ -113,19 +112,22 @@ gets from the libgav1 decoder: * GL rendering using GL shader for color space conversion - * If you are using `SimpleExoPlayer` with `PlayerView`, enable this option - by setting `surface_type` of `PlayerView` to be + * If you are using `ExoPlayer` with `PlayerView` or `StyledPlayerView`, + enable this option by setting `surface_type` of view to be `video_decoder_gl_surface_view`. * Otherwise, enable this option by sending `Libgav1VideoRenderer` a - message of type `Renderer.MSG_SET_VIDEO_DECODER_OUTPUT_BUFFER_RENDERER` + message of type `Renderer.MSG_SET_VIDEO_OUTPUT` with an instance of `VideoDecoderOutputBufferRenderer` as its object. + `VideoDecoderGLSurfaceView` is the concrete + `VideoDecoderOutputBufferRenderer` implementation used by + `(Styled)PlayerView`. * Native rendering using `ANativeWindow` - * If you are using `SimpleExoPlayer` with `PlayerView`, this option is - enabled by default. + * If you are using `ExoPlayer` with `PlayerView` or `StyledPlayerView`, + this option is enabled by default. * Otherwise, enable this option by sending `Libgav1VideoRenderer` a - message of type `Renderer.MSG_SET_SURFACE` with an instance of + message of type `Renderer.MSG_SET_VIDEO_OUTPUT` with an instance of `SurfaceView` as its object. Note: Although the default option uses `ANativeWindow`, based on our testing the diff --git a/extensions/ffmpeg/README.md b/extensions/ffmpeg/README.md index d54c94944f..cb0fdf3f7c 100644 --- a/extensions/ffmpeg/README.md +++ b/extensions/ffmpeg/README.md @@ -24,9 +24,8 @@ can bundle the FFmpeg binaries in the APK: * Set the following shell variable: ``` -cd "" -EXOPLAYER_ROOT="$(pwd)" -FFMPEG_EXT_PATH="${EXOPLAYER_ROOT}/extensions/ffmpeg/src/main" +cd "" +FFMPEG_MODULE_PATH="$(pwd)/extensions/ffmpeg/src/main" ``` * Download the [Android NDK][] and set its location in a shell variable. @@ -63,7 +62,7 @@ ENABLED_DECODERS=(vorbis opus flac) * Add a link to the FFmpeg source code in the FFmpeg module `jni` directory. ``` -cd "${FFMPEG_EXT_PATH}/jni" && \ +cd "${FFMPEG_MODULE_PATH}/jni" && \ ln -s "$FFMPEG_PATH" ffmpeg ``` @@ -72,9 +71,9 @@ ln -s "$FFMPEG_PATH" ffmpeg different architectures: ``` -cd "${FFMPEG_EXT_PATH}/jni" && \ +cd "${FFMPEG_MODULE_PATH}/jni" && \ ./build_ffmpeg.sh \ - "${FFMPEG_EXT_PATH}" "${NDK_PATH}" "${HOST_PLATFORM}" "${ENABLED_DECODERS[@]}" + "${FFMPEG_MODULE_PATH}" "${NDK_PATH}" "${HOST_PLATFORM}" "${ENABLED_DECODERS[@]}" ``` ## Build instructions (Windows) diff --git a/extensions/ffmpeg/src/main/jni/build_ffmpeg.sh b/extensions/ffmpeg/src/main/jni/build_ffmpeg.sh index 7b2e933902..49f1d028d6 100755 --- a/extensions/ffmpeg/src/main/jni/build_ffmpeg.sh +++ b/extensions/ffmpeg/src/main/jni/build_ffmpeg.sh @@ -15,7 +15,7 @@ # limitations under the License. # -FFMPEG_EXT_PATH=$1 +FFMPEG_MODULE_PATH=$1 NDK_PATH=$2 HOST_PLATFORM=$3 ENABLED_DECODERS=("${@:4}") @@ -43,7 +43,7 @@ for decoder in "${ENABLED_DECODERS[@]}" do COMMON_OPTIONS="${COMMON_OPTIONS} --enable-decoder=${decoder}" done -cd "${FFMPEG_EXT_PATH}/jni/ffmpeg" +cd "${FFMPEG_MODULE_PATH}/jni/ffmpeg" ./configure \ --libdir=android-libs/armeabi-v7a \ --arch=arm \ diff --git a/extensions/flac/README.md b/extensions/flac/README.md index d7b6e7bc00..aaa4e35191 100644 --- a/extensions/flac/README.md +++ b/extensions/flac/README.md @@ -22,9 +22,8 @@ In addition, it's necessary to build the module's native components as follows: * Set the following environment variables: ``` -cd "" -EXOPLAYER_ROOT="$(pwd)" -FLAC_EXT_PATH="${EXOPLAYER_ROOT}/extensions/flac/src/main" +cd "" +FLAC_MODULE_PATH="$(pwd)/extensions/flac/src/main" ``` * Download the [Android NDK][] and set its location in an environment variable. @@ -34,10 +33,10 @@ FLAC_EXT_PATH="${EXOPLAYER_ROOT}/extensions/flac/src/main" NDK_PATH="" ``` -* Download and extract flac-1.3.2 as "${FLAC_EXT_PATH}/jni/flac" folder: +* Download and extract flac-1.3.2 as "${FLAC_MODULE_PATH}/jni/flac" folder: ``` -cd "${FLAC_EXT_PATH}/jni" && \ +cd "${FLAC_MODULE_PATH}/jni" && \ curl https://ftp.osuosl.org/pub/xiph/releases/flac/flac-1.3.2.tar.xz | tar xJ && \ mv flac-1.3.2 flac ``` @@ -45,7 +44,7 @@ mv flac-1.3.2 flac * Build the JNI native libraries from the command line: ``` -cd "${FLAC_EXT_PATH}"/jni && \ +cd "${FLAC_MODULE_PATH}"/jni && \ ${NDK_PATH}/ndk-build APP_ABI=all -j4 ``` diff --git a/extensions/opus/README.md b/extensions/opus/README.md index f4a77d924d..e3242c3f32 100644 --- a/extensions/opus/README.md +++ b/extensions/opus/README.md @@ -22,9 +22,8 @@ In addition, it's necessary to build the module's native components as follows: * Set the following environment variables: ``` -cd "" -EXOPLAYER_ROOT="$(pwd)" -OPUS_EXT_PATH="${EXOPLAYER_ROOT}/extensions/opus/src/main" +cd "" +OPUS_MODULE_PATH="$(pwd)/extensions/opus/src/main" ``` * Download the [Android NDK][] and set its location in an environment variable. @@ -37,20 +36,20 @@ NDK_PATH="" * Fetch libopus: ``` -cd "${OPUS_EXT_PATH}/jni" && \ +cd "${OPUS_MODULE_PATH}/jni" && \ git clone https://gitlab.xiph.org/xiph/opus.git libopus ``` * Run the script to convert arm assembly to NDK compatible format: ``` -cd ${OPUS_EXT_PATH}/jni && ./convert_android_asm.sh +cd ${OPUS_MODULE_PATH}/jni && ./convert_android_asm.sh ``` * Build the JNI native libraries from the command line: ``` -cd "${OPUS_EXT_PATH}"/jni && \ +cd "${OPUS_MODULE_PATH}"/jni && \ ${NDK_PATH}/ndk-build APP_ABI=all -j4 ``` @@ -70,7 +69,7 @@ be possible to follow the Linux instructions in [Windows PowerShell][]. * Arm assembly should be converted by running `convert_android_asm.sh` * Clean and re-build the project. * If you want to use your own version of libopus, place it in - `${OPUS_EXT_PATH}/jni/libopus`. + `${OPUS_MODULE_PATH}/jni/libopus`. ## Using the module diff --git a/extensions/vp9/README.md b/extensions/vp9/README.md index d352a349c1..b24d089549 100644 --- a/extensions/vp9/README.md +++ b/extensions/vp9/README.md @@ -22,9 +22,8 @@ In addition, it's necessary to build the module's native components as follows: * Set the following environment variables: ``` -cd "" -EXOPLAYER_ROOT="$(pwd)" -VP9_EXT_PATH="${EXOPLAYER_ROOT}/extensions/vp9/src/main" +cd "" +VP9_MODULE_PATH="$(pwd)/extensions/vp9/src/main" ``` * Download the [Android NDK][] and set its location in an environment variable. @@ -49,7 +48,7 @@ LIBVPX_PATH="$(pwd)" run a script that generates necessary configuration files for libvpx: ``` -cd ${VP9_EXT_PATH}/jni && \ +cd ${VP9_MODULE_PATH}/jni && \ ln -s "$LIBVPX_PATH" libvpx && \ ./generate_libvpx_android_configs.sh ``` @@ -57,7 +56,7 @@ ln -s "$LIBVPX_PATH" libvpx && \ * Build the JNI native libraries from the command line: ``` -cd "${VP9_EXT_PATH}"/jni && \ +cd "${VP9_MODULE_PATH}"/jni && \ ${NDK_PATH}/ndk-build APP_ABI=all -j4 ``` @@ -78,7 +77,7 @@ be possible to follow the Linux instructions in [Windows PowerShell][]. `generate_libvpx_android_configs.sh` * Clean and re-build the project. * If you want to use your own version of libvpx, point to it with the - `${VP9_EXT_PATH}/jni/libvpx` symlink. Please note that + `${VP9_MODULE_PATH}/jni/libvpx` symlink. Please note that `generate_libvpx_android_configs.sh` and the makefiles may need to be modified to work with arbitrary versions of libvpx. @@ -126,20 +125,23 @@ gets from the libvpx decoder: * GL rendering using GL shader for color space conversion - * If you are using `SimpleExoPlayer` with `PlayerView`, enable this option - by setting `surface_type` of `PlayerView` to be + * If you are using `ExoPlayer` with `PlayerView` or `StyledPlayerView`, + enable this option by setting `surface_type` of view to be `video_decoder_gl_surface_view`. * Otherwise, enable this option by sending `LibvpxVideoRenderer` a message - of type `Renderer.MSG_SET_VIDEO_DECODER_OUTPUT_BUFFER_RENDERER` with an + of type `Renderer.MSG_SET_VIDEO_OUTPUT` with an instance of `VideoDecoderOutputBufferRenderer` as its object. + `VideoDecoderGLSurfaceView` is the concrete + `VideoDecoderOutputBufferRenderer` implementation used by + `(Styled)PlayerView`. * Native rendering using `ANativeWindow` - * If you are using `SimpleExoPlayer` with `PlayerView`, this option is - enabled by default. + * If you are using `ExoPlayer` with `PlayerView` or `StyledPlayerView`, + this option is enabled by default. * Otherwise, enable this option by sending `LibvpxVideoRenderer` a message - of type `Renderer.MSG_SET_SURFACE` with an instance of `SurfaceView` as - its object. + of type `Renderer.MSG_SET_VIDEO_OUTPUT` with an instance of + `SurfaceView` as its object. Note: Although the default option uses `ANativeWindow`, based on our testing the GL rendering mode has better performance, so should be preferred.