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

Decoder

@UnstableApi
public interface Decoder<I, O, E extends DecoderException>

Known direct subclasses
SimpleDecoder

Base class for Decoders that use their own decode thread and decode each input buffer immediately into a corresponding output buffer.

SubtitleDecoder

Decodes Subtitles from SubtitleInputBuffers.

Known indirect subclasses
Cea608Decoder

A SubtitleDecoder for CEA-608 (also known as "line 21 captions" and "EIA-608").

Cea708Decoder

A SubtitleDecoder for CEA-708 (also known as "EIA-708").

DvbDecoder

A SimpleSubtitleDecoder for DVB subtitles.

ExoplayerCuesDecoder

A SubtitleDecoder that decodes subtitle samples of type TEXT_EXOPLAYER_CUES

Mp4WebvttDecoder

A SimpleSubtitleDecoder for Webvtt embedded in a Mp4 container file.

PgsDecoder

A SimpleSubtitleDecoder for PGS subtitles.

SimpleSubtitleDecoder

Base class for subtitle parsers that use their own decode thread.

SsaDecoder

A SimpleSubtitleDecoder for SSA/ASS.

SubripDecoder

A SimpleSubtitleDecoder for SubRip.

TtmlDecoder

A SimpleSubtitleDecoder for TTML supporting the DFXP presentation profile.

Tx3gDecoder

A SimpleSubtitleDecoder for tx3g.

WebvttDecoder

A SimpleSubtitleDecoder for WebVTT.


A media decoder.

Parameters
<I>

The type of buffer input to the decoder.

<O>

The type of buffer output from the decoder.

<E extends DecoderException>

The type of exception thrown from the decoder.

Summary

Public methods

abstract @Nullable I

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

abstract @Nullable O

Dequeues the next output buffer from the decoder.

abstract void

Flushes the decoder.

abstract String

Returns the name of the decoder.

abstract void
queueInputBuffer(I inputBuffer)

Queues an input buffer to the decoder.

abstract void

Releases the decoder.

Public methods

dequeueInputBuffer

abstract @NullabledequeueInputBuffer()

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

Returns
@Nullable I

The input buffer, which will have been cleared, or null if a buffer isn't available.

Throws
E E

If a decoder error has occurred.

dequeueOutputBuffer

abstract @NullabledequeueOutputBuffer()

Dequeues the next output buffer from the decoder.

Returns
@Nullable O

The output buffer, or null if an output buffer isn't available.

Throws
E E

If a decoder error has occurred.

flush

abstract void flush()

Flushes the decoder. Ownership of dequeued input buffers is returned to the decoder. The caller is still responsible for releasing any dequeued output buffers.

getName

abstract String getName()

Returns the name of the decoder.

Returns
String

The name of the decoder.

queueInputBuffer

abstract void queueInputBuffer(I inputBuffer)

Queues an input buffer to the decoder.

Parameters
I inputBuffer

The input buffer.

Throws
E E

If a decoder error has occurred.

release

abstract void release()

Releases the decoder. Must be called when the decoder is no longer needed.