docs/doc/reference/com/google/android/exoplayer2/decoder/SimpleDecoder.html
Package com.google.android.exoplayer2.decoder
All Implemented Interfaces:Decoder<I,O,E>Direct Known Subclasses:FlacDecoder, Gav1Decoder, OpusDecoder, SimpleSubtitleDecoder, VpxDecoder
[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public abstract classSimpleDecoder\<I extends [DecoderInputBuffer](DecoderInputBuffer.html "class in com.google.android.exoplayer2.decoder"),O extends [DecoderOutputBuffer](DecoderOutputBuffer.html "class in com.google.android.exoplayer2.decoder"),E extends [DecoderException](DecoderException.html "class in com.google.android.exoplayer2.decoder")\>extends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")implements[Decoder](Decoder.html "interface in com.google.android.exoplayer2.decoder")<I,O,E>
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 Decoders that use their own decode thread and decode each input buffer immediately into a corresponding output buffer.
Constructors | Modifier | Constructor | Description |
| --- | --- | --- |
| protected | SimpleDecoder(I[] inputBuffers, O[] outputBuffers) |
Deprecated.
|
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods | Modifier and Type | Method | Description |
| --- | --- | --- |
| protected abstract I | createInputBuffer() |
Deprecated.
Creates a new input buffer.
|
| protected abstract O | createOutputBuffer() |
Deprecated.
Creates a new output buffer.
|
| protected abstract E | createUnexpectedDecodeException(Throwable error) |
Deprecated.
Creates an exception to propagate for an unexpected decode error.
|
| protected abstract E | decode(I inputBuffer, O outputBuffer, boolean reset) |
Deprecated.
Decodes the inputBuffer and stores any decoded output in outputBuffer.
|
| I | dequeueInputBuffer() |
Deprecated.
Dequeues the next input buffer to be filled and queued to the decoder.
|
| O | dequeueOutputBuffer() |
Deprecated.
Dequeues the next output buffer from the decoder.
|
| void | flush() |
Deprecated.
Flushes the decoder.
|
| void | queueInputBuffer(I inputBuffer) |
Deprecated.
Queues an input buffer to the decoder.
|
| void | release() |
Deprecated.
Releases the decoder.
|
| protected void | releaseOutputBuffer(O outputBuffer) |
Deprecated.
Releases an output buffer back to the decoder.
|
| protected void | setInitialInputBufferSize(int size) |
Deprecated.
Sets the initial size of each input buffer. |
-
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
getName
-
protected SimpleDecoder([I](SimpleDecoder.html "type parameter in SimpleDecoder")[] inputBuffers,[O](SimpleDecoder.html "type parameter in SimpleDecoder")[] outputBuffers)
Deprecated.
Parameters:inputBuffers - An array of nulls that will be used to store references to input buffers.outputBuffers - An array of nulls that will be used to store references to output buffers.
-
protected final void setInitialInputBufferSize(int size)
Deprecated.
Sets the initial size of each input buffer.
This method should only be called before the decoder is used (i.e. before the first call to dequeueInputBuffer().
Parameters:size - The required input buffer size.
-
@Nullable
public final[I](SimpleDecoder.html "type parameter in SimpleDecoder")dequeueInputBuffer()
throws[E](SimpleDecoder.html "type parameter in SimpleDecoder")extends[DecoderException](DecoderException.html "class in com.google.android.exoplayer2.decoder")
Deprecated.
Description copied from interface: Decoder
Dequeues the next input buffer to be filled and queued to the decoder.
Specified by:dequeueInputBuffer in interface Decoder<I extends DecoderInputBuffer,O extends DecoderOutputBuffer,E extends DecoderException>Returns:The input buffer, which will have been cleared, or null if a buffer isn't available.Throws:E - If a decoder error has occurred.E extends DecoderException
-
public final void queueInputBuffer([I](SimpleDecoder.html "type parameter in SimpleDecoder")inputBuffer)
throws[E](SimpleDecoder.html "type parameter in SimpleDecoder")extends[DecoderException](DecoderException.html "class in com.google.android.exoplayer2.decoder")
Deprecated.
Description copied from interface: Decoder
Queues an input buffer to the decoder.
Specified by:queueInputBuffer in interface Decoder<I extends DecoderInputBuffer,O extends DecoderOutputBuffer,E extends DecoderException>Parameters:inputBuffer - The input buffer.Throws:E - If a decoder error has occurred.E extends DecoderException
-
@Nullable
public final[O](SimpleDecoder.html "type parameter in SimpleDecoder")dequeueOutputBuffer()
throws[E](SimpleDecoder.html "type parameter in SimpleDecoder")extends[DecoderException](DecoderException.html "class in com.google.android.exoplayer2.decoder")
Deprecated.
Description copied from interface: Decoder
Dequeues the next output buffer from the decoder.
Specified by:dequeueOutputBuffer in interface Decoder<I extends DecoderInputBuffer,O extends DecoderOutputBuffer,E extends DecoderException>Returns:The output buffer, or null if an output buffer isn't available.Throws:E - If a decoder error has occurred.E extends DecoderException
-
@CallSuper
protected void releaseOutputBuffer([O](SimpleDecoder.html "type parameter in SimpleDecoder")outputBuffer)
Deprecated.
Releases an output buffer back to the decoder.
Parameters:outputBuffer - The output buffer being released.
-
public final void flush()
Deprecated.
Description copied from interface: Decoder
Flushes the decoder. Ownership of dequeued input buffers is returned to the decoder. The caller is still responsible for releasing any dequeued output buffers.
Specified by:flush in interface Decoder<I extends DecoderInputBuffer,O extends DecoderOutputBuffer,E extends DecoderException>
-
@CallSuper
public void release()
Deprecated.
Description copied from interface: Decoder
Releases the decoder. Must be called when the decoder is no longer needed.
Specified by:release in interface Decoder<I extends DecoderInputBuffer,O extends DecoderOutputBuffer,E extends DecoderException>
-
protected abstract[I](SimpleDecoder.html "type parameter in SimpleDecoder")createInputBuffer()
Deprecated.
Creates a new input buffer.
-
protected abstract[O](SimpleDecoder.html "type parameter in SimpleDecoder")createOutputBuffer()
Deprecated.
Creates a new output buffer.
-
protected abstract[E](SimpleDecoder.html "type parameter in SimpleDecoder")createUnexpectedDecodeException([Throwable](https://developer.android.com/reference/java/lang/Throwable.html "class or interface in java.lang")error)
Deprecated.
Creates an exception to propagate for an unexpected decode error.
Parameters:error - The unexpected decode error.Returns:The exception to propagate.
-
@Nullable
protected abstract[E](SimpleDecoder.html "type parameter in SimpleDecoder")decode([I](SimpleDecoder.html "type parameter in SimpleDecoder")inputBuffer,[O](SimpleDecoder.html "type parameter in SimpleDecoder")outputBuffer,
boolean reset)
Deprecated.
Decodes the inputBuffer and stores any decoded output in outputBuffer.
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.