Class SimpleSubtitleDecoder
- java.lang.Object
-
- com.google.android.exoplayer2.decoder.SimpleDecoder<SubtitleInputBuffer,SubtitleOutputBuffer,SubtitleDecoderException>
-
- com.google.android.exoplayer2.text.SimpleSubtitleDecoder
-
- All Implemented Interfaces:
Decoder<SubtitleInputBuffer,SubtitleOutputBuffer,SubtitleDecoderException>,SubtitleDecoder
- Direct Known Subclasses:
DvbDecoder,Mp4WebvttDecoder,PgsDecoder,SsaDecoder,SubripDecoder,TtmlDecoder,Tx3gDecoder,WebvttDecoder
@Deprecated public abstract class SimpleSubtitleDecoder extends SimpleDecoder<SubtitleInputBuffer,SubtitleOutputBuffer,SubtitleDecoderException> implements SubtitleDecoder
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.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedSimpleSubtitleDecoder(String name)Deprecated.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected SubtitleInputBuffercreateInputBuffer()Deprecated.Creates a new input buffer.protected SubtitleOutputBuffercreateOutputBuffer()Deprecated.Creates a new output buffer.protected SubtitleDecoderExceptioncreateUnexpectedDecodeException(Throwable error)Deprecated.Creates an exception to propagate for an unexpected decode error.protected abstract Subtitledecode(byte[] data, int length, boolean reset)Deprecated.Decodes data into aSubtitle.protected SubtitleDecoderExceptiondecode(SubtitleInputBuffer inputBuffer, SubtitleOutputBuffer outputBuffer, boolean reset)Deprecated.Decodes theinputBufferand stores any decoded output inoutputBuffer.StringgetName()Deprecated.Returns the name of the decoder.voidsetPositionUs(long positionUs)Deprecated.Informs the decoder of the current playback position.-
Methods inherited from class com.google.android.exoplayer2.decoder.SimpleDecoder
dequeueInputBuffer, dequeueOutputBuffer, flush, queueInputBuffer, release, releaseOutputBuffer, setInitialInputBufferSize
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.google.android.exoplayer2.decoder.Decoder
dequeueInputBuffer, dequeueOutputBuffer, flush, queueInputBuffer, release
-
-
-
-
Constructor Detail
-
SimpleSubtitleDecoder
protected SimpleSubtitleDecoder(String name)
Deprecated.- Parameters:
name- The name of the decoder.
-
-
Method Detail
-
getName
public final String getName()
Deprecated.Description copied from interface:DecoderReturns the name of the decoder.- Specified by:
getNamein interfaceDecoder<SubtitleInputBuffer,SubtitleOutputBuffer,SubtitleDecoderException>- Returns:
- The name of the decoder.
-
setPositionUs
public void setPositionUs(long positionUs)
Deprecated.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.
-
createInputBuffer
protected final SubtitleInputBuffer createInputBuffer()
Deprecated.Description copied from class:SimpleDecoderCreates a new input buffer.- Specified by:
createInputBufferin classSimpleDecoder<SubtitleInputBuffer,SubtitleOutputBuffer,SubtitleDecoderException>
-
createOutputBuffer
protected final SubtitleOutputBuffer createOutputBuffer()
Deprecated.Description copied from class:SimpleDecoderCreates a new output buffer.- Specified by:
createOutputBufferin classSimpleDecoder<SubtitleInputBuffer,SubtitleOutputBuffer,SubtitleDecoderException>
-
createUnexpectedDecodeException
protected final SubtitleDecoderException createUnexpectedDecodeException(Throwable error)
Deprecated.Description copied from class:SimpleDecoderCreates an exception to propagate for an unexpected decode error.- Specified by:
createUnexpectedDecodeExceptionin classSimpleDecoder<SubtitleInputBuffer,SubtitleOutputBuffer,SubtitleDecoderException>- Parameters:
error- The unexpected decode error.- Returns:
- The exception to propagate.
-
decode
@Nullable protected final SubtitleDecoderException decode(SubtitleInputBuffer inputBuffer, SubtitleOutputBuffer outputBuffer, boolean reset)
Deprecated.Description copied from class:SimpleDecoderDecodes theinputBufferand stores any decoded output inoutputBuffer.- Specified by:
decodein classSimpleDecoder<SubtitleInputBuffer,SubtitleOutputBuffer,SubtitleDecoderException>- Parameters:
inputBuffer- The buffer to decode.outputBuffer- The output buffer to store decoded data. The flagC.BUFFER_FLAG_DECODE_ONLYwill be set if the same flag is set oninputBuffer, 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.
-
decode
protected abstract Subtitle decode(byte[] data, int length, boolean reset) throws SubtitleDecoderException
Deprecated.Decodes data into aSubtitle.- Parameters:
data- An array holding the data to be decoded, starting at position 0.length- The number of bytes fromdatato be decoded.reset- Whether the decoder must be reset before decoding.- Returns:
- The decoded
Subtitle. - Throws:
SubtitleDecoderException- If a decoding error occurs.
-
-