Commit 860aa2f9 by sofijajvc Committed by Andrew Lewis

Remove video decoder buffers from nullness blacklist

PiperOrigin-RevId: 263104935
parent 9f0fd870
...@@ -15,12 +15,13 @@ ...@@ -15,12 +15,13 @@
*/ */
package com.google.android.exoplayer2.video; package com.google.android.exoplayer2.video;
import androidx.annotation.Nullable;
import com.google.android.exoplayer2.decoder.DecoderInputBuffer; import com.google.android.exoplayer2.decoder.DecoderInputBuffer;
/** Input buffer to a video decoder. */ /** Input buffer to a video decoder. */
public class VideoDecoderInputBuffer extends DecoderInputBuffer { public class VideoDecoderInputBuffer extends DecoderInputBuffer {
public ColorInfo colorInfo; @Nullable public ColorInfo colorInfo;
public VideoDecoderInputBuffer() { public VideoDecoderInputBuffer() {
super(DecoderInputBuffer.BUFFER_REPLACEMENT_MODE_DIRECT); super(DecoderInputBuffer.BUFFER_REPLACEMENT_MODE_DIRECT);
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
*/ */
package com.google.android.exoplayer2.video; package com.google.android.exoplayer2.video;
import androidx.annotation.Nullable;
import com.google.android.exoplayer2.C; import com.google.android.exoplayer2.C;
import com.google.android.exoplayer2.decoder.OutputBuffer; import com.google.android.exoplayer2.decoder.OutputBuffer;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
...@@ -33,16 +34,16 @@ public abstract class VideoDecoderOutputBuffer extends OutputBuffer { ...@@ -33,16 +34,16 @@ public abstract class VideoDecoderOutputBuffer extends OutputBuffer {
/** Output mode. */ /** Output mode. */
@C.VideoOutputMode public int mode; @C.VideoOutputMode public int mode;
/** RGB buffer for RGB mode. */ /** RGB buffer for RGB mode. */
public ByteBuffer data; @Nullable public ByteBuffer data;
public int width; public int width;
public int height; public int height;
public ColorInfo colorInfo; @Nullable public ColorInfo colorInfo;
/** YUV planes for YUV mode. */ /** YUV planes for YUV mode. */
public ByteBuffer[] yuvPlanes; @Nullable public ByteBuffer[] yuvPlanes;
public int[] yuvStrides; @Nullable public int[] yuvStrides;
public int colorspace; public int colorspace;
/** /**
...@@ -88,6 +89,10 @@ public abstract class VideoDecoderOutputBuffer extends OutputBuffer { ...@@ -88,6 +89,10 @@ public abstract class VideoDecoderOutputBuffer extends OutputBuffer {
if (yuvPlanes == null) { if (yuvPlanes == null) {
yuvPlanes = new ByteBuffer[3]; yuvPlanes = new ByteBuffer[3];
} }
ByteBuffer data = this.data;
ByteBuffer[] yuvPlanes = this.yuvPlanes;
// Rewrapping has to be done on every frame since the stride might have changed. // Rewrapping has to be done on every frame since the stride might have changed.
yuvPlanes[0] = data.slice(); yuvPlanes[0] = data.slice();
yuvPlanes[0].limit(yLength); yuvPlanes[0].limit(yLength);
......
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