Package com.google.android.exoplayer2.text.cea

## Class Cea708Decoder

- java.lang.Object
- - com.google.android.exoplayer2.text.cea.Cea708Decoder

- All Implemented Interfaces:
    `Decoder<SubtitleInputBuffer,​SubtitleOutputBuffer,​SubtitleDecoderException>`, `SubtitleDecoder`

      public final class Cea708Decoder
      extends Object

  A `SubtitleDecoder` for CEA-708 (also known as "EIA-708").

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `Cea708Decoder​(int accessibilityChannel, List<byte[]> initializationData)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected Subtitle` | `createSubtitle()` | Creates a `Subtitle` from the available data.
    `protected void` | `decode​(SubtitleInputBuffer inputBuffer)` | Filters and processes the raw data, providing `Subtitle`s via `createSubtitle()` when sufficient data has been processed.
    `SubtitleInputBuffer` | `dequeueInputBuffer()` | Dequeues the next input buffer to be filled and queued to the decoder.
    `SubtitleOutputBuffer` | `dequeueOutputBuffer()` | Dequeues the next output buffer from the decoder.
    `void` | `flush()` | Flushes the decoder.
    `protected SubtitleOutputBuffer` | `getAvailableOutputBuffer()` |
    `String` | `getName()` | Returns the name of the decoder.
    `protected long` | `getPositionUs()` |
    `protected boolean` | `isNewSubtitleDataAvailable()` | Returns whether there is data available to create a new `Subtitle`.
    `void` | `queueInputBuffer​(SubtitleInputBuffer inputBuffer)` | Queues an input buffer to the decoder.
    `void` | `release()` | Releases the decoder.
    `protected void` | `releaseOutputBuffer​(SubtitleOutputBuffer outputBuffer)` |
    `void` | `setPositionUs​(long positionUs)` | Informs the decoder of the current playback position.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Cea708Decoder

          public Cea708Decoder​(int accessibilityChannel,
                               @Nullable
                               List<byte[]> initializationData)

  - ### Method Detail

    - #### getName

          public String getName()

      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.

    - #### flush

          public void flush()

      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<SubtitleInputBuffer,​SubtitleOutputBuffer,​SubtitleDecoderException>`

    - #### isNewSubtitleDataAvailable

          protected boolean isNewSubtitleDataAvailable()

      Returns whether there is data available to create a new `Subtitle`.

    - #### createSubtitle

          protected Subtitle createSubtitle()

      Creates a `Subtitle` from the available data.

    - #### decode

          protected void decode​(SubtitleInputBuffer inputBuffer)

      Filters and processes the raw data, providing `Subtitle`s via `createSubtitle()` when sufficient data has been processed.

    - #### setPositionUs

          public void setPositionUs​(long positionUs)

      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 `SubtitleDecoder`
      Parameters:
        `positionUs` - The current playback position in microseconds.

    - #### dequeueInputBuffer

          @Nullable
          public SubtitleInputBuffer dequeueInputBuffer()
                                                 throws SubtitleDecoderException

      Description copied from interface: `Decoder`
      Dequeues the next input buffer to be filled and queued to the decoder.
      Specified by:
        `dequeueInputBuffer` in interface `Decoder<SubtitleInputBuffer,​SubtitleOutputBuffer,​SubtitleDecoderException>`
      Returns:
        The input buffer, which will have been cleared, or null if a buffer isn't available.
      Throws:
        `SubtitleDecoderException`

    - #### queueInputBuffer

          public void queueInputBuffer​(SubtitleInputBuffer inputBuffer)
                                throws SubtitleDecoderException

      Description copied from interface: `Decoder`
      Queues an input buffer to the decoder.
      Specified by:
        `queueInputBuffer` in interface `Decoder<SubtitleInputBuffer,​SubtitleOutputBuffer,​SubtitleDecoderException>`
      Parameters:
        `inputBuffer` - The input buffer.
      Throws:
        `SubtitleDecoderException`

    - #### dequeueOutputBuffer

          @Nullable
          public SubtitleOutputBuffer dequeueOutputBuffer()
                                                   throws SubtitleDecoderException

      Description copied from interface: `Decoder`
      Dequeues the next output buffer from the decoder.
      Specified by:
        `dequeueOutputBuffer` in interface `Decoder<SubtitleInputBuffer,​SubtitleOutputBuffer,​SubtitleDecoderException>`
      Returns:
        The output buffer, or null if an output buffer isn't available.
      Throws:
        `SubtitleDecoderException`

    - #### releaseOutputBuffer

          protected void releaseOutputBuffer​(SubtitleOutputBuffer outputBuffer)

    - #### release

          public void release()

      Description copied from interface: `Decoder`
      Releases the decoder. Must be called when the decoder is no longer needed.
      Specified by:
        `release` in interface `Decoder<SubtitleInputBuffer,​SubtitleOutputBuffer,​SubtitleDecoderException>`

    - #### getAvailableOutputBuffer

          @Nullable
          protected final SubtitleOutputBuffer getAvailableOutputBuffer()

    - #### getPositionUs

          protected final long getPositionUs()