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

Mp4WebvttDecoder

@UnstableApi
public final class Mp4WebvttDecoder extends SimpleSubtitleDecoder


A SimpleSubtitleDecoder for Webvtt embedded in a Mp4 container file.

Summary

Public constructors

Protected methods

Subtitle
decode(byte[] data, int length, boolean reset)

Decodes data into a Subtitle.

Inherited methods

From androidx.media3.decoder.SimpleDecoder
abstract I

Creates a new input buffer.

abstract O

Creates a new output buffer.

abstract E

Creates an exception to propagate for an unexpected decode error.

abstract @Nullable E
decode(I inputBuffer, O outputBuffer, boolean reset)

Decodes the inputBuffer and stores any decoded output in outputBuffer.

final @Nullable I

Dequeues the next input buffer to be filled and queued to the decoder.

final @Nullable O

Dequeues the next output buffer from the decoder.

final void

Flushes the decoder.

final void
queueInputBuffer(I inputBuffer)

Queues an input buffer to the decoder.

void

Releases the decoder.

void

Releases an output buffer back to the decoder.

final void

Sets the initial size of each input buffer.

From androidx.media3.extractor.text.SimpleSubtitleDecoder
final SubtitleInputBuffer

Creates a new input buffer.

final SubtitleOutputBuffer

Creates a new output buffer.

final SubtitleDecoderException

Creates an exception to propagate for an unexpected decode error.

final @Nullable SubtitleDecoderException
decode(
    SubtitleInputBuffer inputBuffer,
    SubtitleOutputBuffer outputBuffer,
    boolean reset
)

Decodes the inputBuffer and stores any decoded output in outputBuffer.

final String

Returns the name of the decoder.

void
setPositionUs(long positionUs)

Informs the decoder of the current playback position.

Public constructors

Mp4WebvttDecoder

public Mp4WebvttDecoder()

Protected methods

decode

protected Subtitle decode(byte[] data, int length, boolean reset)

Decodes data into a Subtitle.

Parameters
byte[] data

An array holding the data to be decoded, starting at position 0.

int length

The number of bytes from data to be decoded.

boolean reset

Whether the decoder must be reset before decoding.

Returns
Subtitle

The decoded Subtitle.

Throws
androidx.media3.extractor.text.SubtitleDecoderException androidx.media3.extractor.text.SubtitleDecoderException

If a decoding error occurs.