VideoDecoderOutputBuffer
@UnstableApi
public class VideoDecoderOutputBuffer extends DecoderOutputBuffer
| java.lang.Object | |||
| ↳ | androidx.media3.decoder.Buffer | ||
| ↳ | androidx.media3.decoder.DecoderOutputBuffer | ||
| ↳ | androidx.media3.decoder.VideoDecoderOutputBuffer |
Video decoder output buffer containing video frame data.
Summary
Constants |
|
|---|---|
static final int |
|
static final int |
COLORSPACE_BT601 = 1 |
static final int |
COLORSPACE_BT709 = 2 |
static final int |
Public fields |
|
|---|---|
int |
|
@Nullable ByteBuffer |
RGB buffer for RGB mode. |
long |
Decoder private data. |
@Nullable Format |
The format of the input from which this output buffer was decoded. |
int |
|
int |
Output mode. |
@Nullable ByteBuffer |
Supplemental data related to the output frame, if |
int |
|
int |
|
int |
|
@Nullable ByteBuffer[] |
YUV planes for YUV mode. |
@Nullable int[] |
Public constructors |
|---|
|
Creates VideoDecoderOutputBuffer. |
Public methods |
|
|---|---|
void |
init(Initializes the buffer. |
boolean |
initForOffsetFrames( |
void |
initForPrivateFrame(int width, int height)Configures the buffer for the given frame dimensions when passing actual frame data via |
boolean |
initForYuvFrame(Resizes the buffer based on the given stride. |
void |
release()Releases the output buffer for reuse. |
Inherited fields |
||||||
|---|---|---|---|---|---|---|
|
Inherited methods |
||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||||||||||
Constants
Public fields
format
public @Nullable Format format
The format of the input from which this output buffer was decoded.
supplementalData
public @Nullable ByteBuffer supplementalData
Supplemental data related to the output frame, if hasSupplementalData returns true. If present, the buffer is populated with supplemental data from position 0 to its limit.
Public constructors
VideoDecoderOutputBuffer
public VideoDecoderOutputBuffer(
DecoderOutputBuffer.Owner<VideoDecoderOutputBuffer> owner
)
Creates VideoDecoderOutputBuffer.
| Parameters | |
|---|---|
DecoderOutputBuffer.Owner<VideoDecoderOutputBuffer> owner |
Buffer owner. |
Public methods
init
public void init(
long timeUs,
@C.VideoOutputMode int mode,
@Nullable ByteBuffer supplementalData
)
Initializes the buffer.
| Parameters | |
|---|---|
long timeUs |
The presentation timestamp for the buffer, in microseconds. |
@C.VideoOutputMode int mode |
The output mode. One of |
@Nullable ByteBuffer supplementalData |
Supplemental data associated with the frame, or |
initForOffsetFrames
public boolean initForOffsetFrames(
int offset,
int width,
int height,
int yStride,
int uvStride,
int colorspace,
int alignedHeight
)
initForPrivateFrame
public void initForPrivateFrame(int width, int height)
Configures the buffer for the given frame dimensions when passing actual frame data via decoderPrivate. Called via JNI after decoding completes.
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 | |
|---|---|
boolean |
Whether the buffer was resized successfully. |
release
public void release()
Releases the output buffer for reuse. Must be called when the buffer is no longer needed.