Package com.google.android.exoplayer2.source.mediaparser

## Class OutputConsumerAdapterV30

- java.lang.Object
- - com.google.android.exoplayer2.source.mediaparser.OutputConsumerAdapterV30

- All Implemented Interfaces:
    `MediaParser.OutputConsumer`

      @RequiresApi(30)
      public final class OutputConsumerAdapterV30
      extends Object
      implements MediaParser.OutputConsumer

  `MediaParser.OutputConsumer` implementation that redirects output to an `ExtractorOutput`.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `OutputConsumerAdapterV30()` | Equivalent to `OutputConsumerAdapterV30(primaryTrackManifestFormat= null, primaryTrackType= C.TRACK_TYPE_NONE, expectDummySeekMap= false)`
    `OutputConsumerAdapterV30​(Format primaryTrackManifestFormat, @com.google.android.exoplayer2.C.TrackType int primaryTrackType, boolean expectDummySeekMap)` | Creates a new instance.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `disableSeeking()` | Overrides future received `SeekMaps` with non-seekable instances.
    `ChunkIndex` | `getChunkIndex()` | Returns the most recently output `ChunkIndex`, or null if none has been output.
    `MediaParser.SeekMap` | `getDummySeekMap()` | Returns a dummy `MediaParser.SeekMap`, or null if not available.
    `Format[]` | `getSampleFormats()` | Returns the last output format for each track, or null if not all the tracks have been identified.
    `Pair<MediaParser.SeekPoint,​MediaParser.SeekPoint>` | `getSeekPoints​(long seekTimeUs)` | Returns the `MediaParser.SeekPoint` instances corresponding to the given timestamp.
    `void` | `onSampleCompleted​(int trackIndex, long timeUs, int flags, int size, int offset, MediaCodec.CryptoInfo cryptoInfo)` |
    `void` | `onSampleDataFound​(int trackIndex, MediaParser.InputReader sampleData)` |
    `void` | `onSeekMapFound​(MediaParser.SeekMap seekMap)` |
    `void` | `onTrackCountFound​(int numberOfTracks)` |
    `void` | `onTrackDataFound​(int trackIndex, MediaParser.TrackData trackData)` |
    `void` | `setExtractorOutput​(ExtractorOutput extractorOutput)` | Sets the `ExtractorOutput` to which `MediaParser's` output is directed.
    `void` | `setMuxedCaptionFormats​(List<Format> muxedCaptionFormats)` | Sets `Format` information associated to the caption tracks multiplexed in the media.
    `void` | `setSampleTimestampUpperLimitFilterUs​(long sampleTimestampUpperLimitFilterUs)` | Sets an upper limit for sample timestamp filtering.
    `void` | `setSelectedParserName​(String parserName)` | Defines the container mime type to propagate through `TrackOutput.format(com.google.android.exoplayer2.Format)`.
    `void` | `setTimestampAdjuster​(TimestampAdjuster timestampAdjuster)` | Sets a `TimestampAdjuster` for adjusting the timestamps of the output samples.

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

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

