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

> #261 states that [t]he [getUserMedia()] algorithm MUST request permission to use a PermissionDescriptor with its name member set to PermissionName/camera and its panTiltZoom member set to true, and, optionally, consider its deviceId member set to any appropriate device's deviceId unless there are no pan capable cameras (and similarly for tilt and zoom).

That did not land and was replaced by w3c/mediacapture-main#707 which is now merged.

---

Regarding the title of this issue (Ignore PTZ request if no PTZ camera), I think it is in essence resolved by w3c/mediacapture-main#707, w3c/mediacapture-main#766 and #271.

According to the current main spec (after w3c/mediacapture-main#707), all required image capture constraints (including the PTZ constraints) are always outright rejected with a TypeError (regardless of whether or not there are any PTZ cameras) and if there are no PTZ cameras,
- optional basic PTZ constraints with value false (like `{pan: false}`) increase fitness-distance by 0 for all non-PTZ cameras,
- optional basic PTZ constraints with value other than false increase fitness-distance by 1 for all non-PTZ cameras,
- advanced constraint sets with PTZ constraints with values other than false are ignored, and
- PTZ constraints with value false in advanced constraint sets have no effect.

So while the PTZ constraints are not fully ignored if there are no PTZ cameras, the PTZ constraints either increase the fitness distance by the same amount for all non-PTZ cameras, cause some advanced constraint sets to be ignored for all non-PTZ cameras or have no effect all non-PTZ cameras. Thus the PTZ constraints have basically no effect if there are no PTZ cameras.

Therefore, the constraint part is resolved.

According to the current spec (after #271), there are no requirements for a user-agent ever to request a PTZ permission as long as the user-agent does not does not expose pan, tilt nor zoom settings. If there are no PTZ cameras, the user-agent even cannot expose pan, tilt or zoom settings (because there is nothing to expose), so that is a perfect case for a user-agent not to request a PTZ permission.

Therefore, the permission part is resolved, too.

So, in my opinion, the issue at hand is resolved and should be closed.

---

> If user denied PTZ permission, PTZ constraints should have zero effect.

@youennf: Since your comment, the spec has be changed (by #271). The intention (there is a bug, see #279 and #280) is that if a user denied the PTZ permission, the user-agent MUST decide not to expose pan, tilt and zoom settings, in which case none of the settings dictionaries contains pan, tilt or zoom settings (regardless of whether the actual camera hardware supports PTZ) thus all algorithms behave like all cameras were non-PTZ cameras thus PTZ constraints have basically no effect like in the case of no-PTZ cameras above.

So, in my option, this issue is also resolved. If you disagree, let's create another issue for this case.

---

> If user granted PTZ permission, PTZ devices should be selected first as only these devices can use this privileged permission.
> The fitness distance is not a solution here since it is adding/comparing apples with oranges.

Please note that while that is not currently stated in the spec, the user-agent is perfectly allowed to do the reverse and request the PTZ permission only if a PTZ device is about to be selected.

On the other hand, if a page does
```js
navigator.mediaDevices.getUserMedia({video: {deviceId, pan: true}})
```
to check if the device is pan-capable, another user-agent may want to request a PTZ permission even if the device is pan-incapable, and that is allowed, too.

However, if you want to discuss more on this case, lets create another issue for this.

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


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

Received on Wednesday, 5 May 2021 07:56:38 UTC