Re: [rtcweb] Proposal for a JS API for NoPlan (adding multiple sources without encoding them in SDP)

Peter Thatcher <> Tue, 18 June 2013 05:27 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id F3B9021F9DCD for <>; Mon, 17 Jun 2013 22:27:59 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -1.201
X-Spam-Status: No, score=-1.201 tagged_above=-999 required=5 tests=[AWL=-0.425, BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, J_CHICKENPOX_111=0.6, J_CHICKENPOX_12=0.6]
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id uVVEcsnQTTNt for <>; Mon, 17 Jun 2013 22:27:55 -0700 (PDT)
Received: from ( []) by (Postfix) with ESMTP id E1ABA21F9DBF for <>; Mon, 17 Jun 2013 22:27:54 -0700 (PDT)
Received: by with SMTP id 4so3528721pdd.20 for <>; Mon, 17 Jun 2013 22:27:54 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=SwxuHeehZF0LEwL53zZdFSFe76VvQcsw5XlqbXy4AlY=; b=lRTmvaQZQVB2XCEAf4NfiHP87MyjF6lx9OMVXQDEMzzSPY65ma7AicuVN6vapKudHx CqelSqiMcqONYbgKCvFzv2xfwNSgrGQJa6nS1NJI/CShcT+aeuLn74InVKFjHhUgrCXm l3y2nngtvviMnrP7mUDJG+SmeXi8m++Ub3Um9I8HFye42vrGWibwhyy9KenC5ecMHeFA /5ThyM4RCTbRjKZBUSaQVc8t+12gsPpECHm9uQg+fmDdDLZGFeeO/CgzBINX4SpPcUan uF4T6v0RjwDcLaHvX4ySr4zcQLw9Gl2ntipUnE2VFbhYTug0RgyvgpTRu0X4+EDa4nnv Jg2g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:x-gm-message-state; bh=SwxuHeehZF0LEwL53zZdFSFe76VvQcsw5XlqbXy4AlY=; b=UrPrTHZYO0wrQLP9EmEJJS/fNsz5HqtuUoTG6B3GtDnM0n40VbELkO7qXX/g6Vnxkt 8POOAemHz3Nbg6VsJs/37vtZHVmLlniiQtVFBjsXsV7iuz487GtwQi9jCMIrUgA5Rp8Q tHSh9YEYa8S/WwTtWrZcKeqNeW58QqYErf3C0okEYcitx49r0BNX7nL/5Ffrk45V4RJ/ 0ogSM0ne62kwVo+NAF2sWvSrlwtUbXNcPAzRy/gyW+yIzRIvrOljIOrLjVSWHJMdSen1 VjspozzoODKJ5jC1m9JkSi9/rj2XfbQplxgJyvMZdKPVeHmGGzpT2+rw5pbBfKLddHgM t3Gw==
X-Received: by with SMTP id yj5mr8312114pbb.141.1371533274582; Mon, 17 Jun 2013 22:27:54 -0700 (PDT)
MIME-Version: 1.0
Received: by with HTTP; Mon, 17 Jun 2013 22:27:13 -0700 (PDT)
In-Reply-To: <>
References: <> <> <> <>
From: Peter Thatcher <>
Date: Mon, 17 Jun 2013 22:27:13 -0700
Message-ID: <>
To: Martin Thomson <>
Content-Type: multipart/alternative; boundary=047d7b86d556a1330e04df66f9cc
X-Gm-Message-State: ALoCoQmg3fY/yezEyu7BZJpXHaU89hfQ8sDAgUKaN6gwTGobKmkWD41unOeiV3GmeVs7LtFyHAN8Ajvpe0PRDcJNlmN3Wq5LejVaF8RjSep5WCk9Nb1gPYYkgwqysEMEcsxzEUPXJqKcd2xg6W7Fl5+i4F2r9SQkWv3DPj/q/qHkbP/U32SsBJoweSrOHu4JbtsbmUAIL6PY
Cc: "<>" <>
Subject: Re: [rtcweb] Proposal for a JS API for NoPlan (adding multiple sources without encoding them in SDP)
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: Tue, 18 Jun 2013 05:28:00 -0000

On Mon, Jun 17, 2013 at 2:56 PM, Martin Thomson <>wrote;wrote:

