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 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, setInitialInputBufferSize
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
dequeueInputBuffer, dequeueOutputBuffer, flush, queueInputBuffer, release
protected SimpleSubtitleDecoder(java.lang.String name)
name
- The name of the decoder.public final java.lang.String getName()
Decoder
getName
in interface Decoder<SubtitleInputBuffer,SubtitleOutputBuffer,SubtitleDecoderException>
public void setPositionUs(long timeUs)
SubtitleDecoder
Must be called prior to each attempt to dequeue output buffers from the decoder.
setPositionUs
in interface SubtitleDecoder
timeUs
- The current playback position in microseconds.protected final SubtitleInputBuffer createInputBuffer()
SimpleDecoder
createInputBuffer
in class SimpleDecoder<SubtitleInputBuffer,SubtitleOutputBuffer,SubtitleDecoderException>
protected final SubtitleOutputBuffer createOutputBuffer()
SimpleDecoder
createOutputBuffer
in class SimpleDecoder<SubtitleInputBuffer,SubtitleOutputBuffer,SubtitleDecoderException>
protected final void releaseOutputBuffer(SubtitleOutputBuffer buffer)
SimpleDecoder
releaseOutputBuffer
in class SimpleDecoder<SubtitleInputBuffer,SubtitleOutputBuffer,SubtitleDecoderException>
buffer
- The output buffer being released.protected final SubtitleDecoderException decode(SubtitleInputBuffer inputBuffer, SubtitleOutputBuffer outputBuffer, boolean reset)
SimpleDecoder
inputBuffer
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.