public interface

FakeMediaPeriod.TrackDataFactory

 androidx.media3.test.utils.FakeMediaPeriod.TrackDataFactory

Overview

A factory to create the test data for a particular track.

Summary

Methods
public java.util.List<FakeSampleStream.FakeSampleStreamItem>create(Format format, MediaSource.MediaPeriodId mediaPeriodId)

Returns the list of FakeSampleStream.FakeSampleStreamItems that will be written the sample queue during playback.

public static FakeMediaPeriod.TrackDataFactorysingleSampleWithTimeUs(long sampleTimeUs)

Returns a factory that always provides a single keyframe sample with time=sampleTimeUs and then end-of-stream.

Methods

public java.util.List<FakeSampleStream.FakeSampleStreamItem> create(Format format, MediaSource.MediaPeriodId mediaPeriodId)

Returns the list of FakeSampleStream.FakeSampleStreamItems that will be written the sample queue during playback.

Parameters:

format: The format of the track to provide data for.
mediaPeriodId: The MediaSource.MediaPeriodId to provide data for.

Returns:

The track data in the form of FakeSampleStream.FakeSampleStreamItems.

public static FakeMediaPeriod.TrackDataFactory singleSampleWithTimeUs(long sampleTimeUs)

Returns a factory that always provides a single keyframe sample with time=sampleTimeUs and then end-of-stream.