Skip to main content

Module session

Module session 

Source
Expand description

The whole session description, plus the well-known attribute keys. The session description — a whole SDP document.

A SessionDescription is the session-level fields (v=, o=, s=, t=, …) followed by any number of MediaDescriptions. unmarshal parses one from a string and marshal prints it back; the round trip is faithful, including attributes this crate does not interpret.

The ATTR_KEY_* constants name the a= attributes WebRTC relies on — mid, msid, setup, rtcp-mux, extmap and the direction flags — and the SEMANTIC_TOKEN_* constants name the grouping semantics used with a=group and a=msid-semantic.

Structs§

Origin
Origin defines the structure for the “o=” field which provides the originator of the session plus a session identifier and version number.
ParseOptions
What SessionDescription::unmarshal_with_options accepts beyond the RFC 8866 grammar.
RepeatTime
RepeatTime describes the “r=” fields of the session description which represents the intervals and durations for repeated scheduled sessions.
SdpDecimal
A decimal number of any length, 1*DIGIT: the <sess-id> and <sess-version> of an o= line (RFC 8866 section 9). The grammar sets no upper bound, so a compliant description may carry values beyond 64 bits (RFC 9429 section 5.2.1 has a JSEP endpoint generate them within 64 bits, and section 5.8 has it accept compliant SDP that does not follow its generation rules).
SdpParseError
A description that does not parse, and where: what SessionDescription::parse_located returns.
SessionDescription
SessionDescription is a a well-defined format for conveying sufficient information to discover and participate in a multimedia session.
TimeDescription
TimeDescription describes the “t=”, “r=” and “z=” fields of the session description, which specify the start and stop times of a session, its repeat intervals and durations, and the time zone adjustments of those repetitions.
TimeZone
TimeZone is one <adjustment time> <offset> pair of a “z=” line, which describes repeated sessions scheduling.
Timing
Timing defines the “t=” field’s structured representation for the start and stop times.

Enums§

Charset
The character set of a description’s charset-dependent fields (s=, i=), from its a=charset (RFC 8866 section 6.10).

Constants§

