Re: [mediacapture-image] Clarify meaning of PTZ constraints presence (#256)

> > I find no support in the spec for that interpretation.
> 
> The spec says: **_" An empty ConstrainDoubleRange value implies no constraints but only a permission and capability request."_**

But that is just a note. If that meaning is to be retained, it should be spelled out in the main descriptions and not only in a note.

> That's where my interpretation comes from. pan: {} means request PTZ capability. Interpreting not having the capability as failing to satisfy the request looks like a valid interpretation to me.
> 
> > The spec [says](https://w3c.github.io/mediacapture-image/#dom-mediatrackconstraintset-pan): _"A value of `true` is normalized to a value of empty ConstrainDouble"_, which I don't see being able to cause `OverconstrainedError`.
> 
> See above.

Like that text does not say anything about that in this case an empty ConstrainDouble implies required hardware support for the property also in the basic set unlike in the case of all non-PTZ properties.

In addition, in Chrome, `{pan: {}}` does not imply required hardware support for pan but only a permission request and a hardware support for _some_ PTZ property (pan, tilt or zoom).

> > Option 3 would add that with e.g. `{pan: {exact: true}}`, modulo whatever we come up with in #246.
> > > Not sure if the extra complexity of allowing pan to be used this way or in the usual DoubleConstraint way is worth it over using a separate constraint for the PTZ capability.

Option 3 would allow a request to prefer a pan and tilt capable camera over a zoom-only capable camera using
```
navigator.mediaDevices.getUserMedia({video: {pan: true, tilt: true}});
```
or to require a pan and tilt capable camera over a zoom-only capable camera using
```
navigator.mediaDevices.getUserMedia({video: {pan: {exact: true}, tilt: {exact: true}}});
```
The former is apparently not possible at the moment and the latter can be achieved only using
```
navigator.mediaDevices.getUserMedia({video: {
    pan: {min: -180.0 * 3600, ideal: 0.0, max: 180.0 * 3600},
    tilt: {min: -180.0 * 3600, ideal: 0.0, max: 180.0 * 3600}
    }});
```
although the idea behind the true semantics is to able to avoid guessed defaults like `{ideal: 0.0}`.

With a separate constraint for the PTZ capability the former would remain impossible and the latter would remain the same or become
```
navigator.mediaDevices.getUserMedia({video: {
    pan: {min: -180.0 * 3600, ideal: 0.0, max: 180.0 * 3600},
    panTiltZoom: {exact: true},
    tilt: {min: -180.0 * 3600, ideal: 0.0, max: 180.0 * 3600}
    }});
```

With @youennf's suggestion to remove pan/til/zoom support from getUserMedia, also the latter would become impossible.

-- 
GitHub Notification of comment by eehakkin
Please view or discuss this issue at https://github.com/w3c/mediacapture-image/issues/256#issuecomment-689563695 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Wednesday, 9 September 2020 13:28:56 UTC