ProgressiveMediaExtractor
@UnstableApi
public interface ProgressiveMediaExtractor
BundledExtractorsAdapter |
|
MediaParserExtractorAdapter |
|
Extracts the contents of a container file from a progressive media stream.
Summary
Nested types |
|---|
public interface ProgressiveMediaExtractor.FactoryCreates |
Public methods |
|
|---|---|
abstract void |
Disables seeking in MP3 streams. |
abstract long |
Returns the current read position in the input stream, or |
abstract void |
init(Initializes the underlying infrastructure for reading from the input. |
abstract int |
read(PositionHolder positionHolder)Extracts data starting at the current input stream position. |
abstract void |
release()Releases any held resources. |
abstract void |
seek(long position, long seekTimeUs)Notifies the extracting infrastructure that a seek has occurred. |
Public methods
disableSeekingOnMp3Streams
abstract void disableSeekingOnMp3Streams()
Disables seeking in MP3 streams.
MP3 live streams commonly have seekable metadata, despite being unseekable.
getCurrentInputPosition
abstract long getCurrentInputPosition()
Returns the current read position in the input stream, or INDEX_UNSET if no input is available.
init
abstract void init(
DataReader dataReader,
Uri uri,
Map<String, List<String>> responseHeaders,
long position,
long length,
ExtractorOutput output
)
Initializes the underlying infrastructure for reading from the input.
| Parameters | |
|---|---|
DataReader dataReader |
The |
Uri uri |
The |
Map<String, List<String>> responseHeaders |
The response headers of the media, or an empty map if there are none. |
long position |
The initial position of the |
long length |
The length of the stream, or |
ExtractorOutput output |
The |
| Throws | |
|---|---|
androidx.media3.exoplayer.source.UnrecognizedInputFormatException |
Thrown if the input format could not be detected. |
java.io.IOException |
Thrown if the input could not be read. |
read
abstract int read(PositionHolder positionHolder)
Extracts data starting at the current input stream position.
| Parameters | |
|---|---|
PositionHolder positionHolder |
If |
| Returns | |
|---|---|
int |
One of the |
| Throws | |
|---|---|
java.io.IOException |
If an error occurred reading from the input. |
seek
abstract void seek(long position, long seekTimeUs)
Notifies the extracting infrastructure that a seek has occurred.
| Parameters | |
|---|---|
long position |
The byte offset in the stream from which data will be provided. |
long seekTimeUs |
The seek time in microseconds. |