RTCRtpRtxParameters lacks "apt"

According to RFC 4588:

   The "apt" (associated payload type) parameter MUST be used to map the
   retransmission payload type to the associated original stream payload
   type.  If multiple original payload types are used, then multiple
   "apt" parameters MUST be included to map each original payload type
   to a different retransmission payload type.


So, a retransmitted RTP packet has a different SSRC (which is already
present in RTCRtpRtxParameters) but NOTE that the "payload-type" field
in the retransmitted RTP packet does not match the payload-type of the
original RTP packet, and note that the retransmitted body does not
include the original payload-type.

Even worse:

--------------------------------
   The syntax is as follows:

      a=fmtp:<number> apt=<apt-value>;rtx-time=<rtx-time-val>

   where

      <number>: indicates the dynamic payload type number assigned to
      the retransmission payload format in an rtpmap attribute.

      <apt-value>: is the value of the original stream payload type to
      which this retransmission stream payload type is associated.
--------------------------------


This is, we need to provide a mapping between the payload-types within
the stream/transport and their associated payload-types in the
retransmitted packets.



Example:


dictionary RTCRtpEncodingParameters {
    unsigned long       ssrc;
    payloadtype         codecPayloadType;
    RTCRtpRtxParameters rtx;
    [...]
}

Let's say the remote peer announces this:

- ssrc = 111111
- codecPayloadType = 111
- rtx.ssrc = 111112

OK, if we receive a RTP with SSRC=111112 we assume it is a
retransmission of a packet with SSRC=111111 and payload=111
(regardless the payload-type  in the RTX packet !!!).


But the fact is that the same SSRC may be used to send retransmission
for different payloads, so the peer may announce this:

- stream audio
  - ssrc = 111111
  - codecPayloadType = 111
  - rtx.ssrc = 111112

- stream video
  - ssrc = 111111
  - codecPayloadType = 222
  - rtx.ssrc = 111112

Now we receive a RTP packet with SSRC=111112. We don't know whether it
is a rtx for audio or for video. And we MUST NOT check its
payload-type since it is supposed to mean:

      <number>: indicates the dynamic payload type number assigned
       to the retransmission payload format in an rtpmap attribute.

This is, the payload in the rtx packet will never be 111 or 222.


So finally the info we need to accomplish this RTX stuff would be
something like:

- stream audio
  - ssrc = 111111
  - codecPayloadType = 111
  - rtx.ssrc = 111112
  - rtx.codecPayloadType = 991

- stream video
  - ssrc = 111111
  - codecPayloadType = 222
  - rtx.ssrc = 111112
  - rtx.codecPayloadType = 992


Now if a RTP packet with SSRC=111112 and payload-type=992 we know that
it is a retransmission of a video packet.


-- 
Iñaki Baz Castillo
<ibc@aliax.net>

Received on Wednesday, 15 October 2014 11:18:09 UTC