Re: Help clarify constraints (2014), submit feedback

On 3/20/14 3:56 AM, Stefan Håkansson LK wrote:
 > We'd also like to get implementers feedback, is there a preference for
 > one of the designs? On what grounds?
 >
 > Stefan for the chairs
 >
 > [1] http://dev.w3.org/2011/webrtc/editor/getusermedia.html; in
 > particular section 11 in combination with section 4.3 and 10

I have implementer's feedback.

Looking at 
http://dev.w3.org/2011/webrtc/editor/getusermedia.html#constraintset :
 > typedef (DOMString or long or double or boolean) ConstraintValue;

This is invalid.

WebIDL.WebIDLError: error: Flat member types of a union should be 
distinguishable, Long is not distinguishable from Double, 
/Users/Jan/moz/mozilla-central/dom/webidl/MediaStream.webidl line 13:8
typedef (DOMString or long or double or boolean) ConstraintValue;

 > typedef (ConstraintValue or PropertyValueSet or 
PropertyValueLongRange or PropertyValueDoubleRange) ConstraintValues;

As is this. It is also quite an abominable vortex of ambiguity. I think 
APIs should strive to be specific, not strive to not be.

 > typedef object ConstraintSet;

This is valid, but is the (void *) of the JS and WebIDL universes, 
something to be avoided in APIs.

It also has implementation consequences: Objects are passed by 
reference, unlike dictionaries which are passed by value, so this is a 
change from earlier drafts. Does getConstraints() return a modifiable 
reference to the implementation's object, which may be held alive and 
modified later without going through the API?

This also leaves us with no apparatus to describe types, a key part of 
an API.

 > [2]
 > 
http://lists.w3.org/Archives/Public/public-media-capture/2014Mar/0083.html

.: Jan-Ivar :.

Received on Friday, 21 March 2014 17:18:37 UTC