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

Syntax options for constraints structure

From: Dan Burnett <dburnett@voxeo.com>
Date: Wed, 9 May 2012 15:21:51 -0400
Message-Id: <B80D6E44-BE4C-47C5-BBEA-346F727EBB23@voxeo.com>
To: public-media-capture@w3.org
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 GMT

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