Migrate usages of renderer constants in C.java to the Renderer ones
PiperOrigin-RevId: 321157794
This commit is contained in:
parent
49db15ef73
commit
93c9e93a09
@ -110,18 +110,21 @@ There are two possibilities for rendering the output `Libgav1VideoRenderer`
|
|||||||
gets from the libgav1 decoder:
|
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 by
|
|
||||||
setting `surface_type` of `PlayerView` to be
|
* If you are using `SimpleExoPlayer` with `PlayerView`, enable this option
|
||||||
|
by setting `surface_type` of `PlayerView` to be
|
||||||
`video_decoder_gl_surface_view`.
|
`video_decoder_gl_surface_view`.
|
||||||
* Otherwise, enable this option by sending `Libgav1VideoRenderer` a message
|
* Otherwise, enable this option by sending `Libgav1VideoRenderer` a
|
||||||
of type `C.MSG_SET_VIDEO_DECODER_OUTPUT_BUFFER_RENDERER` with an instance of
|
message of type `Renderer.MSG_SET_VIDEO_DECODER_OUTPUT_BUFFER_RENDERER`
|
||||||
`VideoDecoderOutputBufferRenderer` as its object.
|
with an instance of `VideoDecoderOutputBufferRenderer` as its object.
|
||||||
|
|
||||||
* Native rendering using `ANativeWindow`
|
* Native rendering using `ANativeWindow`
|
||||||
* If you are using `SimpleExoPlayer` with `PlayerView`, this option is enabled
|
|
||||||
by default.
|
* If you are using `SimpleExoPlayer` with `PlayerView`, this option is
|
||||||
* Otherwise, enable this option by sending `Libgav1VideoRenderer` a message of
|
enabled by default.
|
||||||
type `C.MSG_SET_SURFACE` with an instance of `SurfaceView` as its object.
|
* Otherwise, enable this option by sending `Libgav1VideoRenderer` a
|
||||||
|
message of type `Renderer.MSG_SET_SURFACE` with an instance of
|
||||||
|
`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
|
||||||
|
@ -127,18 +127,21 @@ There are two possibilities for rendering the output `LibvpxVideoRenderer`
|
|||||||
gets from the libvpx decoder:
|
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 by
|
|
||||||
setting `surface_type` of `PlayerView` to be
|
* If you are using `SimpleExoPlayer` with `PlayerView`, enable this option
|
||||||
|
by setting `surface_type` of `PlayerView` to be
|
||||||
`video_decoder_gl_surface_view`.
|
`video_decoder_gl_surface_view`.
|
||||||
* Otherwise, enable this option by sending `LibvpxVideoRenderer` a message of
|
* Otherwise, enable this option by sending `LibvpxVideoRenderer` a message
|
||||||
type `C.MSG_SET_VIDEO_DECODER_OUTPUT_BUFFER_RENDERER` with an instance of
|
of type `Renderer.MSG_SET_VIDEO_DECODER_OUTPUT_BUFFER_RENDERER` with an
|
||||||
`VideoDecoderOutputBufferRenderer` as its object.
|
instance of `VideoDecoderOutputBufferRenderer` as its object.
|
||||||
|
|
||||||
* Native rendering using `ANativeWindow`
|
* Native rendering using `ANativeWindow`
|
||||||
* If you are using `SimpleExoPlayer` with `PlayerView`, this option is enabled
|
|
||||||
by default.
|
* If you are using `SimpleExoPlayer` with `PlayerView`, this option is
|
||||||
* Otherwise, enable this option by sending `LibvpxVideoRenderer` a message of
|
enabled by default.
|
||||||
type `C.MSG_SET_SURFACE` with an instance of `SurfaceView` as its object.
|
* Otherwise, enable this option by sending `LibvpxVideoRenderer` a message
|
||||||
|
of type `Renderer.MSG_SET_SURFACE` with an instance of `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.
|
||||||
|
@ -24,11 +24,11 @@ import android.os.Looper;
|
|||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.test.core.app.ApplicationProvider;
|
import androidx.test.core.app.ApplicationProvider;
|
||||||
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
||||||
import com.google.android.exoplayer2.C;
|
|
||||||
import com.google.android.exoplayer2.ExoPlaybackException;
|
import com.google.android.exoplayer2.ExoPlaybackException;
|
||||||
import com.google.android.exoplayer2.ExoPlayer;
|
import com.google.android.exoplayer2.ExoPlayer;
|
||||||
import com.google.android.exoplayer2.MediaItem;
|
import com.google.android.exoplayer2.MediaItem;
|
||||||
import com.google.android.exoplayer2.Player;
|
import com.google.android.exoplayer2.Player;
|
||||||
|
import com.google.android.exoplayer2.Renderer;
|
||||||
import com.google.android.exoplayer2.extractor.mkv.MatroskaExtractor;
|
import com.google.android.exoplayer2.extractor.mkv.MatroskaExtractor;
|
||||||
import com.google.android.exoplayer2.source.MediaSource;
|
import com.google.android.exoplayer2.source.MediaSource;
|
||||||
import com.google.android.exoplayer2.source.ProgressiveMediaSource;
|
import com.google.android.exoplayer2.source.ProgressiveMediaSource;
|
||||||
@ -125,7 +125,7 @@ public class VpxPlaybackTest {
|
|||||||
.createMediaSource(MediaItem.fromUri(uri));
|
.createMediaSource(MediaItem.fromUri(uri));
|
||||||
player
|
player
|
||||||
.createMessage(videoRenderer)
|
.createMessage(videoRenderer)
|
||||||
.setType(C.MSG_SET_VIDEO_DECODER_OUTPUT_BUFFER_RENDERER)
|
.setType(Renderer.MSG_SET_VIDEO_DECODER_OUTPUT_BUFFER_RENDERER)
|
||||||
.setPayload(new VideoDecoderGLSurfaceView(context).getVideoDecoderOutputBufferRenderer())
|
.setPayload(new VideoDecoderGLSurfaceView(context).getVideoDecoderOutputBufferRenderer())
|
||||||
.send();
|
.send();
|
||||||
player.setMediaSource(mediaSource);
|
player.setMediaSource(mediaSource);
|
||||||
|
@ -25,7 +25,7 @@ import com.google.android.exoplayer2.util.Util;
|
|||||||
* android.media.AudioTrack}.
|
* android.media.AudioTrack}.
|
||||||
*
|
*
|
||||||
* <p>To set the audio attributes, create an instance using the {@link Builder} and either pass it
|
* <p>To set the audio attributes, create an instance using the {@link Builder} and either pass it
|
||||||
* to the player or send a message of type {@link C#MSG_SET_AUDIO_ATTRIBUTES} to the audio
|
* to the player or send a message of type {@code Renderer#MSG_SET_AUDIO_ATTRIBUTES} to the audio
|
||||||
* renderers.
|
* renderers.
|
||||||
*
|
*
|
||||||
* <p>This class is based on {@link android.media.AudioAttributes}, but can be used on all supported
|
* <p>This class is based on {@link android.media.AudioAttributes}, but can be used on all supported
|
||||||
|
@ -311,9 +311,9 @@ public interface Player {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the video decoder output buffer renderer. This is intended for use only with extension
|
* Sets the video decoder output buffer renderer. This is intended for use only with extension
|
||||||
* renderers that accept {@link C#MSG_SET_VIDEO_DECODER_OUTPUT_BUFFER_RENDERER}. For most use
|
* renderers that accept {@link Renderer#MSG_SET_VIDEO_DECODER_OUTPUT_BUFFER_RENDERER}. For most
|
||||||
* cases, an output surface or view should be passed via {@link #setVideoSurface(Surface)} or
|
* use cases, an output surface or view should be passed via {@link #setVideoSurface(Surface)}
|
||||||
* {@link #setVideoSurfaceView(SurfaceView)} instead.
|
* or {@link #setVideoSurfaceView(SurfaceView)} instead.
|
||||||
*
|
*
|
||||||
* @param videoDecoderOutputBufferRenderer The video decoder output buffer renderer, or {@code
|
* @param videoDecoderOutputBufferRenderer The video decoder output buffer renderer, or {@code
|
||||||
* null} to clear the output buffer renderer.
|
* null} to clear the output buffer renderer.
|
||||||
|
@ -2443,7 +2443,7 @@ public final class ExoPlayerTest {
|
|||||||
.start()
|
.start()
|
||||||
.blockUntilActionScheduleFinished(TIMEOUT_MS)
|
.blockUntilActionScheduleFinished(TIMEOUT_MS)
|
||||||
.blockUntilEnded(TIMEOUT_MS);
|
.blockUntilEnded(TIMEOUT_MS);
|
||||||
assertThat(Collections.frequency(rendererMessages, C.MSG_SET_SURFACE)).isEqualTo(2);
|
assertThat(Collections.frequency(rendererMessages, Renderer.MSG_SET_SURFACE)).isEqualTo(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
Loading…
x
Reference in New Issue
Block a user