mirror of
https://github.com/androidx/media.git
synced 2025-05-14 19:19:58 +08:00
Move vpx constant for setting output renderer to common constants file
This will be used by both av1 and vp9 extensions. PiperOrigin-RevId: 271949754
This commit is contained in:
parent
bab12af597
commit
7c199eb1ad
@ -75,6 +75,11 @@
|
|||||||
* Add `Player.onPlaybackSuppressionReasonChanged` to allow listeners to
|
* Add `Player.onPlaybackSuppressionReasonChanged` to allow listeners to
|
||||||
detect playbacks suppressions (e.g. audio focus loss) directly
|
detect playbacks suppressions (e.g. audio focus loss) directly
|
||||||
([#6203](https://github.com/google/ExoPlayer/issues/6203)).
|
([#6203](https://github.com/google/ExoPlayer/issues/6203)).
|
||||||
|
* VP9 extension:
|
||||||
|
* Rename `VpxVideoSurfaceView` to `VideoDecoderSurfaceView`
|
||||||
|
and move it to the core library.
|
||||||
|
* Move `LibvpxVideoRenderer.MSG_SET_OUTPUT_BUFFER_RENDERER` to
|
||||||
|
`C.MSG_SET_OUTPUT_BUFFER_RENDERER`.
|
||||||
|
|
||||||
### 2.10.5 (2019-09-20) ###
|
### 2.10.5 (2019-09-20) ###
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@ import android.net.Uri;
|
|||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
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.Player;
|
import com.google.android.exoplayer2.Player;
|
||||||
@ -122,7 +123,7 @@ public class VpxPlaybackTest {
|
|||||||
.createMediaSource(uri);
|
.createMediaSource(uri);
|
||||||
player
|
player
|
||||||
.createMessage(videoRenderer)
|
.createMessage(videoRenderer)
|
||||||
.setType(LibvpxVideoRenderer.MSG_SET_OUTPUT_BUFFER_RENDERER)
|
.setType(C.MSG_SET_OUTPUT_BUFFER_RENDERER)
|
||||||
.setPayload(new VideoDecoderSurfaceView(context))
|
.setPayload(new VideoDecoderSurfaceView(context))
|
||||||
.send();
|
.send();
|
||||||
player.prepare(mediaSource);
|
player.prepare(mediaSource);
|
||||||
|
@ -48,20 +48,13 @@ import com.google.android.exoplayer2.video.VideoRendererEventListener;
|
|||||||
* <ul>
|
* <ul>
|
||||||
* <li>Message with type {@link C#MSG_SET_SURFACE} to set the output surface. The message payload
|
* <li>Message with type {@link C#MSG_SET_SURFACE} to set the output surface. The message payload
|
||||||
* should be the target {@link Surface}, or null.
|
* should be the target {@link Surface}, or null.
|
||||||
* <li>Message with type {@link #MSG_SET_OUTPUT_BUFFER_RENDERER} to set the output buffer
|
* <li>Message with type {@link C#MSG_SET_OUTPUT_BUFFER_RENDERER} to set the output buffer
|
||||||
* renderer. The message payload should be the target {@link
|
* renderer. The message payload should be the target {@link
|
||||||
* VideoDecoderOutputBufferRenderer}, or null.
|
* VideoDecoderOutputBufferRenderer}, or null.
|
||||||
* </ul>
|
* </ul>
|
||||||
*/
|
*/
|
||||||
public class LibvpxVideoRenderer extends SimpleDecoderVideoRenderer {
|
public class LibvpxVideoRenderer extends SimpleDecoderVideoRenderer {
|
||||||
|
|
||||||
/**
|
|
||||||
* The type of a message that can be passed to an instance of this class via {@link
|
|
||||||
* ExoPlayer#createMessage(Target)}. The message payload should be the target {@link
|
|
||||||
* VideoDecoderOutputBufferRenderer}, or null.
|
|
||||||
*/
|
|
||||||
public static final int MSG_SET_OUTPUT_BUFFER_RENDERER = C.MSG_CUSTOM_BASE;
|
|
||||||
|
|
||||||
/** The number of input buffers. */
|
/** The number of input buffers. */
|
||||||
private final int numInputBuffers;
|
private final int numInputBuffers;
|
||||||
/**
|
/**
|
||||||
@ -298,7 +291,7 @@ public class LibvpxVideoRenderer extends SimpleDecoderVideoRenderer {
|
|||||||
public void handleMessage(int messageType, @Nullable Object message) throws ExoPlaybackException {
|
public void handleMessage(int messageType, @Nullable Object message) throws ExoPlaybackException {
|
||||||
if (messageType == C.MSG_SET_SURFACE) {
|
if (messageType == C.MSG_SET_SURFACE) {
|
||||||
setOutput((Surface) message, null);
|
setOutput((Surface) message, null);
|
||||||
} else if (messageType == MSG_SET_OUTPUT_BUFFER_RENDERER) {
|
} else if (messageType == C.MSG_SET_OUTPUT_BUFFER_RENDERER) {
|
||||||
setOutput(null, (VideoDecoderOutputBufferRenderer) message);
|
setOutput(null, (VideoDecoderOutputBufferRenderer) message);
|
||||||
} else if (messageType == C.MSG_SET_VIDEO_FRAME_METADATA_LISTENER) {
|
} else if (messageType == C.MSG_SET_VIDEO_FRAME_METADATA_LISTENER) {
|
||||||
frameMetadataListener = (VideoFrameMetadataListener) message;
|
frameMetadataListener = (VideoFrameMetadataListener) message;
|
||||||
|
@ -27,6 +27,8 @@ import androidx.annotation.IntDef;
|
|||||||
import com.google.android.exoplayer2.PlayerMessage.Target;
|
import com.google.android.exoplayer2.PlayerMessage.Target;
|
||||||
import com.google.android.exoplayer2.audio.AuxEffectInfo;
|
import com.google.android.exoplayer2.audio.AuxEffectInfo;
|
||||||
import com.google.android.exoplayer2.util.Util;
|
import com.google.android.exoplayer2.util.Util;
|
||||||
|
import com.google.android.exoplayer2.video.SimpleDecoderVideoRenderer;
|
||||||
|
import com.google.android.exoplayer2.video.VideoDecoderOutputBufferRenderer;
|
||||||
import com.google.android.exoplayer2.video.VideoFrameMetadataListener;
|
import com.google.android.exoplayer2.video.VideoFrameMetadataListener;
|
||||||
import com.google.android.exoplayer2.video.spherical.CameraMotionListener;
|
import com.google.android.exoplayer2.video.spherical.CameraMotionListener;
|
||||||
import java.lang.annotation.Documented;
|
import java.lang.annotation.Documented;
|
||||||
@ -823,6 +825,13 @@ public final class C {
|
|||||||
*/
|
*/
|
||||||
public static final int MSG_SET_CAMERA_MOTION_LISTENER = 7;
|
public static final int MSG_SET_CAMERA_MOTION_LISTENER = 7;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The type of a message that can be passed to a {@link SimpleDecoderVideoRenderer} via {@link
|
||||||
|
* ExoPlayer#createMessage(Target)}. The message payload should be the target {@link
|
||||||
|
* VideoDecoderOutputBufferRenderer}, or null.
|
||||||
|
*/
|
||||||
|
public static final int MSG_SET_OUTPUT_BUFFER_RENDERER = 8;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Applications or extensions may define custom {@code MSG_*} constants that can be passed to
|
* Applications or extensions may define custom {@code MSG_*} constants that can be passed to
|
||||||
* {@link Renderer}s. These custom constants must be greater than or equal to this value.
|
* {@link Renderer}s. These custom constants must be greater than or equal to this value.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user