Skip to main content

negotiate_consumer_rtp_parameters

Function negotiate_consumer_rtp_parameters 

Source
pub fn negotiate_consumer_rtp_parameters(
    consumable_parameters: &MediaStream,
    consumer_capabilities: &MediaCapabilities,
) -> Result<MediaStream, RtpNegotiationError>
Expand description

Negotiates the consumer-facing stream from a consumable stream.

Algorithm:

  1. Intersect header extensions.
  2. Derive the BWE feedback policy from surviving extensions.
  3. negotiate primary media codecs first
  4. Admit RTX only when its primary codec survived
  5. Filter bindings so they only reference negotiated payload types.

The output keeps consumable payload types rather than adopting arbitrary consumer capability PT numbers, because the consumable stream is already the router’s negotiated forwarding model

§Errors

Returns RtpNegotiationError::NoCompatibleConsumerCodec when no compatible media codec can be negotiated.