- - ### Constructor Detail

    - #### OutputConsumerAdapterV30

          public OutputConsumerAdapterV30()

      Equivalent to `OutputConsumerAdapterV30(primaryTrackManifestFormat= null, primaryTrackType= C.TRACK_TYPE_NONE, expectDummySeekMap= false)`

    - #### OutputConsumerAdapterV30

          public OutputConsumerAdapterV30​(@Nullable
                                          Format primaryTrackManifestFormat,
                                          @com.google.android.exoplayer2.C.TrackType int primaryTrackType,
                                          boolean expectDummySeekMap)

      Creates a new instance.
      Parameters:
        `primaryTrackManifestFormat` - The manifest-obtained format of the primary track, or null if not applicable.
        `primaryTrackType` - The `type` of the primary track. `C.TRACK_TYPE_NONE` if there is no primary track.
        `expectDummySeekMap` - Whether the output consumer should expect an initial dummy seek map which should be exposed through `getDummySeekMap()`.

  - ### Method Detail

    - #### setSampleTimestampUpperLimitFilterUs

          public void setSampleTimestampUpperLimitFilterUs​(long sampleTimestampUpperLimitFilterUs)

      Sets an upper limit for sample timestamp filtering.

      When set, samples with timestamps greater than `sampleTimestampUpperLimitFilterUs` will be discarded.

      Parameters:
        `sampleTimestampUpperLimitFilterUs` - The maximum allowed sample timestamp, or `C.TIME_UNSET` to remove filtering.

    - #### setTimestampAdjuster

          public void setTimestampAdjuster​(TimestampAdjuster timestampAdjuster)

      Sets a `TimestampAdjuster` for adjusting the timestamps of the output samples.

    - #### setExtractorOutput

          public void setExtractorOutput​(ExtractorOutput extractorOutput)

      Sets the `ExtractorOutput` to which `MediaParser's` output is directed.

    - #### setMuxedCaptionFormats

          public void setMuxedCaptionFormats​(List<Format> muxedCaptionFormats)

      Sets `Format` information associated to the caption tracks multiplexed in the media.

    - #### disableSeeking

          public void disableSeeking()

      Overrides future received `SeekMaps` with non-seekable instances.

    - #### getDummySeekMap

          @Nullable
          public MediaParser.SeekMap getDummySeekMap()

      Returns a dummy `MediaParser.SeekMap`, or null if not available.

      the dummy `MediaParser.SeekMap` returns a single `MediaParser.SeekPoint` whose `MediaParser.SeekPoint.timeMicros` matches the requested timestamp, and `MediaParser.SeekPoint.position` is 0.

    - #### getChunkIndex

          @Nullable
          public ChunkIndex getChunkIndex()

      Returns the most recently output `ChunkIndex`, or null if none has been output.

    - #### getSeekPoints

          public Pair<MediaParser.SeekPoint,​MediaParser.SeekPoint> getSeekPoints​(long seekTimeUs)

      Returns the `MediaParser.SeekPoint` instances corresponding to the given timestamp.
      Parameters:
        `seekTimeUs` - The timestamp in microseconds to retrieve `MediaParser.SeekPoint` instances for.
      Returns:
        The `MediaParser.SeekPoint` instances corresponding to the given timestamp.

    - #### setSelectedParserName

          public void setSelectedParserName​(String parserName)

      Defines the container mime type to propagate through `TrackOutput.format(com.google.android.exoplayer2.Format)`.
      Parameters:
        `parserName` - The name of the selected parser.

    - #### getSampleFormats

          @Nullable
          public Format[] getSampleFormats()

      Returns the last output format for each track, or null if not all the tracks have been identified.

    - #### onTrackCountFound

          public void onTrackCountFound​(int numberOfTracks)

      Specified by:
        `onTrackCountFound` in interface `MediaParser.OutputConsumer`

    - #### onSeekMapFound

          public void onSeekMapFound​(MediaParser.SeekMap seekMap)

      Specified by:
        `onSeekMapFound` in interface `MediaParser.OutputConsumer`

    - #### onTrackDataFound

          public void onTrackDataFound​(int trackIndex,
                                       MediaParser.TrackData trackData)

      Specified by:
        `onTrackDataFound` in interface `MediaParser.OutputConsumer`

    - #### onSampleDataFound

          public void onSampleDataFound​(int trackIndex,
                                        MediaParser.InputReader sampleData)
                                 throws IOException

      Specified by:
        `onSampleDataFound` in interface `MediaParser.OutputConsumer`
      Throws:
        `IOException`

    - #### onSampleCompleted

          public void onSampleCompleted​(int trackIndex,
                                        long timeUs,
                                        int flags,
                                        int size,
                                        int offset,
                                        @Nullable
                                        MediaCodec.CryptoInfo cryptoInfo)

      Specified by:
        `onSampleCompleted` in interface `MediaParser.OutputConsumer`