Re: Default to an optional/advanced constraint?

Anssi,

short answer: No, but you don't need that.

Den 21. mars 2016 10:57, skrev Kostiainen, Anssi:
> Hi All,
> 
> I'd like to specify the depthPrecision [1] of MediaTrackConstraints to always behave as if it'd be an optional/advanced constraint.
> 

No. More behaviors for constraints is the last thing we need.

> Consider this:
> 
> var gotten = navigator.mediaDevices.getUserMedia({depth: {
>   depthPrecision: "mm"
> }});
> 

The meaning of that construct is the same as

  ... getUserMedia( { depth: { dephtPrecision: { ideal: "mm" }}

which is precisely what you asked for - you'll get it if it's OK, you
won't get it if it's not OK. You can then query the chosen value by
using getSettings (when implemented).

NOTE: I think the idea of a "depthPrecision" constraint is misguided and
should be abandoned, but I've commented more on that at
https://github.com/w3c/mediacapture-depth/issues/100



> ... to be equivalent to:
> 
> var gotten = navigator.mediaDevices.getUserMedia({depth: {
>   advanced: {
>     depthPrecision: "mm"
>   }
> }});
> 
> ... and neither of the above should fail due to the implementation not being able to satisfy the "mm" precision.
> 
> Is this doable with the current constraints model? Or is this misuse of the said model that should be avoided? Related issue [2]. 
> 
> Thanks,
> 
> -Anssi
> 
> [1]: Used for setting the initial depth precision only when the getUserMedia() method is invoked.
> 
> [2]: https://github.com/w3c/mediacapture-depth/issues/100
> 

Received on Monday, 21 March 2016 15:00:17 UTC