Commit db84773c by olly Committed by Oliver Woodman

Further README tweaks

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