Back to Exoplayer

FakeSampleStream.FakeSampleStreamItem (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/testutil/FakeSampleStream.FakeSampleStreamItem.html

latest4.7 KB
Original Source

Package com.google.android.exoplayer2.testutil

Class FakeSampleStream.FakeSampleStreamItem


public static final classFakeSampleStream.FakeSampleStreamItemextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")

Item to customize a return value of SampleStream.readData(com.google.android.exoplayer2.FormatHolder, com.google.android.exoplayer2.decoder.DecoderInputBuffer, @com.google.android.exoplayer2.source.SampleStream.ReadFlags int).

Field Summary

Fields | Modifier and Type | Field | Description | | --- | --- | --- | | static FakeSampleStream.FakeSampleStreamItem | END_OF_STREAM_ITEM | Item that designates the end of stream has been reached. |

Method Summary

All Methods Static Methods Concrete Methods | Modifier and Type | Method | Description | | --- | --- | --- | | 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, @com.google.android.exoplayer2.C.BufferFlags int flags) | Creates an item representing a sample with the provided timestamp and flags. | | static FakeSampleStream.FakeSampleStreamItem | sample​(long timeUs, @com.google.android.exoplayer2.C.BufferFlags int flags, byte[] sampleData) | Creates an item representing a sample with the provided timestamp, flags and data. |

- 

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

- 

END_OF_STREAM_ITEM

public static final[FakeSampleStream.FakeSampleStreamItem](FakeSampleStream.FakeSampleStreamItem.html "class in com.google.android.exoplayer2.testutil")END_OF_STREAM_ITEM

Item that designates the end of stream has been reached.

Method Detail

- 

format

public static[FakeSampleStream.FakeSampleStreamItem](FakeSampleStream.FakeSampleStreamItem.html "class in com.google.android.exoplayer2.testutil")format​([Format](../Format.html "class in com.google.android.exoplayer2")format)

Creates an item representing the provided format.

- 

oneByteSample

public static[FakeSampleStream.FakeSampleStreamItem](FakeSampleStream.FakeSampleStreamItem.html "class in com.google.android.exoplayer2.testutil")oneByteSample​(long timeUs)

Creates an item representing a sample with the provided timestamp.

The sample will contain a single byte of data.

Parameters:timeUs - The timestamp of the sample.

- 

oneByteSample

public static[FakeSampleStream.FakeSampleStreamItem](FakeSampleStream.FakeSampleStreamItem.html "class in com.google.android.exoplayer2.testutil")oneByteSample​(long timeUs,
                                                                  @com.google.android.exoplayer2.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:timeUs - The timestamp of the sample.flags - The sample C.BufferFlags.

- 

sample

public static[FakeSampleStream.FakeSampleStreamItem](FakeSampleStream.FakeSampleStreamItem.html "class in com.google.android.exoplayer2.testutil")sample​(long timeUs,
                                                           @com.google.android.exoplayer2.C.BufferFlags int flags,
                                                           byte[] sampleData)

Creates an item representing a sample with the provided timestamp, flags and data. Parameters:timeUs - The timestamp of the sample.flags - The sample C.BufferFlags.sampleData - The sample data.