public abstract class SimpleSubtitleDecoder extends SimpleDecoder<SubtitleInputBuffer,SubtitleOutputBuffer,SubtitleDecoderException> implements SubtitleDecoder
| Modifier | Constructor and Description |
|---|---|
protected |
SimpleSubtitleDecoder(java.lang.String name) |
| Modifier and Type | Method and Description |
|---|---|
protected SubtitleInputBuffer |
createInputBuffer()
Creates a new input buffer.
|
protected SubtitleOutputBuffer |
createOutputBuffer()
Creates a new output buffer.
|
protected SubtitleDecoderException |
createUnexpectedDecodeException(java.lang.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. |
java.lang.String |
getName()
Returns the name of the decoder.
|
protected void |
releaseOutputBuffer(SubtitleOutputBuffer buffer)
Releases an output buffer back to the decoder.
|
void |
setPositionUs(long timeUs)
Informs the decoder of the current playback position.
|
dequeueInputBuffer, dequeueOutputBuffer, flush, queueInputBuffer, release, setInitialInputBufferSizeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdequeueInputBuffer, dequeueOutputBuffer, flush, queueInputBuffer, releaseprotected SimpleSubtitleDecoder(java.lang.String name)
name - The name of the decoder.public final java.lang.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(java.lang.Throwable error)
SimpleDecodercreateUnexpectedDecodeException in class SimpleDecoder<SubtitleInputBuffer,SubtitleOutputBuffer,SubtitleDecoderException>error - The unexpected decode error.protected final void releaseOutputBuffer(SubtitleOutputBuffer buffer)
SimpleDecoderreleaseOutputBuffer in class SimpleDecoder<SubtitleInputBuffer,SubtitleOutputBuffer,SubtitleDecoderException>buffer - The output buffer being released.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.