W3C home > Mailing lists > Public > public-webrtc@w3.org > January 2014

asynchrony for addStream w/ error/success callbacks

From: Martin Thomson <martin.thomson@gmail.com>
Date: Thu, 9 Jan 2014 17:38:15 -0800
Message-ID: <CABkgnnUqVyz5oVMbe0ytsqRpEBGTHoSzKkPm+FXLzxF=MG7tbA@mail.gmail.com>
To: "public-webrtc@w3.org" <public-webrtc@w3.org>
Since we're required to enqueue all mutation operations on
RTCPeerConnection, I'm surprised that addStream, which has an
interdependency on createOffer/createAnswer, is synchronous.  It's not
in Firefox, which means that it's not possible to report errors
effectively.

I'd like to suggest that we consider making addStream and removeStream
asynchronous like everything else.

Also, I looked, but I can't see a concrete use for the constraints on
addStream.  The algorithm forgets to even mention these.

I'm not sure if local streams trigger onaddstream/onremovestream, I
don't think so, so I'd propose that we change the signatures of these
methods to:

  void addStream(MediaStream s, optional VoidFunction successCallback,
optional RTCPeerConnectionErrorCallback failureCallback);
  void removeStream(MediaStream s, optional VoidFunction successCallback);

In case you were wondering, remove should not be allowed to fail...

I think that optional is OK here.  That should help with backward
compat, and these aren't really critical, since you can test for
success/failure by probing.  Plus, onnegotiationneeded tends to fire
if you do anything with the streams set.
Received on Friday, 10 January 2014 01:38:43 UTC

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 15:19:37 UTC