# BaseMediaChunkOutput

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

*** ** * ** ***


```
@UnstableApi
public final class BaseMediaChunkOutput implements ChunkExtractor.TrackOutputProvider
```

<br />

*** ** * ** ***

A `https://developer.android.com/reference/androidx/media3/exoplayer/source/chunk/ChunkExtractor.TrackOutputProvider` that provides `https://developer.android.com/reference/androidx/media3/extractor/TrackOutput` based on a predefined mapping from track type to output.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/media3/exoplayer/source/chunk/BaseMediaChunkOutput#BaseMediaChunkOutput(int[],androidx.media3.exoplayer.source.SampleQueue[])(int[] trackTypes, SampleQueue[] sampleQueues)` |

| ### Public methods |
|---|---|
| `int[]` | `https://developer.android.com/reference/androidx/media3/exoplayer/source/chunk/BaseMediaChunkOutput#getWriteIndices()()` Returns the current absolute write indices of the individual sample queues. |
| `void` | `https://developer.android.com/reference/androidx/media3/exoplayer/source/chunk/BaseMediaChunkOutput#setSampleOffsetUs(long)(long sampleOffsetUs)` Sets an offset that will be added to the timestamps (and sub-sample timestamps) of samples subsequently written to the sample queues. |
| `https://developer.android.com/reference/androidx/media3/extractor/TrackOutput` | `https://developer.android.com/reference/androidx/media3/exoplayer/source/chunk/BaseMediaChunkOutput#track(int,int)(int id, @https://developer.android.com/reference/androidx/media3/common/C.TrackType int type)` Called to get the `https://developer.android.com/reference/androidx/media3/extractor/TrackOutput` for a specific track. |

## Public constructors

### BaseMediaChunkOutput

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

| Parameters |
|---|---|
| `int[] trackTypes` | The track types of the individual track outputs. |
| `SampleQueue[] sampleQueues` | The individual sample queues. |

## Public methods

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

### track

```
public TrackOutput track(int id, @C.TrackType int type)
```

Called to get the `https://developer.android.com/reference/androidx/media3/extractor/TrackOutput` for a specific track.

The same `https://developer.android.com/reference/androidx/media3/extractor/TrackOutput` is returned if multiple calls are made with the same `
id`.

| Parameters |
|---|---|
| `int id` | A track identifier. |
| `@https://developer.android.com/reference/androidx/media3/common/C.TrackType int type` | The `https://developer.android.com/reference/androidx/media3/common/C.TrackType` of the track. |

| Returns |
|---|---|
| `https://developer.android.com/reference/androidx/media3/extractor/TrackOutput` | The `https://developer.android.com/reference/androidx/media3/extractor/TrackOutput` for the given track identifier. |