W3C home > Mailing lists > Public > public-media-capture@w3.org > May 2012

Re: Syntax options for constraints structure

From: Dan Burnett <dburnett@voxeo.com>
Date: Fri, 11 May 2012 13:51:37 -0400
Cc: public-media-capture@w3.org
Message-Id: <A049D117-A1A3-4A69-99F1-3A699764B5B8@voxeo.com>
To: Anant Narayanan <anant@mozilla.com>

On May 10, 2012, at 3:17 PM, Anant Narayanan wrote:

> On 5/10/12 11:31 AM, Paul Neave wrote:
>> In my view, this could be much more simplified like so:
>> 
>> Example 1:
>> 
>> { mandatory: {
>>     videoMinHeight:600,
>>     videoMaxBandwidth:500
>>   },
>>   optional: {
>>     videoMaxAspectratio: 1.333333333333,
>>     videoMinTimebetweenrefframes: 20,
>>     videoMinFramerate: 30,
>>     videoEnumAutowhitebalance: "on"
>>   }
>> }
> 
> We could certainly make the optimization of grouping each "set" of constraints in one object instead of making a new object for each constraint, and I think Dan did have something like this in his original proposal in the form of a "Constraint Set", IIRC.

Anant, this was for the mandatory structure, where ordering was not significant, and for the getCapabilities return value, where ordering is also not significant.

> 
> So, my preferred syntax is, as an example:
> 
> navigator.getUserMedia({
>  video: {
>    mandatory: {
>      videoMinHeight:600,
>      videoMaxBandwidth:500
>    },
>    optional: [
>      {
>        videoMaxAspectratio: 1.333333333333,
>        videoMinTimebetweenrefframes: 20,
>        videoMinFramerate: 30,
>        videoEnumAutowhitebalance: "on"
>      },
>      {
>        videoMinTimebetweenrefframes: 40,
>        videoMinFramerate: 10
>      },
>    ]
>  }
> });
> 
> -Anant
> 
Received on Friday, 11 May 2012 19:11:53 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 16:14:59 GMT