W3C home > Mailing lists > Public > public-webrtc@w3.org > August 2020

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

From: Jan-Ivar Bruaroey via GitHub <sysbot+gh@w3.org>
Date: Mon, 31 Aug 2020 20:27:48 +0000
To: public-webrtc@w3.org
Message-ID: <issues.opened-689484433-1598905667-sysbot+gh@w3.org>
jan-ivar has just created a new issue for https://github.com/w3c/mediacapture-image:

== Clarify meaning of PTZ constraints presence ==
This spec [appears to assume](https://w3c.github.io/mediacapture-image/#pan) any mention of `pan`, `tilt` or `zoom` will result in a PTZ device (& thus require ptz permission).

But that's not how the constraints algorithm works. E.g.
navigator.mediaDevices.getUserMedia({video: {height: {min: 1080}, pan: true, tilt: true, zoom: true}});
...is equivalent to 
navigator.mediaDevices.getUserMedia({video: {height: {min: 1080}, pan: {}, tilt: {}, zoom: {}}});
...where `{}` has no impact on [fitness distance](https://w3c.github.io/mediacapture-main/getusermedia.html#dfn-fitness-distance), and may choose your 1080p camera over your low-res PTZ camera.  

This seems unexpected, because a constraint value (even `true`) would usually carry weight, except as defined here.

You may also have granted the site more permission than necessary to access the device chosen.

### What's the model?

A related question is whether regular non-ptz cameras satisfy the following constraints:
navigator.mediaDevices.getUserMedia({video: {pan: 0, tilt: 0, zoom: 0}});
Is it yes, because non-ptz cameras point front and center without zoom or tilt?
Is it no, because non-ptz cameras shouldn't have read-only `pan`, `tilt` or `zoom` settings? The spec doesn't say.

It appears we've overloaded the presence or absence of `pan`, `tilt` or `zoom` constraints with meaning.

### Options I see:
 1. Remove the `true` overload of `pan`, `tilt` and `zoom` constraints, and replace it with a `ptz` [ConstrainBoolean](https://w3c.github.io/mediacapture-main/getusermedia.html#dom-constrainboolean).
 2. Hotfix the fitness distance algorithm to give weight to presence of constraints.
 3. Make `true` a first-class value of `pan`, `tilt` and `zoom`, and specify a new `ConstrainULongOrBoolean`.

Please view or discuss this issue at https://github.com/w3c/mediacapture-image/issues/256 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 20:27:51 UTC

This archive was generated by hypermail 2.4.0 : Monday, 31 August 2020 20:27:52 UTC