Stay organized with collections Save and categorize content based on your preferences.

SimpleDecoderOutputBuffer

@UnstableApi
public class SimpleDecoderOutputBuffer extends DecoderOutputBuffer


Buffer for SimpleDecoder output.

Summary

Public fields

@Nullable ByteBuffer

Public methods

void

Clears the buffer.

ByteBuffer
init(long timeUs, int size)

Initializes the buffer.

void

Releases the output buffer for reuse.

Inherited fields

From androidx.media3.decoder.DecoderOutputBuffer
int

The number of buffers immediately prior to this one that were skipped in the Decoder.

long

The presentation timestamp for the buffer, in microseconds.

Inherited methods

From androidx.media3.decoder.Buffer
final void

Adds the flag to this buffer's flags.

final void

Removes the flag from this buffer's flags, if it is set.

final boolean

Returns whether the specified flag has been set on this buffer.

final boolean

Returns whether the BUFFER_FLAG_HAS_SUPPLEMENTAL_DATA flag is set.

final boolean

Returns whether the BUFFER_FLAG_DECODE_ONLY flag is set.

final boolean

Returns whether the BUFFER_FLAG_END_OF_STREAM flag is set.

final boolean

Returns whether the BUFFER_FLAG_FIRST_SAMPLE flag is set.

final boolean

Returns whether the BUFFER_FLAG_KEY_FRAME flag is set.

final void
setFlags(@C.BufferFlags int flags)

Replaces this buffer's flags with flags.

Public fields

data

public @Nullable ByteBuffer data

Public constructors

SimpleDecoderOutputBuffer

public SimpleDecoderOutputBuffer(
    DecoderOutputBuffer.Owner<SimpleDecoderOutputBuffer> owner
)

Public methods

clear

public void clear()

Clears the buffer.

init

public ByteBuffer init(long timeUs, int size)

Initializes the buffer.

Parameters
long timeUs

The presentation timestamp for the buffer, in microseconds.

int size

An upper bound on the size of the data that will be written to the buffer.

Returns
ByteBuffer

The data buffer, for convenience.

release

public void release()

Releases the output buffer for reuse. Must be called when the buffer is no longer needed.