FakeAdaptiveDataSet


@UnstableApi
public final class FakeAdaptiveDataSet extends FakeDataSet


Fake data set emulating the data of an adaptive media source. It provides chunk data for all Formats in the given TrackGroup.

Summary

Nested types

public final class FakeAdaptiveDataSet.Factory

Factory for FakeAdaptiveDataSets.

MediaChunkIterator for the chunks defined by a fake adaptive data set.

Public fields

final int

Public methods

int
long
getChunkDuration(int chunkIndex)
int
getChunkIndexByPosition(long positionUs)
long
getStartTime(int chunkIndex)
String
getUri(int trackIndex)

Inherited methods

From androidx.media3.test.utils.FakeDataSet
ArrayList<FakeDataSet.FakeData>

Returns a list of all data including defaultData.

@Nullable FakeDataSet.FakeData

Returns the data for the given uri, or defaultData if no data is set.

@Nullable FakeDataSet.FakeData
getData(Uri uri)

Returns the data for the given uri, or defaultData if no data is set.

FakeDataSet.FakeData

Returns a new FakeData with the given uri.

FakeDataSet.FakeData
newData(Uri uri)

Returns a new FakeData with the given uri.

FakeDataSet.FakeData

Sets the default data, overwrites if there is one already.

FakeDataSet
setData(String uri, byte[] data)

Sets the given data for the given uri.

FakeDataSet
setData(Uri uri, byte[] data)

Sets the given data for the given uri.

FakeDataSet
setRandomData(String uri, int length)

Sets random data with the given length for the given uri.

FakeDataSet
setRandomData(Uri uri, int length)

Sets random data with the given length for the given uri.

Public fields

chunkCount

public final int chunkCount

Public methods

getChunkCount

public int getChunkCount()

getChunkDuration

public long getChunkDuration(int chunkIndex)

getChunkIndexByPosition

public int getChunkIndexByPosition(long positionUs)

getStartTime

public long getStartTime(int chunkIndex)

getUri

public String getUri(int trackIndex)