RTPPacket

data class RTPPacket(val paddingBytes: UByte, val payloadType: Byte, val sequence: UShort, val timestamp: UInt, val ssrc: UInt, val csrcIdentifiers: UIntArray, val hasMarker: Boolean, val hasExtension: Boolean, val payload: ByteArrayView)(source)

Originally from this GitHub library.

Ported to Kotlin.

Contains modifications to support RTP packets from Discord as they do not adhere to the standard RTP spec.

Some changes include

  • Timestamps are stored as UInt (4 bytes) not long.

  • Sequences are stored as UShort (2 bytes) not long.

  • Payload Types are stored as UByte (1 byte) not short.

  • SSRCs are stored as UInt (4 bytes) not long.

  • And most notably, the extension header is not exactly after the RTP header. Discord instead encrypts it along with the payload...

Constructors

Link copied to clipboard
constructor(paddingBytes: UByte, payloadType: Byte, sequence: UShort, timestamp: UInt, ssrc: UInt, csrcIdentifiers: UIntArray, hasMarker: Boolean, hasExtension: Boolean, payload: ByteArrayView)

Types

Link copied to clipboard
class Builder(var ssrc: UInt, var timestamp: UInt, var sequence: UShort, var payloadType: Byte, var payload: ByteArray)
Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val ssrc: UInt
Link copied to clipboard

Functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard