Class VideoDecoderOutputBuffer
- java.lang.Object
-
- com.google.android.exoplayer2.decoder.Buffer
-
- com.google.android.exoplayer2.decoder.DecoderOutputBuffer
-
- com.google.android.exoplayer2.decoder.VideoDecoderOutputBuffer
-
public class VideoDecoderOutputBuffer extends DecoderOutputBuffer
Video decoder output buffer containing video frame data.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.android.exoplayer2.decoder.DecoderOutputBuffer
DecoderOutputBuffer.Owner<S extends DecoderOutputBuffer>
-
-
Field Summary
Fields Modifier and Type Field Description intcolorspacestatic intCOLORSPACE_BT2020static intCOLORSPACE_BT601static intCOLORSPACE_BT709static intCOLORSPACE_UNKNOWNByteBufferdataRGB buffer for RGB mode.intdecoderPrivateDecoder private data.FormatformatThe format of the input from which this output buffer was decoded.intheight@com.google.android.exoplayer2.C.VideoOutputMode intmodeOutput mode.ByteBuffersupplementalDataSupplemental data related to the output frame, ifBuffer.hasSupplementalData()returns true.intwidthByteBuffer[]yuvPlanesYUV planes for YUV mode.int[]yuvStrides-
Fields inherited from class com.google.android.exoplayer2.decoder.DecoderOutputBuffer
skippedOutputBufferCount, timeUs
-
-
Constructor Summary
Constructors Constructor Description VideoDecoderOutputBuffer(DecoderOutputBuffer.Owner<VideoDecoderOutputBuffer> owner)Creates VideoDecoderOutputBuffer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidinit(long timeUs, @com.google.android.exoplayer2.C.VideoOutputMode int mode, ByteBuffer supplementalData)Initializes the buffer.voidinitForPrivateFrame(int width, int height)Configures the buffer for the given frame dimensions when passing actual frame data viadecoderPrivate.booleaninitForYuvFrame(int width, int height, int yStride, int uvStride, int colorspace)Resizes the buffer based on the given stride.voidrelease()Releases the output buffer for reuse.-
Methods inherited from class com.google.android.exoplayer2.decoder.Buffer
addFlag, clear, clearFlag, getFlag, hasSupplementalData, isDecodeOnly, isEndOfStream, isKeyFrame, setFlags
-
-
-
-
Field Detail
-
COLORSPACE_UNKNOWN
public static final int COLORSPACE_UNKNOWN
- See Also:
- Constant Field Values
-
COLORSPACE_BT601
public static final int COLORSPACE_BT601
- See Also:
- Constant Field Values
-
COLORSPACE_BT709
public static final int COLORSPACE_BT709
- See Also:
- Constant Field Values
-
COLORSPACE_BT2020
public static final int COLORSPACE_BT2020
- See Also:
- Constant Field Values
-
decoderPrivate
public int decoderPrivate
Decoder private data. Used from native code.
-
mode
public @com.google.android.exoplayer2.C.VideoOutputMode int mode
Output mode.
-
data
@Nullable public ByteBuffer data
RGB buffer for RGB mode.
-
width
public int width
-
height
public int height
-
format
@Nullable public Format format
The format of the input from which this output buffer was decoded.
-
yuvPlanes
@Nullable public ByteBuffer[] yuvPlanes
YUV planes for YUV mode.
-
yuvStrides
@Nullable public int[] yuvStrides
-
colorspace
public int colorspace
-
supplementalData
@Nullable public ByteBuffer supplementalData
Supplemental data related to the output frame, ifBuffer.hasSupplementalData()returns true. If present, the buffer is populated with supplemental data from position 0 to its limit.
-
-
Constructor Detail
-
VideoDecoderOutputBuffer
public VideoDecoderOutputBuffer(DecoderOutputBuffer.Owner<VideoDecoderOutputBuffer> owner)
Creates VideoDecoderOutputBuffer.- Parameters:
owner- Buffer owner.
-
-
Method Detail
-
release
public void release()
Description copied from class:DecoderOutputBufferReleases the output buffer for reuse. Must be called when the buffer is no longer needed.- Specified by:
releasein classDecoderOutputBuffer
-
init
public void init(long timeUs, @com.google.android.exoplayer2.C.VideoOutputMode int mode, @Nullable ByteBuffer supplementalData)Initializes the buffer.- Parameters:
timeUs- The presentation timestamp for the buffer, in microseconds.mode- The output mode. One ofC.VIDEO_OUTPUT_MODE_NONE,C.VIDEO_OUTPUT_MODE_YUVandC.VIDEO_OUTPUT_MODE_SURFACE_YUV.supplementalData- Supplemental data associated with the frame, ornullif not present. It is safe to reuse the provided buffer after this method returns.
-
initForYuvFrame
public boolean initForYuvFrame(int width, int height, int yStride, int uvStride, int colorspace)Resizes the buffer based on the given stride. Called via JNI after decoding completes.- Returns:
- Whether the buffer was resized successfully.
-
initForPrivateFrame
public void initForPrivateFrame(int width, int height)Configures the buffer for the given frame dimensions when passing actual frame data viadecoderPrivate. Called via JNI after decoding completes.
-
-