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

Peter Thatcher <pthatcher@google.com> Tue, 18 June 2013 05:27 UTC

Return-Path: <pthatcher@google.com>
X-Original-To: rtcweb@ietfa.amsl.com
Delivered-To: rtcweb@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id F3B9021F9DCD for <rtcweb@ietfa.amsl.com>; Mon, 17 Jun 2013 22:27:59 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.201
X-Spam-Level:
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 mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uVVEcsnQTTNt for <rtcweb@ietfa.amsl.com>; Mon, 17 Jun 2013 22:27:55 -0700 (PDT)
Received: from mail-pd0-f175.google.com (mail-pd0-f175.google.com [209.85.192.175]) by ietfa.amsl.com (Postfix) with ESMTP id E1ABA21F9DBF for <rtcweb@ietf.org>; Mon, 17 Jun 2013 22:27:54 -0700 (PDT)
Received: by mail-pd0-f175.google.com with SMTP id 4so3528721pdd.20 for <rtcweb@ietf.org>; Mon, 17 Jun 2013 22:27:54 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; 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; d=google.com; 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 10.68.163.165 with SMTP id yj5mr8312114pbb.141.1371533274582; Mon, 17 Jun 2013 22:27:54 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.66.88.8 with HTTP; Mon, 17 Jun 2013 22:27:13 -0700 (PDT)
In-Reply-To: <CABkgnnVghXLu0ZdNkBkvLkqr=xgx6irWnyebU6rv+D45M+iaUg@mail.gmail.com>
References: <CAJrXDUHdoxLTsofiwLBdwBNnCCkCBgjSdbmLaXrNEPODMrsSVA@mail.gmail.com> <CABkgnnUmRpanfpwryyiCUsOdMLzrd74n-4LXaj_AK3aLe0yQ8Q@mail.gmail.com> <CAJrXDUGnEwtsGZwUUqQgH0vDnMPy=XxqwQB9fpNcW9yQDhFt4w@mail.gmail.com> <CABkgnnVghXLu0ZdNkBkvLkqr=xgx6irWnyebU6rv+D45M+iaUg@mail.gmail.com>
From: Peter Thatcher <pthatcher@google.com>
Date: Mon, 17 Jun 2013 22:27:13 -0700
Message-ID: <CAJrXDUFkdfE2gfkRx6im3qNwjd3ObNv0tGO8O0vht146+A1kfQ@mail.gmail.com>
To: Martin Thomson <martin.thomson@gmail.com>
Content-Type: multipart/alternative; boundary=047d7b86d556a1330e04df66f9cc
X-Gm-Message-State: ALoCoQmg3fY/yezEyu7BZJpXHaU89hfQ8sDAgUKaN6gwTGobKmkWD41unOeiV3GmeVs7LtFyHAN8Ajvpe0PRDcJNlmN3Wq5LejVaF8RjSep5WCk9Nb1gPYYkgwqysEMEcsxzEUPXJqKcd2xg6W7Fl5+i4F2r9SQkWv3DPj/q/qHkbP/U32SsBJoweSrOHu4JbtsbmUAIL6PY
Cc: "<rtcweb@ietf.org>" <rtcweb@ietf.org>
Subject: Re: [rtcweb] Proposal for a JS API for NoPlan (adding multiple sources without encoding them in SDP)
X-BeenThere: rtcweb@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: Real-Time Communication in WEB-browsers working group list <rtcweb.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/rtcweb>, <mailto:rtcweb-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/rtcweb>
List-Post: <mailto:rtcweb@ietf.org>
List-Help: <mailto:rtcweb-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/rtcweb>, <mailto:rtcweb-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 18 Jun 2013 05:28:00 -0000

On Mon, Jun 17, 2013 at 2:56 PM, Martin Thomson <martin.thomson@gmail.com>wrote:

> On 17 June 2013 12:26, Peter Thatcher <pthatcher@google.com>; 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):

v=0
o=- 697639972863421376 2 IN IP4 127.0.0.1
s=-
t=0 0
m=application 1 DTLS/SCTP 5000
c=IN IP4 0.0.0.0
a=mid:transport

a=ice-ufrag:tEP42he9r6LycvmM
a=ice-pwd:cKJLuvHy9pas9rdezUZB9xet
a=fingerprint:sha-256
EC:E0:95:43:B7:01:49:8B:BC:21:CC:41:7F:10:FD:92:28:B8:F8:41:07:70:77:7D:7C:47:92:30:79:C4:95:9C


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
munging.


>
> 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
>