BaseMediaChunkOutput


@UnstableApi
public final class BaseMediaChunkOutput implements ChunkExtractor.TrackOutputProvider


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

Summary

Public constructors

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

Public methods

int[]

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, @C.TrackType int type)

Called to get the 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 TrackOutput for a specific track.

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

Parameters
int id

A track identifier.

@C.TrackType int type

The type of the track.

Returns
TrackOutput

The TrackOutput for the given track identifier.