W3C home > Mailing lists > Public > public-media-capture@w3.org > April 2013

Re: IDL/API feedback

From: Harald Alvestrand <harald@alvestrand.no>
Date: Mon, 08 Apr 2013 10:17:33 +0200
Message-ID: <51627D1D.2090902@alvestrand.no>
To: Anne van Kesteren <annevk@annevk.nl>
CC: Adam Bergkvist <adam.bergkvist@ericsson.com>, "public-media-capture@w3.org" <public-media-capture@w3.org>
On 04/08/2013 09:21 AM, Anne van Kesteren wrote:
> On Mon, Apr 8, 2013 at 6:08 AM, Adam Bergkvist
> <adam.bergkvist@ericsson.com> wrote:
>> On 2013-04-07 12:57, Anne van Kesteren wrote:
>>> 2) The addtrack and removetrack events are not defined. In particular,
>>> when they are dispatched.
>> Both of the above issues were fixed recently, but haven't made it into a
>> released version yet. They are available on github [1].
> The second issue does not appear to be fixed (the methods are not
> dispatching these events). It's also unclear why you'd need a special
> interface for this event given that you can get to the tracks on the
> object already.
They're dispatched in the webrtc spec (when tracks are added by other 
means than AddTrack).

You need a special interface because you don't know the ID of the newly 
added track.

>
>>> 3) The constructor for MediaStream should probably a sequence of
>>> MediaStreamTrack, not an IDL array.
>> It's not a big deal, but wouldn't a sequence introduce an extra (and
>> unnecessary) copy of the array when it's passed by value? Are there any
>> general guidelines for array-like input arguments? I've seen that at least
>> the WebSocket constructor uses a DOMString[] for its protocols argument.
> You need a copy. If you'd actually pass by value the developer could
> make further changes later that would have to be reflected by the
> object, which is not what you want at all.
>
> With regards to WebSocket, that seems like a bug in WebSocket.
>
>
>>> 4) "Constructor ()" should just be "Constructor", but maybe better
>>> would be to make the single argument optional and use "or" to
>>> distinguish the two types.
>> Constructor (optional (MediaStream or MediaStreamTrack[]) trackContainer)
>>
>> What would work for me. The tricky thing is to come up with a suitable name
>> for the single argument. It's easier when you simply can call it "data". :)
> You can call it data, it doesn't matter, but it should really be sequence.
>
>
>> [1]
>> http://htmlpreview.github.io/?https://github.com/fluffy/webrtc-w3c/blob/master/getusermedia.html
>> (note that links don't work)
>
> --
> http://annevankesteren.nl/
>
Received on Monday, 8 April 2013 08:18:06 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:24:40 UTC