Re: [mediacapture-image] Ignore PTZ request if no PTZ camera (#246)

> > If a web site calls `navigator.mediaDevices.getUserMedia({video: {pan: {}}})` and there are no PTZ cameras, the permission request will be `{name: "camera", panTiltZoom: false}`
> 
> From my reading of the spec, the request will be `{name: "camera", panTiltZoom: true}` not `{name: "camera", panTiltZoom: false}`. I think this is the issue to solve here.

Yes, exactly.

But what should happen then?

Should the `pan: {}` part be completely ignored (an empty ConstrainDoubleRange value implies no constraints per the spec)?
At the moment Chrome implements the permission ignorance part but throws an OvercontstrainedError which does not make sense.

> > What if a web site calls navigator.mediaDevices.getUserMedia({video: {pan: {ideal: 0}}}) and there are no PTZ cameras?
> 
> The request should probably be `{name: "camera", panTiltZoom: false}`.

Yes, exactly.

But what should happen then?

Should be `pan: {ideal: 0}` part be completely ignored or should the [fitness distance](https://w3c.github.io/mediacapture-main/#dfn-fitness-distance) be 0 because a pan constraint does not apply to non-PTZ cameras? This choice has no effect to the selected device but affects how this should be specified in the spec.

Or should the [fitness distance](https://w3c.github.io/mediacapture-main/#dfn-fitness-distance) be positive infinity because there is no actual pan setting? This would cause all non-PTZ cameras to be ignored and an OverconstrainedError to be thrown.

> > What if a web site calls navigator.mediaDevices.getUserMedia({video: {pan: {exact: 0}}})
> 
> If there is no PTZ camera, there will be no permission request as the algorithm will bail out early.
> Fur simplicity, the request should probably be `{name: "camera", panTiltZoom: false}`.

Yes, probably.

So the `pan: {exact: 0}` et al parts must not be completely ignored in this case. The [fitness distance](https://w3c.github.io/mediacapture-main/#dfn-fitness-distance) is positive infinity because the settings dictionary's (missing) value for the constraint does not satisfy the constraint. This causes all non-PTZ cameras to be ignored and an OverconstrainedError to be thrown as there are not other cameras.

I am asking there questions because it does not make sense to ignore PTZ permission request without specifying what do with PTZ constraints (or non-constraints) in whose cases.

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


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

Received on Monday, 31 August 2020 13:02:26 UTC