FakeTrackOutput
@UnstableApi
class FakeTrackOutput : TrackOutput, Dumper.Dumpable
A fake TrackOutput.
Summary
Nested types |
|---|
interface FakeTrackOutput.FactoryFactory for |
Constants |
|
|---|---|
const FakeTrackOutput.Factory! |
Public constructors |
|---|
FakeTrackOutput( |
Public functions |
|
|---|---|
Unit |
assertSample( |
Unit |
assertSampleCount(count: Int) |
Unit |
clear() |
Unit |
Dumps the fields of the object using the |
Unit |
durationUs(durationUs: Long)Called to set the duration of the track in microseconds. |
Unit |
Called when the |
Int |
|
TrackOutput.CryptoData? |
getSampleCryptoData(index: Int) |
ByteArray<Byte>! |
getSampleData(index: Int) |
Int |
getSampleFlags(index: Int) |
Long |
getSampleTimeUs(index: Int) |
(Mutable)List<Long!>! |
|
Unit |
sampleData(Called to write sample data to the output. |
Int |
sampleData(Called to write sample data to the output. |
Unit |
sampleMetadata(Called when metadata associated with a sample has been extracted from the stream. |
Inherited Constants |
|---|
Inherited functions |
||||
|---|---|---|---|---|
|
Constants
Public constructors
Public functions
assertSample
fun assertSample(
index: Int,
data: ByteArray!,
timeUs: Long,
flags: Int,
cryptoData: TrackOutput.CryptoData?
): Unit
durationUs
fun durationUs(durationUs: Long): Unit
Called to set the duration of the track in microseconds.
| Parameters | |
|---|---|
durationUs: Long |
The duration of the track in microseconds. |
format
fun format(format: Format!): Unit
Called when the Format of the track has been extracted from the stream.
sampleData
fun sampleData(
data: ParsableByteArray!,
length: Int,
@TrackOutput.SampleDataPart sampleDataPart: Int
): Unit
Called to write sample data to the output.
| Parameters | |
|---|---|
data: ParsableByteArray! |
A |
length: Int |
The number of bytes to read, starting from |
@TrackOutput.SampleDataPart sampleDataPart: Int |
The part of the sample data to which this call corresponds. |
sampleData
fun sampleData(
input: DataReader!,
length: Int,
allowEndOfInput: Boolean,
@TrackOutput.SampleDataPart sampleDataPart: Int
): Int
Called to write sample data to the output.
| Parameters | |
|---|---|
input: DataReader! |
A |
length: Int |
The maximum length to read from the input. |
allowEndOfInput: Boolean |
True if encountering the end of the input having read no data is allowed, and should result in |
@TrackOutput.SampleDataPart sampleDataPart: Int |
The part of the sample data to which this call corresponds. |
| Returns | |
|---|---|
Int |
The number of bytes appended. |
| Throws | |
|---|---|
java.io.IOException |
If an error occurred reading from the input. |
sampleMetadata
fun sampleMetadata(
timeUs: Long,
@C.BufferFlags flags: Int,
size: Int,
offset: Int,
cryptoData: TrackOutput.CryptoData?
): Unit
Called when metadata associated with a sample has been extracted from the stream.
The corresponding sample data will have already been passed to the output via calls to sampleData or sampleData.
| Parameters | |
|---|---|
timeUs: Long |
The media timestamp associated with the sample, in microseconds. |
@C.BufferFlags flags: Int |
Flags associated with the sample. See |
size: Int |
The size of the sample data, in bytes. |
offset: Int |
The number of bytes that have been passed to |
cryptoData: TrackOutput.CryptoData? |
The encryption data required to decrypt the sample. May be null. |