Class EmptySampleStream
- java.lang.Object
-
- com.google.android.exoplayer2.source.EmptySampleStream
-
- All Implemented Interfaces:
SampleStream
@Deprecated public final class EmptySampleStream extends Object implements SampleStream
Deprecated.com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.An emptySampleStream.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.google.android.exoplayer2.source.SampleStream
SampleStream.ReadDataResult, SampleStream.ReadFlags
-
-
Field Summary
-
Fields inherited from interface com.google.android.exoplayer2.source.SampleStream
FLAG_OMIT_SAMPLE_DATA, FLAG_PEEK, FLAG_REQUIRE_FORMAT
-
-
Constructor Summary
Constructors Constructor Description EmptySampleStream()Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanisReady()Deprecated.Returns whether data is available to be read.voidmaybeThrowError()Deprecated.Throws an error that's preventing data from being read.intreadData(FormatHolder formatHolder, DecoderInputBuffer buffer, @com.google.android.exoplayer2.source.SampleStream.ReadFlags int readFlags)Deprecated.Attempts to read from the stream.intskipData(long positionUs)Deprecated.Attempts to skip to the keyframe before the specified position, or to the end of the stream ifpositionUsis beyond it.
-
-
-
Method Detail
-
isReady
public boolean isReady()
Deprecated.Description copied from interface:SampleStreamReturns 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
SampleStream.readData(com.google.android.exoplayer2.FormatHolder, com.google.android.exoplayer2.decoder.DecoderInputBuffer, @com.google.android.exoplayer2.source.SampleStream.ReadFlags int). Hence an ended stream is always ready.- Specified by:
isReadyin interfaceSampleStream- Returns:
- Whether data is available to be read.
-
maybeThrowError
public void maybeThrowError()
Deprecated.Description copied from interface:SampleStreamThrows an error that's preventing data from being read. Does nothing if no such error exists.- Specified by:
maybeThrowErrorin interfaceSampleStream
-
readData
public int readData(FormatHolder formatHolder, DecoderInputBuffer buffer, @com.google.android.exoplayer2.source.SampleStream.ReadFlags int readFlags)
Deprecated.Description copied from interface:SampleStreamAttempts to read from the stream.If the stream has ended then
C.BUFFER_FLAG_END_OF_STREAMflag is set onbufferandC.RESULT_BUFFER_READis returned. Else if no data is available thenC.RESULT_NOTHING_READis returned. Else if the format of the media is changing or ifformatRequiredis set thenformatHolderis populated andC.RESULT_FORMAT_READis returned. Elsebufferis populated andC.RESULT_BUFFER_READis returned.- Specified by:
readDatain interfaceSampleStream- Parameters:
formatHolder- AFormatHolderto populate in the case of reading a format.buffer- ADecoderInputBufferto populate in the case of reading a sample or the end of the stream. If the end of the stream has been reached, theC.BUFFER_FLAG_END_OF_STREAMflag will be set on the buffer.readFlags- Flags controlling the behavior of this read operation.- Returns:
- The
resultof the read operation.
-
skipData
public int skipData(long positionUs)
Deprecated.Description copied from interface:SampleStreamAttempts to skip to the keyframe before the specified position, or to the end of the stream ifpositionUsis beyond it.- Specified by:
skipDatain interfaceSampleStream- Parameters:
positionUs- The specified time.- Returns:
- The number of samples that were skipped.
-
-