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...