Re: Capabilities vs SupportedConstraints

SupportedConstraints was added to get around the question of "how do I
know that my requests won't just be ignored because of the Dictionary
rules?".

The natural (to me, anyway) way of generating supported constraints is
to have the UA dump the content of its constraint-parsing lookup table,
without any regard to whether there are any such devices or not. So I'd
expect getSupportedConstraints() to return a lot of strings like
"reallyFutzyExperimentalConstraint" and "propertyOfDeviceNobodyHas".

getCapabilities, on the other hand, should return the constraints that
are actually useful for a specific context - they should reasonably be
generated by asking each device driver what constraints it supports and
what the values are - for "propertyOfDeviceNobodyHas", I don't expect it
to turn up in any getCapabilities return value - it's just a guarantee
that if you send down "propertyOfDeviceNobodyHas: { exact: 55 }", you'll
get a failure to apply.

Because of the dictionary rules, if you send down
"propertyOfDeviceNobodyHad: { exact: 55 }" (note the misspelling), the
constraint will be ignored.

So to my mind, they're fundamentally, deeply different, and SHOULD NOT
be merged.



On 10/31/2014 06:12 PM, Rob Manson wrote:
> Hey,
>
> this might be a stupid question...but what's the real difference
> between Capabilities and SupportedConstraints.
>
> I can see that getSupportedConstraints() is attached at the
> MediaDevices level and getCapabilities() is attached at the MST level.
>
> And I can see that the data structures returned are different because
> getSupportedConstraints(kind) returns a dictionary with only true
> values, while getCapabilities() returns a Constraints structure where
> the values are either ranges or enums. (e.g. getCapabilities returns
> Constraints?!).
>
> It seems to me that under the hood Capabilities and
> SupportedConstraints are effectively the same concept.
>
> I can see why there might be some fingerprinting/privacy issues if the
> method that hung off MediaDevices returned the full set of
> SupportedConstraints (e.g. before the stream permissions were granted,
> etc.). But calling these two things by completely different (but
> somewhat interchangeable) names seems a bit confusing.
>
> I really like the conceptual clarity of the ConstrainablePattern
> model, but my mind is having trouble parsing this aspect of it.
>
> Or have I misunderstood this in some way?
>
> roBman
>


-- 
Surveillance is pervasive. Go Dark.

Received on Tuesday, 4 November 2014 18:29:07 UTC