docs/doc/reference/com/google/android/exoplayer2/text/SimpleSubtitleDecoder.html
Package com.google.android.exoplayer2.text
All Implemented Interfaces:Decoder<SubtitleInputBuffer,SubtitleOutputBuffer,SubtitleDecoderException>, SubtitleDecoderDirect Known Subclasses:DvbDecoder, Mp4WebvttDecoder, PgsDecoder, SsaDecoder, SubripDecoder, TtmlDecoder, Tx3gDecoder, WebvttDecoder
[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public abstract classSimpleSubtitleDecoderextends[SimpleDecoder](../decoder/SimpleDecoder.html "class in com.google.android.exoplayer2.decoder")<[SubtitleInputBuffer](SubtitleInputBuffer.html "class in com.google.android.exoplayer2.text"),[SubtitleOutputBuffer](SubtitleOutputBuffer.html "class in com.google.android.exoplayer2.text"),[SubtitleDecoderException](SubtitleDecoderException.html "class in com.google.android.exoplayer2.text")>
implements[SubtitleDecoder](SubtitleDecoder.html "interface in com.google.android.exoplayer2.text")
Deprecated. com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.
Base class for subtitle parsers that use their own decode thread.
Constructors | Modifier | Constructor | Description |
| --- | --- | --- |
| protected | SimpleSubtitleDecoder(String name) |
Deprecated.
|
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods | Modifier and Type | Method | Description |
| --- | --- | --- |
| protected SubtitleInputBuffer | createInputBuffer() |
Deprecated.
Creates a new input buffer.
|
| protected SubtitleOutputBuffer | createOutputBuffer() |
Deprecated.
Creates a new output buffer.
|
| protected SubtitleDecoderException | createUnexpectedDecodeException(Throwable error) |
Deprecated.
Creates an exception to propagate for an unexpected decode error.
|
| protected abstract Subtitle | decode(byte[] data, int length, boolean reset) |
Deprecated.
Decodes data into a Subtitle.
|
| protected SubtitleDecoderException | decode(SubtitleInputBuffer inputBuffer, SubtitleOutputBuffer outputBuffer, boolean reset) |
Deprecated.
Decodes the inputBuffer and stores any decoded output in outputBuffer.
|
| String | getName() |
Deprecated.
Returns the name of the decoder.
|
| void | setPositionUs(long positionUs) |
Deprecated.
Informs the decoder of the current playback position. |
-
dequeueInputBuffer, dequeueOutputBuffer, flush, queueInputBuffer, release, releaseOutputBuffer, setInitialInputBufferSize
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
dequeueInputBuffer, dequeueOutputBuffer, flush, queueInputBuffer, release
-
protected SimpleSubtitleDecoder([String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")name)
Deprecated.
Parameters:name - The name of the decoder.
-
public final[String](https://developer.android.com/reference/java/lang/String.html "class or interface in java.lang")getName()
Deprecated.
Description copied from interface: Decoder
Returns the name of the decoder.
Specified by:getName in interface Decoder<SubtitleInputBuffer,SubtitleOutputBuffer,SubtitleDecoderException>Returns:The name of the decoder.
-
public void setPositionUs(long positionUs)
Deprecated.
Description copied from interface: SubtitleDecoder
Informs the decoder of the current playback position.
Must be called prior to each attempt to dequeue output buffers from the decoder.
Specified by:setPositionUs in interface SubtitleDecoderParameters:positionUs - The current playback position in microseconds.
-
protected final[SubtitleInputBuffer](SubtitleInputBuffer.html "class in com.google.android.exoplayer2.text")createInputBuffer()
Deprecated.
Description copied from class: SimpleDecoder
Creates a new input buffer.
Specified by:createInputBuffer in class SimpleDecoder<SubtitleInputBuffer,SubtitleOutputBuffer,SubtitleDecoderException>
-
protected final[SubtitleOutputBuffer](SubtitleOutputBuffer.html "class in com.google.android.exoplayer2.text")createOutputBuffer()
Deprecated.
Description copied from class: SimpleDecoder
Creates a new output buffer.
Specified by:createOutputBuffer in class SimpleDecoder<SubtitleInputBuffer,SubtitleOutputBuffer,SubtitleDecoderException>
-
protected final[SubtitleDecoderException](SubtitleDecoderException.html "class in com.google.android.exoplayer2.text")createUnexpectedDecodeException([Throwable](https://developer.android.com/reference/java/lang/Throwable.html "class or interface in java.lang")error)
Deprecated.
Description copied from class: SimpleDecoder
Creates an exception to propagate for an unexpected decode error.
Specified by:createUnexpectedDecodeException in class SimpleDecoder<SubtitleInputBuffer,SubtitleOutputBuffer,SubtitleDecoderException>Parameters:error - The unexpected decode error.Returns:The exception to propagate.
-
@Nullable
protected final[SubtitleDecoderException](SubtitleDecoderException.html "class in com.google.android.exoplayer2.text")decode([SubtitleInputBuffer](SubtitleInputBuffer.html "class in com.google.android.exoplayer2.text")inputBuffer,[SubtitleOutputBuffer](SubtitleOutputBuffer.html "class in com.google.android.exoplayer2.text")outputBuffer,
boolean reset)
Deprecated.
Description copied from class: SimpleDecoder
Decodes the inputBuffer and stores any decoded output in outputBuffer.
Specified by:decode in class SimpleDecoder<SubtitleInputBuffer,SubtitleOutputBuffer,SubtitleDecoderException>Parameters: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.Returns:A decoder exception if an error occurred, or null if decoding was successful.
-
protected abstract[Subtitle](Subtitle.html "interface in com.google.android.exoplayer2.text")decode(byte[] data,
int length,
boolean reset)
throws[SubtitleDecoderException](SubtitleDecoderException.html "class in com.google.android.exoplayer2.text")
Deprecated.
Decodes data into a Subtitle.
Parameters:data - An array holding the data to be decoded, starting at position 0.length - The number of bytes from data to be decoded.reset - Whether the decoder must be reset before decoding.Returns:The decoded Subtitle.Throws:SubtitleDecoderException - If a decoding error occurs.