Package com.google.android.exoplayer2.source.chunk

## Class BaseMediaChunkOutput

- java.lang.Object
- - com.google.android.exoplayer2.source.chunk.BaseMediaChunkOutput

- All Implemented Interfaces:
    `ChunkExtractor.TrackOutputProvider`

      public final class BaseMediaChunkOutput
      extends Object
      implements ChunkExtractor.TrackOutputProvider

  A `ChunkExtractor.TrackOutputProvider` that provides `TrackOutputs` based on a predefined mapping from track type to output.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `BaseMediaChunkOutput​(int[] trackTypes, SampleQueue[] sampleQueues)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `int[]` | `getWriteIndices()` | Returns the current absolute write indices of the individual sample queues.
    `void` | `setSampleOffsetUs​(long sampleOffsetUs)` | Sets an offset that will be added to the timestamps (and sub-sample timestamps) of samples subsequently written to the sample queues.
    `TrackOutput` | `track​(int id, @com.google.android.exoplayer2.C.TrackType int type)` | Called to get the `TrackOutput` for a specific track.

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

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

- - ### Constructor Detail

    - #### BaseMediaChunkOutput

          public BaseMediaChunkOutput​(int[] trackTypes,
                                      SampleQueue[] sampleQueues)

      Parameters:
        `trackTypes` - The track types of the individual track outputs.
        `sampleQueues` - The individual sample queues.

  - ### Method Detail

    - #### track

          public TrackOutput track​(int id,
                                   @com.google.android.exoplayer2.C.TrackType int type)

      Description copied from interface: `ChunkExtractor.TrackOutputProvider`
      Called to get the `TrackOutput` for a specific track.

      The same `TrackOutput` is returned if multiple calls are made with the same `id`.

      Specified by:
        `track` in interface `ChunkExtractor.TrackOutputProvider`
      Parameters:
        `id` - A track identifier.
        `type` - The `type` of the track.
      Returns:
        The `TrackOutput` for the given track identifier.

    - #### getWriteIndices

          public int[] getWriteIndices()

      Returns the current absolute write indices of the individual sample queues.

    - #### setSampleOffsetUs

          public void setSampleOffsetUs​(long sampleOffsetUs)

      Sets an offset that will be added to the timestamps (and sub-sample timestamps) of samples subsequently written to the sample queues.