Re: [rtcweb] Interaction between MediaStream API and signaling

Stefan Hakansson LK <> Sat, 31 March 2012 05:01 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 5316021F8672 for <>; Fri, 30 Mar 2012 22:01:51 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -7.697
X-Spam-Status: No, score=-7.697 tagged_above=-999 required=5 tests=[AWL=-1.448, BAYES_00=-2.599, HELO_EQ_SE=0.35, RCVD_IN_DNSWL_MED=-4]
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id dfDb0QWhnPFR for <>; Fri, 30 Mar 2012 22:01:50 -0700 (PDT)
Received: from ( []) by (Postfix) with ESMTP id 0F8F021F8661 for <>; Fri, 30 Mar 2012 22:01:49 -0700 (PDT)
X-AuditID: c1b4fb2d-b7b76ae0000063d8-11-4f768fba106b
Received: from (Unknown_Domain []) (using TLS with cipher AES128-SHA (AES128-SHA/128 bits)) (Client did not present a certificate) by (Symantec Mail Security) with SMTP id 30.04.25560.ABF867F4; Sat, 31 Mar 2012 07:01:46 +0200 (CEST)
Received: from [] ( by ( with Microsoft SMTP Server id; Sat, 31 Mar 2012 07:01:45 +0200
Message-ID: <>
Date: Sat, 31 Mar 2012 07:01:45 +0200
From: Stefan Hakansson LK <>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120310 Thunderbird/11.0
MIME-Version: 1.0
To: Jim Barnett <>
References: <> <>
In-Reply-To: <>
Content-Type: text/plain; charset="ISO-8859-1"; format="flowed"
Content-Transfer-Encoding: 7bit
X-Brightmail-Tracker: AAAAAA==
Cc: "" <>
Subject: Re: [rtcweb] Interaction between MediaStream API and signaling
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: Real-Time Communication in WEB-browsers working group list <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Sat, 31 Mar 2012 05:01:51 -0000

On 03/30/2012 04:26 PM, Jim Barnett wrote:
> Doesn't the basic model require that the offer be ready to receive media
> as soon as it sends the offer?  If that's the case then the offer must
> be ready and able to map RTP streams to media streams (using the mapping
> specified in the SDP for its offer) as soon as it sends the offer.

Yes, the basic SDP o/a model requires that the offerer is ready to 
receive media as soon as the offer is sent. But as I tried to explain 
(but obviously failed to) is that there is an additional constraint 
here: the JS application deals with MediaStreams, which often has more 
than one track, e.g. one video and one audio track. A track in turn 
would correspond to an RTP stream. And you can have several concurrent 
MediaStreams in action.

Say now that the offerer, before getting an ANSWER with info, receives 
three RTP streams; two video and one audio. The offerer would in this 
situation not have a clue how these belong together. One could be video 
from a front facing camera (that is supposed to be displayed on a large 
video screen), the other video RTP stream could contain the video from 
the rear facing camera and is supposed to together with the audio RTP 
stream be one MediaStream that is supposed to be played in sync in a 
thumbnail video display.

Without the offerer having the info about what these RTP streams 
represent it can't do anything sensible.


> - Jim
> -----Original Message-----
> From: [] On Behalf
> Of Stefan Hakansson LK
> Sent: Friday, March 30, 2012 5:00 AM
> To:
> Subject: [rtcweb] Interaction between MediaStream API and signaling
> The JS API has deals with MediaStreams (this is what you send and
> receive using PeerConnection from an application perspective).
> A browser receiving RTP streams, needs side info to be able to assemble
> those RTP streams into MediaStreams in a correct way. The current model
> is that this is signaled using SDP exchanges (where Haralds MSID
> proposal would tell which MediaStream an RTP stream belongs to).
> As I brought up at the mike yesterday, I think we may have a race
> condition for the responder.
> For the initiator side browser, this is clear: once an (PR-)ANSWER is
> received, the responder has received the SDP, and hence can map incoming
> RTP streams into MediaStreams.
> But for the responder side this is less clear to me. Imagine
> applications where the responder just mirrors the initiator - if one of
> the parties adds a MediaStream to PeerConnection, the other end would
> add the corresponding MediaStream.
> This can happen any time in the session, so ICE can very well be up and
> running. One example could be that the data channel is used for text
> chat, when one side clicks a button to start video. And the application
> can have asked for permission to use all input devices earlier, so no
> user interaction may be involved.
> In this situation the responder's (added) RTP streams can very well
> arrive before the ANSWER if I understand correctly. I think we need to
> find a way to handle this. One way is to add an "ACK" that indicates to
> the responder that the initiator has received the ANSWER, but I'm not
> sure that is the best way.
> Stefan
> _______________________________________________
> rtcweb mailing list