Package com.google.android.exoplayer2.extractor.ts

## Interface ElementaryStreamReader

- All Known Implementing Classes:
    `Ac3Reader`, `Ac4Reader`, `AdtsReader`, `DtsReader`, `DvbSubtitleReader`, `H262Reader`, `H263Reader`, `H264Reader`, `H265Reader`, `Id3Reader`, `LatmReader`, `MpegAudioReader`

      public interface ElementaryStreamReader

  Extracts individual samples from an elementary media stream, preserving original order.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `consume​(ParsableByteArray data)` | Consumes (possibly partial) data from the current packet.
    `void` | `createTracks​(ExtractorOutput extractorOutput, TsPayloadReader.TrackIdGenerator idGenerator)` | Initializes the reader by providing outputs and ids for the tracks.
    `void` | `packetFinished()` | Called when a packet ends.
    `void` | `packetStarted​(long pesTimeUs, @com.google.android.exoplayer2.extractor.ts.TsPayloadReader.Flags int flags)` | Called when a packet starts.
    `void` | `seek()` | Notifies the reader that a seek has occurred.

- - ### Method Detail

    - #### seek

          void seek()

      Notifies the reader that a seek has occurred.

    - #### createTracks

          void createTracks​(ExtractorOutput extractorOutput,
                            TsPayloadReader.TrackIdGenerator idGenerator)

      Initializes the reader by providing outputs and ids for the tracks.
      Parameters:
        `extractorOutput` - The `ExtractorOutput` that receives the extracted data.
        `idGenerator` - A `TsPayloadReader.TrackIdGenerator` that generates unique track ids for the `TrackOutput`s.

    - #### packetStarted

          void packetStarted​(long pesTimeUs,
                             @com.google.android.exoplayer2.extractor.ts.TsPayloadReader.Flags int flags)

      Called when a packet starts.
      Parameters:
        `pesTimeUs` - The timestamp associated with the packet.
        `flags` - See `TsPayloadReader.Flags`.

    - #### consume

          void consume​(ParsableByteArray data)
                throws ParserException

      Consumes (possibly partial) data from the current packet.
      Parameters:
        `data` - The data to consume.
      Throws:
        `ParserException` - If the data could not be parsed.

    - #### packetFinished

          void packetFinished()

      Called when a packet ends.