Skip to main content

5.8.2. Media Section Parsing

5.8.2. Media Section Parsing

Like the session-level lines, the media section lines MUST occur in the specific order and with the specific syntax defined in [RFC4566], Section 5.

The m= line itself MUST be parsed as described in [RFC4566], Section 5.14, and the <media>, <port>, <proto>, and <fmt> values stored.

Following the m= line, specific processing MUST be applied for the following non-attribute lines:

  • As with the c= line at the session level, the c= line MUST be parsed according to [RFC4566], Section 5.7, but its value is not used.

  • The b= line, if present, MUST be parsed as specified in [RFC4566], Section 5.8, and the bwtype and bandwidth values stored.

Specific processing MUST also be applied for the following attribute lines:

  • If present, a single a=ice-ufrag line is parsed as specified in [RFC8839], Section 5.4, and the ufrag value is stored.

  • If present, a single a=ice-pwd line is parsed as specified in [RFC8839], Section 5.4, and the password value is stored.

  • If present, a single a=ice-options line is parsed as specified in [RFC8839], Section 5.6, and the set of specified options is stored.

  • Any a=candidate attributes MUST be parsed as specified in [RFC8839], Section 5.1, and their values stored.

  • Any a=remote-candidates attributes MUST be parsed as specified in [RFC8839], Section 5.2, but their values are ignored.

  • If present, a single a=end-of-candidates attribute MUST be parsed as specified in [RFC8840], Section 8.1, and its presence or absence flagged and stored.

  • Any a=fingerprint lines are parsed as specified in [RFC8122], Section 5, and the set of fingerprint and algorithm values is stored.

If the m= <proto> value indicates use of RTP, as described in Section 5.1.2, the following attribute lines MUST be processed:

  • The m= <fmt> value MUST be parsed as specified in [RFC4566], Section 5.14, and the individual values stored.

  • Any a=rtpmap or a=fmtp lines MUST be parsed as specified in [RFC4566], Section 6, and their values stored.

  • If present, a single a=ptime line MUST be parsed as described in [RFC4566], Section 6, and its value stored.

  • If present, a single a=maxptime line MUST be parsed as described in [RFC4566], Section 6, and its value stored.

  • If present, a single direction attribute line (e.g., a=sendrecv) MUST be parsed as described in [RFC4566], Section 6, and its value stored.

  • Any a=ssrc attributes MUST be parsed as specified in [RFC5576], Section 4.1, and their values stored.

  • Any a=extmap attributes MUST be parsed as specified in [RFC5285], Section 5, and their values stored.

  • Any a=rtcp-fb attributes MUST be parsed as specified in [RFC4585], Section 4.2, and their values stored.

  • If present, a single a=rtcp-mux attribute MUST be parsed as specified in [RFC5761], Section 5.1.3, and its presence or absence flagged and stored.

  • If present, a single a=rtcp-mux-only attribute MUST be parsed as specified in [RFC8858], Section 3, and its presence or absence flagged and stored.

  • If present, a single a=rtcp-rsize attribute MUST be parsed as specified in [RFC5506], Section 5, and its presence or absence flagged and stored.

  • If present, a single a=rtcp attribute MUST be parsed as specified in [RFC3605], Section 2.1, but its value is ignored, as this information is superfluous when using ICE.

  • If present, a=msid attributes MUST be parsed as specified in [RFC8830], Section 3.2, and their values stored, ignoring any appdata field. If no a=msid attributes are present, a random msid-id value is generated for a default MediaStream for the session, if not already present, and this value is stored.

  • Any a=imageattr attributes MUST be parsed as specified in [RFC6236], Section 3, and their values stored.

  • Any a=rid lines MUST be parsed as specified in [RFC8851], Section 10, and their values stored.

  • If present, a single a=simulcast line MUST be parsed as specified in [RFC8853], and its values stored.

Otherwise, if the m= <proto> value indicates use of SCTP, the following attribute lines MUST be processed:

  • The m= <fmt> value MUST be parsed as specified in [RFC8841], Section 4.3, and the application protocol value stored.

  • An a=sctp-port attribute MUST be present, and it MUST be parsed as specified in [RFC8841], Section 5.2, and the value stored.

  • If present, a single a=max-message-size attribute MUST be parsed as specified in [RFC8841], Section 6, and the value stored. Otherwise, use the specified default.

Other attributes that are not relevant to JSEP may also be present, and implementations SHOULD process any that they recognize. As required by [RFC4566], Section 5.13, unknown attribute lines MUST be ignored.