Class ExoplayerCuesDecoder
- java.lang.Object
-
- com.google.android.exoplayer2.text.ExoplayerCuesDecoder
-
- All Implemented Interfaces:
Decoder<SubtitleInputBuffer,SubtitleOutputBuffer,SubtitleDecoderException>,SubtitleDecoder
public final class ExoplayerCuesDecoder extends Object implements SubtitleDecoder
ASubtitleDecoderthat decodes subtitle samples of typeMimeTypes.TEXT_EXOPLAYER_CUES
-
-
Constructor Summary
Constructors Constructor Description ExoplayerCuesDecoder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SubtitleInputBufferdequeueInputBuffer()Dequeues the next input buffer to be filled and queued to the decoder.SubtitleOutputBufferdequeueOutputBuffer()Dequeues the next output buffer from the decoder.voidflush()Flushes the decoder.StringgetName()Returns the name of the decoder.voidqueueInputBuffer(SubtitleInputBuffer inputBuffer)Queues an input buffer to the decoder.voidrelease()Releases the decoder.voidsetPositionUs(long positionUs)Informs the decoder of the current playback position.
-
-
-
Method Detail
-
getName
public String getName()
Description copied from interface:DecoderReturns the name of the decoder.- Specified by:
getNamein interfaceDecoder<SubtitleInputBuffer,SubtitleOutputBuffer,SubtitleDecoderException>- Returns:
- The name of the decoder.
-
dequeueInputBuffer
@Nullable public SubtitleInputBuffer dequeueInputBuffer() throws SubtitleDecoderException
Description copied from interface:DecoderDequeues the next input buffer to be filled and queued to the decoder.- Specified by:
dequeueInputBufferin interfaceDecoder<SubtitleInputBuffer,SubtitleOutputBuffer,SubtitleDecoderException>- Returns:
- The input buffer, which will have been cleared, or null if a buffer isn't available.
- Throws:
SubtitleDecoderException
-
queueInputBuffer
public void queueInputBuffer(SubtitleInputBuffer inputBuffer) throws SubtitleDecoderException
Description copied from interface:DecoderQueues an input buffer to the decoder.- Specified by:
queueInputBufferin interfaceDecoder<SubtitleInputBuffer,SubtitleOutputBuffer,SubtitleDecoderException>- Parameters:
inputBuffer- The input buffer.- Throws:
SubtitleDecoderException
-
dequeueOutputBuffer
@Nullable public SubtitleOutputBuffer dequeueOutputBuffer() throws SubtitleDecoderException
Description copied from interface:DecoderDequeues the next output buffer from the decoder.- Specified by:
dequeueOutputBufferin interfaceDecoder<SubtitleInputBuffer,SubtitleOutputBuffer,SubtitleDecoderException>- Returns:
- The output buffer, or null if an output buffer isn't available.
- Throws:
SubtitleDecoderException
-
flush
public void flush()
Description copied from interface:DecoderFlushes the decoder. Ownership of dequeued input buffers is returned to the decoder. The caller is still responsible for releasing any dequeued output buffers.- Specified by:
flushin interfaceDecoder<SubtitleInputBuffer,SubtitleOutputBuffer,SubtitleDecoderException>
-
release
public void release()
Description copied from interface:DecoderReleases the decoder. Must be called when the decoder is no longer needed.- Specified by:
releasein interfaceDecoder<SubtitleInputBuffer,SubtitleOutputBuffer,SubtitleDecoderException>
-
setPositionUs
public void setPositionUs(long positionUs)
Description copied from interface:SubtitleDecoderInforms the decoder of the current playback position.Must be called prior to each attempt to dequeue output buffers from the decoder.
- Specified by:
setPositionUsin interfaceSubtitleDecoder- Parameters:
positionUs- The current playback position in microseconds.
-
-