SubtitleInputBuffer


@UnstableApi
public class SubtitleInputBuffer extends DecoderInputBuffer


A DecoderInputBuffer for a SubtitleDecoder.

Summary

Public fields

long

An offset that must be added to the subtitle's event times after it's been decoded, or OFFSET_SAMPLE_RELATIVE if timeUs should be added.

Public constructors

Inherited Constants

From androidx.media3.decoder.DecoderInputBuffer
static final int

Allows buffer replacement using allocateDirect.

static final int

Disallows buffer replacement.

static final int

Allows buffer replacement using allocate.

Inherited fields

From androidx.media3.decoder.DecoderInputBuffer
final CryptoInfo

CryptoInfo for encrypted data.

@Nullable ByteBuffer

The buffer's data, or null if no data has been set.

@Nullable Format

The Format.

@Nullable ByteBuffer

Supplemental data related to the buffer, if hasSupplementalData returns true.

long

The time at which the sample should be presented.

boolean

Whether the last attempt to read a sample into this buffer failed due to not yet having the DRM keys associated with the next sample.

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_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 boolean

Returns whether the BUFFER_FLAG_LAST_SAMPLE flag is set.

final boolean

Returns whether the BUFFER_FLAG_NOT_DEPENDED_ON flag is set.

final void
setFlags(@C.BufferFlags int flags)

Replaces this buffer's flags with flags.

From androidx.media3.decoder.DecoderInputBuffer
void

Clears the buffer.

void
@EnsuresNonNull(value = "data")
ensureSpaceForWrite(int length)

Ensures that data is large enough to accommodate a write of a given length at its current position.

final void

Flips data and supplementalData in preparation for being queued to a decoder.

final boolean

Returns whether the BUFFER_FLAG_ENCRYPTED flag is set.

static DecoderInputBuffer

Returns a new instance that's not able to hold any data.

void
@EnsuresNonNull(value = "supplementalData")
resetSupplementalData(int length)

Clears supplementalData and ensures that it's large enough to accommodate length bytes.

Public fields

subsampleOffsetUs

public long subsampleOffsetUs

An offset that must be added to the subtitle's event times after it's been decoded, or OFFSET_SAMPLE_RELATIVE if timeUs should be added.

Public constructors

SubtitleInputBuffer

public SubtitleInputBuffer()