Skip to main content

Module vp8

Module vp8 

Source
Expand description

VP8 RTP payload helpers.

These helpers operate on the codec payload slice, not on the full RTP packet. In runtime forwarding that slice starts after the RTP fixed header, CSRC list and any RTP header-extension block.

RFC 7741 puts a VP8 payload descriptor in front of the VP8 payload header. The descriptor is also where simulcast and temporal-layer packet identity is carried. o-sfu keeps the RFC constants here, while the runtime uses str0mโ€™s descriptor parser and patch support for local egress.

VP8 payload slice passed to this module

+------------------+----------------------+----------------------+
| descriptor byte  | extension bytes      | VP8 payload header   |
+------------------+----------------------+----------------------+
| X R N S PartID   | I L T K fields       | P bit and VP8 data   |
+------------------+----------------------+----------------------+

Extension bytes when X=1

+-------------+-------------------+-------------+----------------+
| I L T K ... | PictureID if I=1  | TL0 if L=1  | T/K if present |
+-------------+-------------------+-------------+----------------+
|             | 1 or 2 bytes      | 1 byte      | 1 byte         |
+-------------+-------------------+-------------+----------------+

Constantsยง

DIMENSION_MASK ๐Ÿ”’
INTERFRAME_BIT
VP8 payload-header P bit set for interframes.
I_BIT
PictureID present bit in the extended VP8 payload descriptor.
KEYFRAME_SYNC_CODE ๐Ÿ”’
K_BIT ๐Ÿ”’
LONG_PICTURE_ID_BIT
Long PictureID marker bit in the VP8 PictureID field.
LONG_PICTURE_ID_MASK
Value mask for the 15-bit VP8 long PictureID field.
LONG_PICTURE_ID_MODULUS
Modulus for the 15-bit VP8 long PictureID field.
L_BIT
TL0PICIDX present bit in the extended VP8 payload descriptor.
MAX_DEFINED_VERSION ๐Ÿ”’
PARTITION_ID_MASK ๐Ÿ”’
SHORT_PICTURE_ID_MASK
value mask for the 7-bit VP8 short PictureID field
S_BIT
Start of VP8 partition bit in the payload descriptor.
TEMPORAL_LAYER_ID_MASK
Value mask for the two-bit VP8 temporal-layer identity.
T_BIT
TID/Y/KEYIDX present bit in the extended VP8 payload descriptor.
VERSION_MASK ๐Ÿ”’
VERSION_SHIFT ๐Ÿ”’
X_BIT
Extended control bits are present in the VP8 payload descriptor.

Functionsยง

extended_frame_payload ๐Ÿ”’
Locates the VP8 frame bytes after an extended descriptor.
payload_starts_keyframe
Detects a complete VP8 keyframe prefix in the first RTP packet.
valid_keyframe_prefix ๐Ÿ”’