Skip to main content

Module header_extension

Module header_extension 

Source
Expand description

RTP header-extension profile IDs from RFC 8285.

RTP packets carry an extension block only when the fixed-header X bit is set. The 16-bit profile ID then decides whether extension elements use the one-byte or two-byte element header shape.

RTP extension block

+----------------+----------------+-----------------------------+
| profile ID     | length in u32  | extension elements          |
+----------------+----------------+-----------------------------+
| 16 bits        | 16 bits        | padded to 32-bit boundary   |
+----------------+----------------+-----------------------------+

One-byte element, profile 0xBEDE

+---------+---------+----------------------+
| ID      | len-1   | data                 |
+---------+---------+----------------------+
| 4 bits  | 4 bits  | 1 to 16 bytes        |
+---------+---------+----------------------+

Two-byte element, profile 0x1000 through 0x100F

+---------+---------+----------------------+
| ID      | len     | data                 |
+---------+---------+----------------------+
| 8 bits  | 8 bits  | 0 to 255 bytes       |
+---------+---------+----------------------+

Constantsยง

HEADER_BYTES ๐Ÿ”’
ONE_BYTE_DATA_LEN_MAX
ONE_BYTE_DATA_LEN_MIN
One-byte header extension data size bounds from RFC 8285 section 4.2.
ONE_BYTE_ID_MAX
ONE_BYTE_ID_MIN
ONE_BYTE_ID_PAD
One-byte header extension identifier values.
ONE_BYTE_ID_RESERVED
ONE_BYTE_ID_SHIFT ๐Ÿ”’
ONE_BYTE_LENGTH_MASK ๐Ÿ”’
ONE_BYTE_LENGTH_OFFSET ๐Ÿ”’
ONE_BYTE_PROFILE_ID
RFC 8285 one-byte header extension profile ID.
TWO_BYTE_DATA_LEN_MAX
TWO_BYTE_DATA_LEN_MIN
Two-byte header extension data size bounds from RFC 8285 section 4.3.
TWO_BYTE_PROFILE_ID_BASE
Base value for the RFC 8285 two-byte header profile with appbits set to 0.
TWO_BYTE_PROFILE_PREFIX_MASK
Mask for the fixed 12-bit prefix (0x100) in the two-byte profile ID.
WORD_BYTES ๐Ÿ”’

Functionsยง

find_one_byte_element
Finds an RFC 8285 one-byte extension element in a complete muxed RTP packet.
is_one_byte_id
Returns whether id is usable as an RFC 8285 one-byte element ID.
two_byte_profile_id
Builds an RFC 8285 two-byte profile ID from the 4-bit appbits value.