Back to Exoplayer

FakeMediaPeriod.TrackDataFactory (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/testutil/FakeMediaPeriod.TrackDataFactory.html

latest2.5 KB
Original Source

Package com.google.android.exoplayer2.testutil

Interface FakeMediaPeriod.TrackDataFactory


public static interfaceFakeMediaPeriod.TrackDataFactory

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

Method Summary

All Methods Static Methods Instance Methods Abstract Methods | Modifier and Type | Method | Description | | --- | --- | --- | | List<FakeSampleStream.FakeSampleStreamItem> | create​(Format format, MediaSource.MediaPeriodId mediaPeriodId) | Returns the list of FakeSampleStream.FakeSampleStreamItems that will be written the sample queue during playback. | | static FakeMediaPeriod.TrackDataFactory | singleSampleWithTimeUs​(long sampleTimeUs) | Returns a factory that always provides a single keyframe sample with time=sampleTimeUs and then end-of-stream. |

Method Detail

- 

create

[List](https://developer.android.com/reference/java/util/List.html "class or interface in java.util")<[FakeSampleStream.FakeSampleStreamItem](FakeSampleStream.FakeSampleStreamItem.html "class in com.google.android.exoplayer2.testutil")> create​([Format](../Format.html "class in com.google.android.exoplayer2")format,[MediaSource.MediaPeriodId](../source/MediaSource.MediaPeriodId.html "class in com.google.android.exoplayer2.source")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.

- 

singleSampleWithTimeUs

static[FakeMediaPeriod.TrackDataFactory](FakeMediaPeriod.TrackDataFactory.html "interface in com.google.android.exoplayer2.testutil")singleSampleWithTimeUs​(long sampleTimeUs)

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