EmptySampleStream
@UnstableApi
class EmptySampleStream : SampleStream
An empty SampleStream.
Summary
Public constructors |
|---|
Public functions |
|
|---|---|
Boolean |
isReady()Returns whether data is available to be read. |
Unit |
Throws an error that's preventing data from being read. |
Int |
readData(Attempts to read from the stream. |
Int |
Attempts to skip to the keyframe before the specified position, or to the end of the stream if |
Inherited Constants |
||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Public constructors
Public functions
isReady
fun isReady(): Boolean
Returns whether data is available to be read.
Note: If the stream has ended then a buffer with the end of stream flag can always be read from readData. Hence an ended stream is always ready.
| Returns | |
|---|---|
Boolean |
Whether data is available to be read. |
maybeThrowError
fun maybeThrowError(): Unit
Throws an error that's preventing data from being read. Does nothing if no such error exists.
| Throws | |
|---|---|
java.io.IOException |
The underlying error. |
readData
fun readData(
formatHolder: FormatHolder!,
buffer: DecoderInputBuffer!,
@SampleStream.ReadFlags readFlags: Int
): Int
Attempts to read from the stream.
If the stream has ended then BUFFER_FLAG_END_OF_STREAM flag is set on
buffer and RESULT_BUFFER_READ is returned. Else if no data is available then RESULT_NOTHING_READ is returned. Else if the format of the media is changing or if
formatRequired is set then formatHolder is populated and RESULT_FORMAT_READ is returned. Else buffer is populated and RESULT_BUFFER_READ is returned.
| Parameters | |
|---|---|
formatHolder: FormatHolder! |
A |
buffer: DecoderInputBuffer! |
A |
@SampleStream.ReadFlags readFlags: Int |
Flags controlling the behavior of this read operation. |
| Throws | |
|---|---|
androidx.media3.decoder.DecoderInputBuffer.InsufficientCapacityException |
If the |