Package com.google.android.exoplayer2.decoder

## Interface Decoder<I,​O,​E extends DecoderException>

- Type Parameters:
    `I` - The type of buffer input to the decoder.
    `O` - The type of buffer output from the decoder.
    `E` - The type of exception thrown from the decoder.
  All Known Subinterfaces:
    `SubtitleDecoder`
  All Known Implementing Classes:
    `Cea608Decoder`, `Cea708Decoder`, `DvbDecoder`, `ExoplayerCuesDecoder`, `FlacDecoder`, `Gav1Decoder`, `Mp4WebvttDecoder`, `OpusDecoder`, `PgsDecoder`, `SimpleDecoder`, `SimpleSubtitleDecoder`, `SsaDecoder`, `SubripDecoder`, `TtmlDecoder`, `Tx3gDecoder`, `VpxDecoder`, `WebvttDecoder`

      public interface Decoder<I,​O,​E extends DecoderException>

  A media decoder.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `I` | `dequeueInputBuffer()` | Dequeues the next input buffer to be filled and queued to the decoder.
    `O` | `dequeueOutputBuffer()` | Dequeues the next output buffer from the decoder.
    `void` | `flush()` | Flushes the decoder.
    `String` | `getName()` | Returns the name of the decoder.
    `void` | `queueInputBuffer​(I inputBuffer)` | Queues an input buffer to the decoder.
    `void` | `release()` | Releases the decoder.

- - ### Method Detail

    - #### getName

          String getName()

      Returns the name of the decoder.
      Returns:
        The name of the decoder.

    - #### dequeueInputBuffer

          @Nullable
          I dequeueInputBuffer()
                        throws E extends DecoderException

      Dequeues the next input buffer to be filled and queued to the decoder.
      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`

    - #### queueInputBuffer

          void queueInputBuffer​(I inputBuffer)
                         throws E extends DecoderException

      Queues an input buffer to the decoder.
      Parameters:
        `inputBuffer` - The input buffer.
      Throws:
        `E` - If a decoder error has occurred.
        `E extends DecoderException`

    - #### dequeueOutputBuffer

          @Nullable
          O dequeueOutputBuffer()
                         throws E extends DecoderException

      Dequeues the next output buffer from the decoder.
      Returns:
        The output buffer, or null if an output buffer isn't available.
      Throws:
        `E` - If a decoder error has occurred.
        `E extends DecoderException`

    - #### flush

          void flush()

      Flushes the decoder. Ownership of dequeued input buffers is returned to the decoder. The caller is still responsible for releasing any dequeued output buffers.

    - #### release

          void release()

      Releases the decoder. Must be called when the decoder is no longer needed.