> On 17 June 2013 12:26, Peter Thatcher <> wrote:
> > Yes, I was expecting you to be more supportive.  I'm surprised out how
> your
> > want "all or nothing".  I'm afraid if our options for a clean API are
> all or
> > nothing, we'll just end up with nothing.  I'd prefer to try incremental
> > improvements to word toward (eventually) a clean API.
> Yes, I apologize if the language seemed strong, but I stand by those words.
> The problem that I see with this, and it is a problem with any
> incremental approach, is that it produces two very different
> interaction models for things that are approximately the same
> fundamental operation.
> That is, when I add the first video track to a session I perform one
> set of actions.  Then, when I add subsequent tracks, it's different.
I don't thing we have to have two different sets of actions.  If a JS app
chooses, it could use createLocalStream and createRemoteStream for all of
its streams, and only use SDP for setting up the transport.  For example, I
could choose to write JS that would setup one transport with one call to
createOffer/setLocalDescription/setRemoteDescription (ignore trickle ICE
and ICE restarts for them moment) and bundle all media over it.  That means
the SDP is really just used as a way to tell the browser what ice ufrag,
ice pwd, and DTLS fingerprint to use.  It would look something like this
(forgive me if I got the SDP slightly wrong;  it's easy to get wrong):

o=- 697639972863421376 2 IN IP4
t=0 0
m=application 1 DTLS/SCTP 5000
c=IN IP4


Ignoring ICE candidates and restarts, that's all the SDP what would be
needed for the whole PeerConnection (one for the local and one for the
remote).  The first set of streams has the same actions as the 100th set of
streams, if the JS chooses.

10 lines of SDP just to setup a transport isn't quite such an abomination,
is it?

This also has all the purported drawbacks of comment 22 with respect
> to usability, whatever they are.  There must have been some because I
> got a lot of heat about that when we discussed it.
> > Do you think it is impossible to work toward a clean API in an
> incremental
> > approach?  If you think it's possible, I'd like to hear your thoughts on
> > how.
> The fundamental problem in WebRTC is the Offer/Answer semantics in the
> API.  That's hard to remove now.  I can't see an incremental change
> that would remove that, and that's every bit as much of a problem as
> having to deal with SDP.  That's how we got to comment 22.

There are two places we currently have offer/answer: 1.  To setup the
transports.  2.  To define the streams.  And once upon a time, there was
going to be 3.  To define the data channels.  We were able to prevent #3
and just have data channel be defined in terms of createDataChannel, and
not in terms of SDP.  That was good, was it not?  What I'm proposing is
that we do something similar for audio and video streams (#2).  That way,
all that you need to use SDP for would be #1 (to setup the transports).
 And someday, we might be able to improve that as well (perhaps a future
.createTransport method).

> I know that you wanted to do some sort of object representation of
> SDP.  That can be done incrementally by adding to
> RTCSessionDescription, or by replacing it entirely, but it doesn't
> really go to the core of the problem.  If you were willing to tolerate
> the fact that there would be two code paths, two control surfaces that
> effectively did the same things.

> > By the way, these API additions would greatly minimize the amount of SDP
> > editing necessary for JS clients that don't use SDP for signalling.  And
> > later incremental improvements could reduce it further.  Also, it's no
> > longer necessary to do offer/answer for adding tracks.  It's only the
> intial
> > PeerConnection setup that needs to do Offer/Answer.  So, it doesn't
> inherit
> > all the problems quite as much as you described.  It may be slightly
> > abominable, but I certainly consider it less abominable than the SDP
> editing
> > necessary without it.
> If I am forced to do SDP, I'd rather not have something else as well
> unless that something else is getting me something concrete.  What you
> are proposing does too little to advance a cleaner API model to
> justify the extra overhead that it introduces.  It doesn't tackle the
> hard problems.

You're not forced to do SDP, except for the transports.  For defining the
streams, you can avoid SDP altogether.  As a WebRTC JS app developer, I
know I would find working with this API much better than working with SDP

> I appreciate the philosophy behind no-plan, which is not a non-plan in
> any sense.  It addresses a concern that we (unfortunately) didn't
> really touch on in the MMUSIC call this morning.  However, the
> requirements of the-not-no-plan could be far more elegantly addressed
> within the constraints of the current API without adding all those
> extra description bits.

I'm a bit confused.  Do you consider changes to SDP more elegant than
dictionaries like MediaStreamTrackDescription?  I would find that somewhat
ironic.  Or are you suggesting there's a way I can simplify all the
"description bits".  If there's a specific way I can simply it to make it
better, I'd lover to hear it.

And, thanks for your feedback.  I hope my response about not requiring SDP
for the first streams helps clarify.

> --Martin