mirror of
https://github.com/samsonjs/media.git
synced 2026-03-29 10:05:48 +00:00
Further README tweaks
PiperOrigin-RevId: 402811825
This commit is contained in:
parent
0dc2567179
commit
db84773c01
6 changed files with 47 additions and 46 deletions
|
|
@ -23,29 +23,28 @@ dependencies as follows:
|
|||
* Set the following environment variables:
|
||||
|
||||
```
|
||||
cd "<path to exoplayer checkout>"
|
||||
EXOPLAYER_ROOT="$(pwd)"
|
||||
AV1_EXT_PATH="${EXOPLAYER_ROOT}/extensions/av1/src/main"
|
||||
cd "<path to project checkout>"
|
||||
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
|
||||
|
|
|
|||
|
|
@ -24,9 +24,8 @@ can bundle the FFmpeg binaries in the APK:
|
|||
* Set the following shell variable:
|
||||
|
||||
```
|
||||
cd "<path to exoplayer checkout>"
|
||||
EXOPLAYER_ROOT="$(pwd)"
|
||||
FFMPEG_EXT_PATH="${EXOPLAYER_ROOT}/extensions/ffmpeg/src/main"
|
||||
cd "<path to project checkout>"
|
||||
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)
|
||||
|
|
|
|||
|
|
@ -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 \
|
||||
|
|
|
|||
|
|
@ -22,9 +22,8 @@ In addition, it's necessary to build the module's native components as follows:
|
|||
* Set the following environment variables:
|
||||
|
||||
```
|
||||
cd "<path to exoplayer checkout>"
|
||||
EXOPLAYER_ROOT="$(pwd)"
|
||||
FLAC_EXT_PATH="${EXOPLAYER_ROOT}/extensions/flac/src/main"
|
||||
cd "<path to project checkout>"
|
||||
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="<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 && \
|
||||
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
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -22,9 +22,8 @@ In addition, it's necessary to build the module's native components as follows:
|
|||
* Set the following environment variables:
|
||||
|
||||
```
|
||||
cd "<path to exoplayer checkout>"
|
||||
EXOPLAYER_ROOT="$(pwd)"
|
||||
OPUS_EXT_PATH="${EXOPLAYER_ROOT}/extensions/opus/src/main"
|
||||
cd "<path to project checkout>"
|
||||
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="<path to Android NDK>"
|
|||
* 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
|
||||
|
||||
|
|
|
|||
|
|
@ -22,9 +22,8 @@ In addition, it's necessary to build the module's native components as follows:
|
|||
* Set the following environment variables:
|
||||
|
||||
```
|
||||
cd "<path to exoplayer checkout>"
|
||||
EXOPLAYER_ROOT="$(pwd)"
|
||||
VP9_EXT_PATH="${EXOPLAYER_ROOT}/extensions/vp9/src/main"
|
||||
cd "<path to project checkout>"
|
||||
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.
|
||||
|
|
|
|||
Loading…
Reference in a new issue