Decoder<SubtitleInputBuffer,SubtitleOutputBuffer,SubtitleDecoderException>, SubtitleDecoderDvbDecoder, Mp4WebvttDecoder, PgsDecoder, SsaDecoder, SubripDecoder, TtmlDecoder, Tx3gDecoder, WebvttDecoderpublic abstract class SimpleSubtitleDecoder extends SimpleDecoder<SubtitleInputBuffer,SubtitleOutputBuffer,SubtitleDecoderException> implements SubtitleDecoder
| Modifier | Constructor | Description |
|---|---|---|
protected |
SimpleSubtitleDecoder(String name) |
| Modifier and Type | Method | Description |
|---|---|---|
protected SubtitleInputBuffer |
createInputBuffer() |
Creates a new input buffer.
|
protected SubtitleOutputBuffer |
createOutputBuffer() |
Creates a new output buffer.
|
protected SubtitleDecoderException |
createUnexpectedDecodeException(Throwable error) |
Creates an exception to propagate for an unexpected decode error.
|
protected abstract Subtitle |
decode(byte[] data,
int size,
boolean reset) |
Decodes data into a
Subtitle. |
protected SubtitleDecoderException |
decode(SubtitleInputBuffer inputBuffer,
SubtitleOutputBuffer outputBuffer,
boolean reset) |
Decodes the
inputBuffer and stores any decoded output in outputBuffer. |
String |
getName() |
Returns the name of the decoder.
|
void |
setPositionUs(long timeUs) |
Informs the decoder of the current playback position.
|
dequeueInputBuffer, dequeueOutputBuffer, flush, queueInputBuffer, releaseclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdequeueInputBuffer, dequeueOutputBuffer, flush, queueInputBuffer, release, releaseOutputBuffer, setInitialInputBufferSizeprotected SimpleSubtitleDecoder(String name)
name - The name of the decoder.public final String getName()
DecodergetName in interface Decoder<SubtitleInputBuffer,SubtitleOutputBuffer,SubtitleDecoderException>public void setPositionUs(long timeUs)
SubtitleDecoderMust be called prior to each attempt to dequeue output buffers from the decoder.
setPositionUs in interface SubtitleDecodertimeUs - The current playback position in microseconds.protected final SubtitleInputBuffer createInputBuffer()
SimpleDecodercreateInputBuffer in class SimpleDecoder<SubtitleInputBuffer,SubtitleOutputBuffer,SubtitleDecoderException>protected final SubtitleOutputBuffer createOutputBuffer()
SimpleDecodercreateOutputBuffer in class SimpleDecoder<SubtitleInputBuffer,SubtitleOutputBuffer,SubtitleDecoderException>protected final SubtitleDecoderException createUnexpectedDecodeException(Throwable error)
SimpleDecodercreateUnexpectedDecodeException in class SimpleDecoder<SubtitleInputBuffer,SubtitleOutputBuffer,SubtitleDecoderException>error - The unexpected decode error.@Nullable protected final SubtitleDecoderException decode(SubtitleInputBuffer inputBuffer, SubtitleOutputBuffer outputBuffer, boolean reset)
SimpleDecoderinputBuffer and stores any decoded output in outputBuffer.decode in class SimpleDecoder<SubtitleInputBuffer,SubtitleOutputBuffer,SubtitleDecoderException>inputBuffer - The buffer to decode.outputBuffer - The output buffer to store decoded data. The flag C.BUFFER_FLAG_DECODE_ONLY will be set if the same flag is set on inputBuffer, but
may be set/unset as required. If the flag is set when the call returns then the output
buffer will not be made available to dequeue. The output buffer may not have been populated
in this case.reset - Whether the decoder must be reset before decoding.protected abstract Subtitle decode(byte[] data, int size, boolean reset) throws SubtitleDecoderException
Subtitle.data - An array holding the data to be decoded, starting at position 0.size - The size of the data to be decoded.reset - Whether the decoder must be reset before decoding.Subtitle.SubtitleDecoderException - If a decoding error occurs.