Re: Constraints and Capabilities API for getUserMedia: more detailed proposal

On Tuesday, 20 March 2012 at 15:57, Harald Alvestrand wrote:
> Just FWIW, I'm strongly against having 2 ways of doing constraints at  
> the API level.
> If people want a different API for the same semantics, that's what  
> libraries are for.

That's fair enough, I agree.  

> I have no strong position on dashes versus underscores versus CamelCase.
Dashes make the API more verbose, as like I said, each parameter would require quotes around them as JavaScript does not allow free-standing variable with hyphens. I think camel case would be more keeping inline with JS style.
  
> >  
> > navigator.getUserMedia( { video: true, videoHeight: 600, videoBandwidth: 500, etc…} );
> now, are these constraints mandatory or optional? Minimal or maximal?

The way I see it, I am requesting these requirements and the browser returns what it can. It may not be exact but it will do its best. In the current spec, if I require a mandatory min video bandwidth of 1000000, or a min frame rate of 1000Hz, does the getUserMedia request simply fail?
  
> > With defaults being assumed if not specified. In this case, a typical example would be:
> >  
> > navigator.getUserMedia( { video: true, audio: true, videoWidth: 800, videoHeight: 600, videoMaxBandwidth: 800, videoMinBandwidth: 400, videoFrameRate: 30 } );
> >  
> > Specifying a "min-framerate", for example, seems slightly odd. What if the browser is not capable of keeping up to the specified minimum frame rate? In that case, surely specifying the frame rate you want, videoFrameRate: 30 for example, would suffice and the browser attempts to reach this goal?
> In this case, you seem to desire to express a wish, not a constraint.  
> video-target-framerate?

Yes, that's correct. But if this were a 'mandatory' request and the browser cannot fulfil it, what is the response? Does the responsibility for requesting a correct mandatory constraint fall on the developer or the browser? I would say it should be the browser that returns the best fit for my wishes as I can not be sure what the user's browser will be capable of. Any set of requests, max or min, will only be a request, not a guarantee.

And what if the request for min is larger than the max? Such as minFrameRate: 1000, maxFrameRate: 10 ?

Apologies if I am misunderstanding the proposal. In my opinion a request to getUserMedia should still return something if it can, not fail completely.

Thanks,
Paul.

Received on Tuesday, 20 March 2012 16:20:08 UTC