FakeSampleStream.FakeSampleStreamItem


public final class FakeSampleStream.FakeSampleStreamItem


Item to customize a return value of readData.

Summary

Constants

static final FakeSampleStream.FakeSampleStreamItem

Item that designates the end of stream has been reached.

Public methods

static FakeSampleStream.FakeSampleStreamItem
format(Format format)

Creates an item representing the provided format.

static FakeSampleStream.FakeSampleStreamItem
oneByteSample(long timeUs)

Creates an item representing a sample with the provided timestamp.

static FakeSampleStream.FakeSampleStreamItem
oneByteSample(long timeUs, @C.BufferFlags int flags)

Creates an item representing a sample with the provided timestamp and flags.

static FakeSampleStream.FakeSampleStreamItem
sample(long timeUs, @C.BufferFlags int flags, byte[] sampleData)

Creates an item representing a sample with the provided timestamp, flags and data.

Constants

END_OF_STREAM_ITEM

public static final FakeSampleStream.FakeSampleStreamItem END_OF_STREAM_ITEM

Item that designates the end of stream has been reached.

Public methods

format

public static FakeSampleStream.FakeSampleStreamItem format(Format format)

Creates an item representing the provided format.

oneByteSample

public static FakeSampleStream.FakeSampleStreamItem oneByteSample(long timeUs)

Creates an item representing a sample with the provided timestamp.

The sample will contain a single byte of data.

Parameters
long timeUs

The timestamp of the sample.

oneByteSample

public static FakeSampleStream.FakeSampleStreamItem oneByteSample(long timeUs, @C.BufferFlags int flags)

Creates an item representing a sample with the provided timestamp and flags.

The sample will contain a single byte of data.

Parameters
long timeUs

The timestamp of the sample.

@C.BufferFlags int flags

The sample C.BufferFlags.

sample

public static FakeSampleStream.FakeSampleStreamItem sample(long timeUs, @C.BufferFlags int flags, byte[] sampleData)

Creates an item representing a sample with the provided timestamp, flags and data.

Parameters
long timeUs

The timestamp of the sample.

@C.BufferFlags int flags

The sample C.BufferFlags.

byte[] sampleData

The sample data.