ElementaryStreamReader
@UnstableApi
public interface ElementaryStreamReader
Ac3Reader |
Parses a continuous (E-)AC-3 byte stream and extracts individual samples. |
Ac4Reader |
Parses a continuous AC-4 byte stream and extracts individual samples. |
AdtsReader |
Parses a continuous ADTS byte stream and extracts individual frames. |
DtsReader |
Parses a continuous DTS or DTS UHD byte stream and extracts individual samples. |
DvbSubtitleReader |
Parses DVB subtitle data and extracts individual frames. |
H262Reader |
Parses a continuous H262 byte stream and extracts individual frames. |
H263Reader |
Parses an ISO/IEC 14496-2 (MPEG-4 Part 2) or ITU-T Recommendation H.263 byte stream and extracts individual frames. |
H264Reader |
Parses a continuous H264 byte stream and extracts individual frames. |
H265Reader |
Parses a continuous H.265 byte stream and extracts individual frames. |
Id3Reader |
Parses ID3 data and extracts individual text information frames. |
LatmReader |
Parses and extracts samples from an AAC/LATM elementary stream. |
MpegAudioReader |
Parses a continuous MPEG Audio byte stream and extracts individual frames. |
MpeghReader |
Parses a continuous MPEG-H audio byte stream and extracts MPEG-H frames. |
Extracts individual samples from an elementary media stream, preserving original order.
The expected sequence of method calls is as follows:
createTracks(once at initialization)seek(optional, to reset the state)packetStarted(to signal the start of a new packet)consume(zero or more times, to provide packet data)packetFinished(to signal the end of the current packet)- Repeat steps 3-5 for subsequent packets
Summary
Public methods |
|
|---|---|
abstract void |
consume(ParsableByteArray data)Consumes (possibly partial) data from the current packet. |
abstract void |
createTracks(Initializes the reader by providing outputs and ids for the tracks. |
abstract void |
packetFinished(boolean isEndOfInput)Called when a packet ends. |
abstract void |
packetStarted(long pesTimeUs, @TsPayloadReader.Flags int flags)Called when a packet starts. |
abstract void |
seek()Notifies the reader that a seek has occurred. |
Public methods
consume
abstract void consume(ParsableByteArray data)
Consumes (possibly partial) data from the current packet.
| Parameters | |
|---|---|
ParsableByteArray data |
The data to consume. |
| Throws | |
|---|---|
androidx.media3.common.ParserException |
If the data could not be parsed. |
createTracks
abstract void createTracks(
ExtractorOutput extractorOutput,
TsPayloadReader.TrackIdGenerator idGenerator
)
Initializes the reader by providing outputs and ids for the tracks.
| Parameters | |
|---|---|
ExtractorOutput extractorOutput |
The |
TsPayloadReader.TrackIdGenerator idGenerator |
A |
packetStarted
abstract void packetStarted(long pesTimeUs, @TsPayloadReader.Flags int flags)
Called when a packet starts.
| Parameters | |
|---|---|
long pesTimeUs |
The timestamp associated with the packet. |
@TsPayloadReader.Flags int flags |