RtpPcmReader
@UnstableApi
class RtpPcmReader : RtpPayloadReader
Parses byte stream carried on RTP packets, and extracts PCM frames. Refer to RFC3551 for more details.
Summary
Public constructors |
|---|
RtpPcmReader(payloadFormat: RtpPayloadFormat!) |
Public functions |
|
|---|---|
Unit |
consume(Consumes the payload from the an RTP packet. |
Unit |
createTracks(extractorOutput: ExtractorOutput!, trackId: Int)Initializes the reader by providing its output and track id. |
Unit |
onReceivingFirstPacket(timestamp: Long, sequenceNumber: Int)This method should be called on reading the first packet in a stream of incoming packets. |
Unit |
Seeks the reader. |
Public constructors
Public functions
consume
fun consume(
data: ParsableByteArray!,
timestamp: Long,
sequenceNumber: Int,
rtpMarker: Boolean
): Unit
Consumes the payload from the an RTP packet.
| Parameters | |
|---|---|
data: ParsableByteArray! |
The RTP payload to consume. |
timestamp: Long |
The timestamp of the RTP packet that transmitted the data. This number has no unit, the duration conveyed by it depends on the frequency of the media that the RTP packet is carrying. |
sequenceNumber: Int |
The sequence number of the RTP packet. |
rtpMarker: Boolean |
The marker bit of the RTP packet. The interpretation of this bit is specific to each payload format. |
| Throws | |
|---|---|
androidx.media3.common.ParserException |
If the data could not be parsed. |
createTracks
fun createTracks(extractorOutput: ExtractorOutput!, trackId: Int): Unit
Initializes the reader by providing its output and track id.
| Parameters | |
|---|---|
extractorOutput: ExtractorOutput! |
The |
trackId: Int |
The track identifier to set on the format. |
onReceivingFirstPacket
fun onReceivingFirstPacket(timestamp: Long, sequenceNumber: Int): Unit
This method should be called on reading the first packet in a stream of incoming packets.