mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Remove video decoder buffers from nullness blacklist
PiperOrigin-RevId: 263104935
This commit is contained in:
parent
9f0fd870e7
commit
860aa2f952
2 changed files with 11 additions and 5 deletions
|
|
@ -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 @@
|
||||||
*/
|
*/
|
||||||
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 {
|
||||||
/** 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 {
|
||||||
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);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue