> Documentation index: https://developer.android.com/reference/llms.txt

# BaseMediaChunkOutput

Artifact: [androidx.media3:media3-exoplayer](https://developer.android.com/jetpack/androidx/releases/media3.md.txt) [View Source](https://cs.android.com/search?q=file:androidx/media3/exoplayer/source/chunk/BaseMediaChunkOutput.java+class:androidx.media3.exoplayer.source.chunk.BaseMediaChunkOutput)

*** ** * ** ***


```
@UnstableApi
class BaseMediaChunkOutput : ChunkExtractor.TrackOutputProvider
```

<br />

*** ** * ** ***

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

When multiple sample queues of the same `C.TrackType` are provided, each distinct track `id` of that type is bound to its own sample queue in the order the IDs are first requested.

## Summary

| ### Public constructors |
|---|
| `BaseMediaChunkOutput( trackTypes: IntArray<Int>!, sampleQueues: Array<SampleQueue!>! )` |

| ### Public functions |
|---|---|
| `Array<Int>!` | `getWriteIndices()` Returns the current absolute write indices of the individual sample queues. |
| `Unit` | `setSampleOffsetUs(sampleOffsetUs: Long)` Sets an offset that will be added to the timestamps (and sub-sample timestamps) of samples subsequently written to the sample queues. |
| `TrackOutput!` | `track(id: Int, @C.TrackType type: Int)` Called to get the `TrackOutput` for a specific track. |

## Public constructors

### BaseMediaChunkOutput

```
BaseMediaChunkOutput(
    trackTypes: IntArray<Int>!,
    sampleQueues: Array<SampleQueue!>!
)
```

| Parameters |
|---|---|
| `trackTypes: IntArray<Int>!` | The track types of the individual track outputs. |
| `sampleQueues: Array<SampleQueue!>!` | The individual sample queues. |

## Public functions

### getWriteIndices

```
fun getWriteIndices(): Array<Int>!
```

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

### setSampleOffsetUs

```
fun setSampleOffsetUs(sampleOffsetUs: Long): Unit
```

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

### track

```
fun track(id: Int, @C.TrackType type: Int): TrackOutput!
```

Called to get the `TrackOutput` for a specific track.

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

| Parameters |
|---|---|
| `id: Int` | A track identifier. |
| `@C.TrackType type: Int` | The `type` of the track. |

| Returns |
|---|---|
| `TrackOutput!` | The `TrackOutput` for the given track identifier. |