From e92302389664b71693923a756415e7edfebd0e67 Mon Sep 17 00:00:00 2001 From: aboba Date: Tue, 31 May 2016 10:36:59 -0700 Subject: [PATCH] Matching rule update Fix for Issues https://github.com/openpeer/ortc/issues/547 and https://github.com/openpeer/ortc/issues/546 Rebase of PR https://github.com/openpeer/ortc/pull/555 --- ortc.html | 64 +++++++++++++++++++++++++++++++++---------------------- 1 file changed, 38 insertions(+), 26 deletions(-) diff --git a/ortc.html b/ortc.html index 9043f0c..f171a97 100644 --- a/ortc.html +++ b/ortc.html @@ -2754,10 +2754,10 @@

RTP matching rules

RTCRtpReceiver objects.

- For an RTCRtpReceiver object receiver, table entries are added when - receiver.receive() is called, and are removed when receiver.stop() is called. - If receiver.receive() is called again, all entries referencing receiver are removed - prior to adding new entries. + For an RTCRtpReceiver object receiver, table entries + are added by receive() and are removed by stop(). When + receive() is called again, entries referencing receiver + are removed prior to adding new entries.

SSRC table: Set ssrc_table[parameters.encodings[i].ssrc] to @@ -2770,45 +2770,57 @@

RTP matching rules

receiver for each entry where parameters.encodings[i].fec.ssrc is set, for values of i from 0 to the number of encodings. If ssrc_table[ssrc] is already set to a value other than receiver, - then receiver.receive() will throw an InvalidParameters exception. + then receiver.receive() will have its promise rejected with an InvalidParameters + error.

- muxId table: If parameters.muxId is set, muxId_table[parameters.muxId] is set - to receiver. - If muxId_table[muxId] is already set to a value other than receiver, then - receiver.receive() will throw an InvalidParameters exception. + muxId table: + If parameters.muxId is set, muxId_table[parameters.muxId] is + set to receiver. If muxId_table[muxId] is already set to a + value other than receiver, then receiver.receive() will have its + promise rejected with an InvalidParameters error.

- payload type table: If parameters.muxId is unset and parameters.encodings[i].ssrc + payload type table: + If parameters.muxId is unset and parameters.encodings[i].ssrc is unset for all values of i from 0 to the number of encodings, - then add entries to pt_table by setting + add entries to pt_table by setting pt_table[parameters.codecs[j].payloadType] to receiver, for values of j from 0 to the number of codecs. If pt_table[pt] is already set to a value other than receiver - then receiver.receive() will throw an InvalidParameters exception. + then receiver.receive() will have its promise rejected with an InvalidParameters error.

- When an RTP packet arrives, the implementation determines the RTCRtpReceiver rtp_receiver to send it to as follows: - If ssrc_table[packet.ssrc] is set: set rtp_receiver to ssrc_table[packet.ssrc] and check - whether the value of packet.pt is equal to one of the values of parameters.codecs[j].payloadtype for rtp_receiver, - where j varies from 0 to the number of codecs. + When an RTP packet arrives, the implementation determines the RTCRtpReceiver + rtp_receiver to send it to as follows: + If ssrc_table[packet.ssrc] is set: set rtp_receiver to + ssrc_table[packet.ssrc] and check whether the value of + packet.pt is equal to one of the values of parameters.codecs[j].payloadtype + for rtp_receiver, where j varies from 0 to the number of codecs. If so, route the packet to rtp_receiver. If packet.pt does not match, fire the unhandledrtp event.

- Else if packet.muxId is set: If muxId_table[packet.muxId] is unset, fire the unhandledrtp event, else set - rtp_receiver to muxId_table[packet.muxId] and check - whether the value of packet.pt is equal to one of the values of parameters.codecs[j].payloadtype for the RTCRtpReceiver object rtp_receiver, - where j varies from 0 to the number of codecs. - If so, set ssrc_table[packet.ssrc] to rtp_receiver and route the packet to rtp_receiver. - If packet.pt does not match, fire the unhandledrtp event. + Else if packet.muxId is set: + If muxId_table[packet.muxId] is unset, fire the unhandledrtp event, + else set rtp_receiver to muxId_table[packet.muxId] and check + whether the value of packet.pt is equal to one of the values of + parameters.codecs[j].payloadtype for the RTCRtpReceiver + object rtp_receiver, where j varies from 0 to the number of codecs. + If so, set ssrc_table[packet.ssrc] to rtp_receiver and route + the packet to rtp_receiver. If packet.pt does not match, + fire the unhandledrtp event. +

+

+ Else if pt_table[packet.pt] is set: + set rtp_receiver to pt_table[packet.pt], + set ssrc_table[packet.ssrc] to rtp_receiver, + and route the packet to rtp_receiver.

- Else if pt_table[packet.pt] is set: set rtp_receiver to pt_table[packet.pt], - set ssrc_table[packet.ssrc] to rtp_receiver, set pt_table[packet.pt] to null - and route the packet to rtp_receiver. Question: Do we remove all pt_table[packet.pt] entries set to rtp_receiver? + Else if no matches are found in the ssrc_table, muxId_table or + pt_table, fire the unhandledrtp event.

-

Else if no matches are found in the ssrc_table, muxId_table or pt_table, fire the unhandledrtp event.

Interface Definition