Syntax options for constraints structure

Group,

At the last meeting I agreed to send an email showing different syntax options for the constraint structure.
Here it is.  I believe the two alternatives I show are at least close to the primary suggestions made on the call (and the list).  Let's discuss this on today's call and see if we can come to some agreement.

-- dan


****************
** ORIGINAL **
****************
First, here are the three original examples:

Example 1:

{mandatory:[{videoMinHeight:600}, {videoMaxBandwidth:500}],
  optional:[
    {videoMaxAspectratio:1.333333333333},
    {videoMinTimebetweenrefframes:20},
    {videoMinFramerate:30},
    {videoEnumAutowhitebalance:on}]}

This example requests a video stream with the properties shown.  Note that if the browser can satisfy either a minimum time between reference frames of 20 or a minimum framerate of 30 but not both, then it will satisfy the former.  Also, if the browser cannot, at the least, provide a video stream with a minimum height of 600 and a maximum bandwidth of 500, then the call to getUserMedia will fail.


Example 2:

{mandatory:[{videoEnumProvide:true}],
 optional:[{audioEnumProvide:true}]}

This example requests both an audio and a video stream.  If the browser cannot, at the least, provide a video stream, then the errorCallback will be called with an error.


Example 3: 

 {mandatory:[{videoEnumProvide:true}, {audioEnumProvide:true}]}

This example requires that the browser either return a stream with both audio and video or call the errorCallback with an error.



***********************
** ALTERNATIVE 1 **
***********************

Example 1:
{video:
  {mandatory:{minHeight:600, maxBandwidth:500},
    optional:[
    {maxAspectratio:1.333333333333},
    {minTimebetweenrefframes:20},
    {minFramerate:30},
    {enumAutowhitebalance:on}]}}



Example 2:

{video:true, audio:optional}



Example 3:

 {video:true, audio:true}




***********************
** ALTERNATIVE 2 **
***********************

Example 1:

{mandatory:[{videoMinHeight:600}, {videoMaxBandwidth:500}],
  optional:[
    {videoMaxAspectratio:1.333333333333},
    {videoMinTimebetweenrefframes:20},
    {videoMinFramerate:30},
    {videoEnumAutowhitebalance:on}]}



Example 2:

{video:true,
 optional:[{audioEnumProvide:true}]}



Example 3:

 {video:true, audio:true}

Received on Wednesday, 9 May 2012 19:22:16 UTC