Skip to main content

Module rtx

Module rtx 

Source
Expand description

RFC 4588 RTX (Retransmission) helpers.

Packet format: RTX payload = 2-byte Original Sequence Number (OSN, network order) followed by the original RTP payload. RTX uses a dedicated SSRC and payload type associated with the primary codec via a=fmtp:<rtx-pt> apt=<primary-pt>.

Structs§

RtxSenderConfig
Sender-side RTX parameters negotiated for a primary media stream.

Functions§

allocate_rtx_payload_type
Pick a free dynamic payload type (96–127) not in used.
append_rtx_to_section
Append RTX rtpmap/fmtp lines and the PT to formats for a primary codec.
decode_osn
Decode OSN from the first two bytes of an RTX payload.
encode_osn
Encode OSN as big-endian bytes (test / debug helper).
extract_rtx_apt_map
Build RTX PT → primary PT map from media-section attributes.
extract_rtx_apt_map_from_attrs
Convenience over SDP Attribute list.
parse_apt
Parse apt=<pt> from an SDP fmtp value (e.g. "apt=96" or "apt=96;rtx-time=3000").
rtx_pt_for_primary
Find RTX payload type associated with primary_pt in an apt map.
unwrap_rtx_packet
Unwrap an RTX packet back into a primary media packet.
wrap_rtx_packet
Wrap a primary media packet into an RFC 4588 RTX retransmission packet.

Type Aliases§

RtxAptMap
Association parsed from SDP: RTX payload type → primary (associated) payload type.