ATTR_KEY_BUNDLE_ONLY
a=bundle-only: the section is used only inside its BUNDLE group (RFC 9143).
ATTR_KEY_CANDIDATE
Constants for SDP attributes used in JSEP
ATTR_KEY_CHARSET
The a=charset attribute (RFC 8866 section 6.10).
ATTR_KEY_CONNECTION_SETUP
a=setup: the DTLS role — active, passive or actpass.
ATTR_KEY_CONTENT
a=content: what a media stream shows (RFC 4796).
ATTR_KEY_CRYPTEX
a=cryptex: RTP header extensions and CSRCs are encrypted (RFC 9335).
ATTR_KEY_END_OF_CANDIDATES
a=end-of-candidates: ICE gathering for this section is complete.
ATTR_KEY_EXTMAP_ALLOW_MIXED
a=extmap-allow-mixed: one- and two-byte header extensions may be mixed.
ATTR_KEY_EXT_MAP
a=extmap: maps an RTP header-extension URI to an id.
ATTR_KEY_FINGERPRINT
a=fingerprint: a certificate fingerprint (RFC 8122).
ATTR_KEY_FMTP
a=fmtp: format-specific parameters.
ATTR_KEY_FRAMERATE
a=framerate: the maximum video frame rate.
ATTR_KEY_GROUP
a=group: groups m-lines, as BUNDLE does.
ATTR_KEY_ICELITE
a=ice-lite: the endpoint is an ICE-lite implementation.
ATTR_KEY_ICE_OPTIONS
a=ice-options: the ICE options the agent supports.
ATTR_KEY_ICE_PACING
a=ice-pacing: the ICE pacing interval, in milliseconds.
ATTR_KEY_ICE_PWD
a=ice-pwd: the ICE password.
ATTR_KEY_ICE_UFRAG
a=ice-ufrag: the ICE user name fragment.
ATTR_KEY_IDENTITY
a=identity: an identity assertion for the session.
ATTR_KEY_IMAGEATTR
a=imageattr: image sizes a payload type sends or receives (RFC 6236).
ATTR_KEY_INACTIVE
a=inactive: neither send nor receive.
ATTR_KEY_MAXPTIME
a=maxptime: the longest packet duration, in milliseconds.
ATTR_KEY_MAX_MESSAGE_SIZE
a=max-message-size: the largest SCTP message this endpoint accepts.
ATTR_KEY_MID
a=mid: the media identification tag that names this m-line.
ATTR_KEY_MSID
a=msid: associates a track with a media stream.
ATTR_KEY_MSID_SEMANTIC
a=msid-semantic: declares the semantics used by a=msid.
ATTR_KEY_PTIME
a=ptime: the preferred packet duration, in milliseconds.
ATTR_KEY_RECV_ONLY
a=recvonly: receive only.
ATTR_KEY_REMOTE_CANDIDATES
a=remote-candidates: the remote candidates the controlling agent selected.
ATTR_KEY_RID
a=rid: an RTP stream identifier and its restrictions (RFC 8851).
ATTR_KEY_RTCP
a=rtcp: the RTCP port and address (RFC 3605).
ATTR_KEY_RTCPMUX
a=rtcp-mux: RTP and RTCP share one port.
ATTR_KEY_RTCPMUX_ONLY
a=rtcp-mux-only: RTP and RTCP share one port and nothing else is supported (RFC 8858).
ATTR_KEY_RTCPRSIZE
a=rtcp-rsize: reduced-size RTCP is supported.
ATTR_KEY_RTCP_FB
a=rtcp-fb: an RTCP feedback capability (RFC 4585).
ATTR_KEY_RTCP_XR
a=rtcp-xr: RTCP extended reports (RFC 3611).
ATTR_KEY_RTPMAP
a=rtpmap: the codec of a payload type.
ATTR_KEY_SCTPMAP
a=sctpmap: the SCTP association of an old-style data section (draft-ietf-mmusic-sctp-sdp-05; replaced by a=sctp-port).
ATTR_KEY_SCTP_PORT
a=sctp-port: the SCTP port (RFC 8841).
ATTR_KEY_SEND_ONLY
a=sendonly: send only.
ATTR_KEY_SEND_RECV
a=sendrecv: send and receive.
ATTR_KEY_SIMULCAST
a=simulcast: the simulcast streams of a media section (RFC 8853).
ATTR_KEY_SSRC
a=ssrc: declares an SSRC and its attributes.
ATTR_KEY_SSRC_GROUP
a=ssrc-group: relates SSRCs, such as an RTX stream to its primary.
ATTR_KEY_TLS_ID
a=tls-id: the DTLS association identifier (RFC 8842).
MAX_ATTRIBUTES_PER_SECTION
The most a= lines SessionDescription::unmarshal accepts at the session level, and in each m= section.
MAX_FORMATS_PER_MEDIA
The most formats SessionDescription::unmarshal accepts on one m= line. RTP payload types are 7 bits, so 128 distinct values exist.
MAX_MEDIA_DESCRIPTIONS
The most m= sections SessionDescription::unmarshal accepts in one session description.
MAX_SDP_LINES
The most lines SessionDescription::unmarshal accepts in one session description.
MAX_SDP_SIZE
The largest session description, in bytes, SessionDescription::unmarshal accepts. Real offers and answers are a few to a few hundred kilobytes.
NTP_UNIX_EPOCH_OFFSET_SECS
The seconds from the NTP epoch (1900-01-01 UTC) to the Unix epoch: RFC 8866 section 5.2 recommends “a timestamp, in seconds since January 1, 1900 UTC” for <sess-id> and, “as with ”, for <sess-version>.
SEMANTIC_TOKEN_BUNDLE
BUNDLE: the m= sections share one transport (RFC 9143).
SEMANTIC_TOKEN_FLOW_IDENTIFICATION
FID: flow identification — the SSRCs carry the same content, as RTX does.
SEMANTIC_TOKEN_FORWARD_ERROR_CORRECTION
FEC: one SSRC carries error-correction data for another.
SEMANTIC_TOKEN_FORWARD_ERROR_CORRECTION_FRAMEWORK
FEC-FR: the FEC framework grouping semantic.
SEMANTIC_TOKEN_LIP_SYNCHRONIZATION
Constants for semantic tokens used in JSEP
SEMANTIC_TOKEN_WEBRTC_MEDIA_STREAMS
WMS: WebRTC media streams, used with a=msid-semantic.

Type Aliases§

EmailAddress
EmailAddress describes a structured representations for the “e=” line which specifies email contact information for the person responsible for the conference.
PhoneNumber
PhoneNumber describes a structured representations for the “p=” line specify phone contact information for the person responsible for the conference.
SessionName
SessionName describes a structured representations for the “s=” field and is the textual session name.
Version
Version describes the value provided by the “v=” field which gives the version of the Session Description Protocol.