Re: Issue 48: Undefined RTCRtpListener behavior

Here is some preliminary text to describe the matching rules, based on your suggestion.  

One aspect that still needs to be clarified is the behavior of the "latching table".  For example, in the rules below, entries are only added, not deleted.   

I hesitated to immediately remove a previous entry right muxId/SSRC or Payload Type/SSRC latching, in order to potentially deal with late arriving packets (e.g. some video packets corresponding to an old SSRC arriving after an SSRC conflict was detected and a new SSRC was chosen).    To fix this,  a timer could be set and then the deletion could be queued.  

8.4 Matching rules

To determine whether an RTP stream is configured to be processed by an existing RTCRtpReceiver object, the RTCRtpListener attempts to match the values of an incoming RTP packet's Payload Type and SSRC fields as well as the value of the muxId (if present in the MID RTP header extension) against the RTCRtpReceiver.RTCRtpParameters.RTCRtpCodecParameters.payloadType, RTCRtpReceiver.RTCRtpParameters.RTCRtpEncodingParameters.ssrc, and RTCRtpReceiver.RTCRtpParameters.muxId attributes of configured RTCRtpReceiver objects.

The matching behavior assumes that the browser maintains a dynamically constructed table of SSRC, muxId, RTCRtpReceiver tuples, known as the "latching table". The matching behavior is as follows:

1. Attempt to match the SSRC field value against the latching table SSRC entries. If a match is found, route the RTP packet to the corresponding RTCRtpReceiver and exit.
2. Attempt to match the SSRC field against the values of RTCRtpReceiver.RTCRtpParameters.RTCEncodingParameters.ssrc. If a match is found, route the RTP packet to the matching RTCRtpReceiver and exit.
3. Attempt to match the muxId present in the MID RTP header extension against the values of RTCRtpReceiver.RTCRtpParameters.muxId. If a match is found, add an SSRC, muxId, RTCRtpReceiver entry at the beginning of the latching table, route the RTP packet to the corresponding RTCRtpReceiver, and exit.
4. Attempt to match the Payload type field value against the values of RTCRtpReceiver.RTCRtpParameters.RTCRtpCodecParameters.payloadType. If multiple matches are found, exit. If only a single match is found, add an SSRC, *, RTCRtpReceiver entry at the beginning of the latching table, route the RTP packet to the corresponding RTCRtpReceiver and exit.
5. If no matches are found, fire the unhandledrtp event.

Received on Monday, 15 September 2014 23:41:22 UTC