From 64617b75e603ecf15554ea59384d086c8b0219e9 Mon Sep 17 00:00:00 2001
From: Bernard Aboba RTP matching rules
is called, and are removed when receiver.stop()
is called. If
receiver.receive(parameters)
is called again, all entries
referencing receiver are removed prior to adding new entries.
muxId table:
+ As noted in [[!BUNDLE]] Section 10.2, to prepare for demultiplexing RTP/RTCP
+ packets to the correct SSRC table: payload type table:
- When an RTP packet arrives, the implementation determines the
From 1a1427c90c3f1196a592a70d9029cded5de26d5f Mon Sep 17 00:00:00 2001
From: Bernard Aboba Table construction
+ RTCRtpReceiver
the following steps
+ MUST be followed:
-
- parameters.muxId
is set,
- muxId_table[parameters.muxId]
is set to receiver.muxId_table[muxId]
is already set to a value other than
- receiver, then receiver.receive()
will be rejected with
- InvalidParameters
.
-
- ssrc_table[parameters.encodings[i].ssrc]
- to receiver for each entry where
- parameters.encodings[i].ssrc
is set, for values of
- i from 0 to encodings.length-1
.ssrc_table[parameters.encodings[i].rtx.ssrc]
- to receiver for each entry where
- parameters.encodings[i].rtx.ssrc
is set, for values of
- i from 0 to encodings.length-1
.ssrc_table[parameters.encodings[i].fec.ssrc]
- to receiver for each entry where
- parameters.encodings[i].fec.ssrc
is set, for values of
- i from 0 to encodings.length-1
.ssrc_table[ssrc]
is already set to a value other
- than receiver, then receiver.receive()
will be rejected
- with InvalidParameters
.
-
+ parameters.muxId
is set, abort these steps.parameters.encodings[i].ssrc
is unset for all
- values of i from 0 to encodings.length-1
, then add
- entries to pt_table
by setting
- pt_table[parameters.codecs[j].payloadType]
to
- receiver, for values of j from 0 to codecs.length-1
.pt_table[pt]
is already set to a value other than
- receiver then receiver.receive()
will be rejected with
- InvalidParameters
.muxId table construction
+
+ parameters.muxId
is set,
+ muxId_table[parameters.muxId]
is set to receiver.muxId_table[muxId]
is already set to a value other than
+ receiver, then receiver.receive()
will be rejected with
+ InvalidParameters
.SSRC table construction
+
+ ssrc_table[parameters.encodings[i].ssrc]
+ to receiver for each entry where
+ parameters.encodings[i].ssrc
is set, for values of
+ i from 0 to encodings.length-1
.ssrc_table[parameters.encodings[i].rtx.ssrc]
+ to receiver for each entry where
+ parameters.encodings[i].rtx.ssrc
is set, for values of
+ i from 0 to encodings.length-1
.ssrc_table[parameters.encodings[i].fec.ssrc]
+ to receiver for each entry where
+ parameters.encodings[i].fec.ssrc
is set, for values of
+ i from 0 to encodings.length-1
.ssrc_table[ssrc]
is already set to a value other
+ than receiver, then receiver.receive()
will be rejected
+ with InvalidParameters
.payload type table construction
+
+
+ parameters.muxId
is set, abort these steps.parameters.encodings[i].ssrc
is unset for all
+ values of i from 0 to encodings.length-1
, then add
+ entries to pt_table
by setting
+ pt_table[parameters.codecs[j].payloadType]
to
+ receiver, for values of j from 0 to codecs.length-1
.pt_table[pt]
is already set to a value other than
+ receiver then receiver.receive()
will be rejected with
+ InvalidParameters
.RTP packet handling
Table construction
packets to the correct RTCRtpReceiver
the following steps
MUST be followed:
-
muxId table construction
+
- muxId table construction
parameters.muxId
is set,
muxId_table[parameters.muxId]
is set to receiver.muxId_table[muxId]
is already set to a value other than
receiver, then receiver.receive()
will be rejected with
InvalidParameters
.SSRC table construction
+
+
- SSRC table construction
ssrc_table[parameters.encodings[i].ssrc]
to receiver for each entry where
parameters.encodings[i].ssrc
is set, for values of
@@ -4438,18 +4438,13 @@ Table construction
ssrc_table[ssrc]
is already set to a value other
than receiver, then receiver.receive()
will be rejected
with InvalidParameters
.payload type table construction
-
+ receiver then set parameters.muxId
is set, abort these steps.parameters.encodings[i].ssrc
is unset for all
- values of i from 0 to encodings.length-1
, then add
- entries to pt_table
by setting
- pt_table[parameters.codecs[j].payloadType]
to
+
+ payload type table construction
+
pt_table[parameters.codecs[j].payloadType]
to
receiver, for values of j from 0 to codecs.length-1
.pt_table[pt]
is already set to a value other than
- receiver then receiver.receive()
will be rejected with
- InvalidParameters
.pt_table[pt]
to null.
+
RTP matching rules
the packet to, based on the values of the SSRC and payload type fields in the RTP
header, as well as the value of the MID RTP header extension, if
present.
Applications can implement RTP stacks in different ways. Within Sections + 8.3.1, 8.3.2 and 13.4, algorithms are provided that are based on + the RTP/RTCP packet routing behavior described in [[!BUNDLE]] Section 10.2. + However, this material is not meant to prescribe exactly how the RTP + stack is implemented. Implementations MAY use any algorithms that + achieves equivalent results to those described in [[!BUNDLE]] Section 10.2.
+The RTCRtpListener
maintains three tables in order to
- facilitate matching: the ssrc_table
which maps SSRC values to
+ facilitate RTP packet routing: the ssrc_table
which maps SSRC values to
RTCRtpReceiver
objects; the muxId_table
which maps
values of the MID header extension to RTCRtpReceiver
objects and the pt_table
which maps payload type values to
@@ -4409,24 +4417,22 @@
receiver.stop()
is called. If
receiver.receive(parameters)
is called again, all entries
referencing receiver are removed prior to adding new entries.
- As noted in [[!BUNDLE]] Section 10.2, to prepare for demultiplexing RTP/RTCP
- packets to the correct RTCRtpReceiver
the following steps
- MUST be followed:
To prepare for demultiplexing RTP packets to the correct
+ RTCRtpReceiver
the following steps MUST be followed:
parameters.muxId
is set,
muxId_table[parameters.muxId]
is set to receiver.muxId_table[muxId]
is already set to a value other than
receiver, then receiver.receive()
will be rejected with
InvalidParameters
.ssrc_table[parameters.encodings[i].ssrc]
to receiver for each entry where
parameters.encodings[i].ssrc
is set, for values of
- i from 0 to encodings.length-1
.encodings.length-1
.
ssrc_table[parameters.encodings[i].rtx.ssrc]
to receiver for each entry where
parameters.encodings[i].rtx.ssrc
is set, for values of
@@ -4436,48 +4442,47 @@ parameters.encodings[i].fec.ssrc
is set, for values of
i from 0 to encodings.length-1
.ssrc_table[ssrc]
is already set to a value other
- than receiver, then receiver.receive()
will be rejected
+ than receiver, then receiver.receive()
will be rejected
with InvalidParameters
.pt_table[parameters.codecs[j].payloadType]
to
receiver, for values of j from 0 to codecs.length-1
.pt_table[pt]
is already set to a value other than
receiver then set pt_table[pt]
to null.When an RTP packet arrives, the implementation determines the
- RTCRtpReceiver
rtp_receiver to send it to as
- follows:
-
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
+ For each RTP packet received, the following steps MUST be followed
+ to route the RTP packet packet to the correct
+ RTCRtpReceiver
rtp_receiver.
+ Note that the phrase "deliver a packet to rtp_receiver'
+ means to further process the packet as would normally happen with RTP/RTCP,
+ including firing the unhandledrtp
event if the packet's
+ payload type does not match any payload type configured for
+ rtp_receiver. This is determined by checking whether
+ packet.pt is equal to any of the values of
parameters.codecs[j].payloadtype
for the
RTCRtpReceiver
object rtp_receiver, where
- j varies from 0 to codecs.length-1
. 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.
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
- codecs.length-1
. If so, route the packet to rtp_receiver.
- If packet.pt does not match, fire the unhandledrtp
event.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.ssrc_table
,
- muxId_table
or pt_table
, fire the
- unhandledrtp
event.codecs.length-1
.
+ muxId_table[packet.muxId]
is unset, fire the
+ unhandledrtp
event and stop.ssrc_table[packet.ssrc]
+ to muxId_table[packet.muxId]
.ssrc_table[packet.ssrc]
is set, set
+ rtp_receiver to ssrc_table[packet.ssrc]
and
+ deliver the packet to rtp_receiver.pt_table[packet.pt]
is set, set
+ rtp_receiver and ssrc_table[packet.ssrc]
+ to pt_table[packet.pt]
and deliver the packet
+ to rtp_receiver.unhandledrtp
event.