Re: Bug 23935 - Proposal: New syntax for constraints

On 13/12/2013 2:38 PM, Martin Thomson wrote:
> On 13 December 2013 11:33, cowwoc <cowwoc@bbs.darktech.org> :
>> So if I understand you correctly, constraints specified by the array are
>> combined using logical AND.
> No, as I understand Jan-Ivar's proposal, the constraints are applied
> in order, best effort.  Any constraint that cannot be met is ignored,
> unless it is marked "required".
>
> That said, I'm not sure that this is easy to implement.  Maybe the
> only way to implement it would be to do two passes: one with required:
> true sets and a second pass without.
>
>> If I want X rules for aspect ratio 4:3 and Y rules for aspect ratio 16:9,
>> I'd be expected to invoke getUserMedia() once per aspect ratio. Is that
>> correct?
> No.  You would create rules for 4:3 and rules for 16:9.  As long as
> you don't specify impossible combinations marked with "required: true"
> you will get things working.

I don't see how you could express the following constraints all at once:

 1. For aspect ratio 4/3, require resolutions from 800x600 to 1600x1200,
    prefer 1200x900
 2. For aspect ratio 16/9, require resolutions from 1280x720 to
    1920x1080, prefer 1600x900

Gili

Received on Friday, 13 December 2013 19:44:55 UTC