Package com.google.android.exoplayer2.text.ssa

## Class SsaDecoder

- java.lang.Object
- - com.google.android.exoplayer2.decoder.SimpleDecoder<SubtitleInputBuffer,​SubtitleOutputBuffer,​SubtitleDecoderException>
  - - com.google.android.exoplayer2.text.SimpleSubtitleDecoder
    - - com.google.android.exoplayer2.text.ssa.SsaDecoder

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

      public final class SsaDecoder
      extends SimpleSubtitleDecoder

  A `SimpleSubtitleDecoder` for SSA/ASS.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `SsaDecoder()` |
    `SsaDecoder​(List<byte[]> initializationData)` | Constructs an SsaDecoder with optional format and header info.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected Subtitle` | `decode​(byte[] data, int length, boolean reset)` | Decodes data into a `Subtitle`.

    - ### Methods inherited from class com.google.android.exoplayer2.text.SimpleSubtitleDecoder

      `createInputBuffer, createOutputBuffer, createUnexpectedDecodeException, decode, getName, setPositionUs`

    - ### 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

    - #### SsaDecoder

          public SsaDecoder()

    - #### SsaDecoder

          public SsaDecoder​(@Nullable
                            List<byte[]> initializationData)

      Constructs an SsaDecoder with optional format and header info.
      Parameters:
        `initializationData` - Optional initialization data for the decoder. If not null or empty, the initialization data must consist of two byte arrays. The first must contain an SSA format line. The second must contain an SSA header that will be assumed common to all samples. The header is everything in an SSA file before the `[Events]` section (i.e. `[Script Info]` and optional `[V4+ Styles]` section.

  - ### Method Detail

    - #### decode

          protected Subtitle decode​(byte[] data,
                                    int length,
                                    boolean reset)

      Description copied from class: `SimpleSubtitleDecoder`
      Decodes data into a `Subtitle`.
      Specified by:
        `decode` in class `SimpleSubtitleDecoder`
      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`.