From 319c96dc2a424d11b24c48191883bc524335608a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eero=20H=C3=A4kkinen?= Date: Thu, 17 Sep 2020 20:06:31 +0300 Subject: [PATCH] Deny mandatory PTZ contraints in basic getUserMedia contraints --- index.bs | 83 ++++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 59 insertions(+), 24 deletions(-) diff --git a/index.bs b/index.bs index 38428ca..beb99c5 100644 --- a/index.bs +++ b/index.bs @@ -596,9 +596,10 @@ This Section defines a number of new set of Constrainable Properties for
See contrast constrainable property.
pan
-
A value of true is normalized to a value of empty {{ConstrainDouble}}. +
A value of true is normalized to a value of empty {{ConstrainDoubleRange}}. A value of false is normalized to a value of undefined. - See pan constrainable property.
+ If the value after normalization is a double value or a {{ConstrainDoubleRange}} value (whether empty or not), that implies a pan capability request which is ideal in basic constraints and exact required in advanced constraints. + See pan and pan capability constrainable properties.
saturation
See saturation constrainable property.
@@ -610,14 +611,16 @@ This Section defines a number of new set of Constrainable Properties for
See focus distance constrainable property.
tilt
-
A value of true is normalized to a value of empty {{ConstrainDouble}}. +
A value of true is normalized to a value of empty {{ConstrainDoubleRange}}. A value of false is normalized to a value of undefined. - See tilt constrainable property.
+ If the value after normalization is a double value or a {{ConstrainDoubleRange}} value (whether empty or not), that implies a tilt capability request which is ideal in basic constraints and exact required in advanced constraints. + See tilt and tilt capability constrainable properties.
zoom
-
A value of true is normalized to a value of empty {{ConstrainDouble}}. +
A value of true is normalized to a value of empty {{ConstrainDoubleRange}}. A value of false is normalized to a value of undefined. - See zoom constrainable property.
+ If the value after normalization is a double value or a {{ConstrainDoubleRange}} value (whether empty or not), that implies a zoom capability request which is ideal in basic constraints and exact required in advanced constraints. + See zoom and zoom capability constrainable properties.
torch
See torch constrainable property.
@@ -798,35 +801,64 @@ When the {{getSettings()}} method is invoked on a video stream track, the user a
  • Focus distance is a numeric camera setting that controls the focus distance of the lens. The setting usually represents distance in meters to the optimal focus distance.
  • -
  • Pan is a numeric camera setting that controls the pan of the camera. The setting represents pan in arc seconds, which are 1/3600th of a degree. Values are in the range from –180\*3600 arc seconds to +180\*3600 arc seconds. Positive values pan the camera clockwise as viewed from above, and negative values pan the camera counter clockwise as viewed from above. +
  • + Pan is a numeric camera setting that controls the pan of the camera. The setting represents pan in arc seconds, which are 1/3600th of a degree. Values are in the range from -180\*3600 arc seconds to +180\*3600 arc seconds. Positive values pan the camera clockwise as viewed from above, and negative values pan the camera counter clockwise as viewed from above. - Any algorithm which uses a {{MediaTrackConstraintSet}} object and its {{MediaTrackConstraintSet/pan}} dictionary member which exists after a possible normalization MUST request permission to use (as defined in [[!permissions]]) a PermissionDescriptor with its name member set to {{PermissionName/camera}} and its {{CameraDevicePermissionDescriptor/panTiltZoom}} member set to true, and, optionally, consider its {{DevicePermissionDescriptor/deviceId}} member set to any appropriate device's deviceId. + Pan capability is a boolean camera property representing camera's ability to pan which results in a proper non-degenerate setting range. + That capability or whether it is exposed cannot be changed with {{applyConstraints()}}. - If the {{visibilityState}} of the top-level browsing context value is "hidden", the {{applyConstraints()}} algorithm MUST throw a {{SecurityError}} if {{MediaTrackConstraintSet/pan}} dictionary member exists after a possible normalization. + In the {{getUserMedia()}} algorithm, if the {{MediaTrackConstraintSet/pan}} dictionary member of a {{MediaTrackConstraintSet}} object exists after a normalization and the algorithm uses that dictionary member: + -
    - The {{MediaTrackConstraintSet/pan}}, {{MediaTrackConstraintSet/tilt}} and {{MediaTrackConstraintSet/zoom}} dictionary members exists after a possible normalization if the normalized value is a double value or a {{ConstrainDoubleRange}} value (whether empty or not). - A boolean value of true is normalized to an empty {{ConstrainDoubleRange}} value thus the dictionary member exists after a normalization. - A boolean value of false is normalized to no value thus the dictionary member does not exist after a normalization. - An empty {{ConstrainDoubleRange}} value implies no constraints but only a permission and capability request. -
  • + If the {{visibilityState}} of the top-level browsing context value is "hidden", the {{applyConstraints()}} algorithm MUST throw a {{SecurityError}} if {{MediaTrackConstraintSet/pan}} dictionary member exists after a normalization. -
  • Tilt is a numeric camera setting that controls the tilt of the camera. The setting represents tilt in arc seconds, which are 1/3600th of a degree. Values are in the range from –180\*3600 arc seconds to +180\*3600 arc seconds. Positive values tilt the camera upward when viewed from the front, and negative values tilt the camera downward as viewed from the front. +
    + The {{MediaTrackConstraintSet/pan}}, {{MediaTrackConstraintSet/tilt}} and {{MediaTrackConstraintSet/zoom}} dictionary members exist after a normalization if the normalized value is a double value or a {{ConstrainDoubleRange}} value (whether empty or not). + A boolean value of true is normalized to an empty {{ConstrainDoubleRange}} value thus the dictionary member exists after a normalization. + A boolean value of false is normalized to no value thus the dictionary member does not exist after a normalization. + An empty {{ConstrainDoubleRange}} value implies no pan, tilt or zoom constraints but only a permission and capability request. +
    +
  • - Any algorithm which uses a {{MediaTrackConstraintSet}} object and its {{MediaTrackConstraintSet/tilt}} dictionary member which exists after a possible normalization MUST request permission to use (as defined in [[!permissions]]) a PermissionDescriptor with its name member set to {{PermissionName/camera}} and its {{CameraDevicePermissionDescriptor/panTiltZoom}} member set to true, and, optionally, consider its {{DevicePermissionDescriptor/deviceId}} member set to any appropriate device's deviceId. +
  • + Tilt is a numeric camera setting that controls the tilt of the camera. The setting represents tilt in arc seconds, which are 1/3600th of a degree. Values are in the range from -180\*3600 arc seconds to +180\*3600 arc seconds. Positive values tilt the camera upward when viewed from the front, and negative values tilt the camera downward as viewed from the front. - If the {{visibilityState}} of the top-level browsing context value is "hidden", the {{applyConstraints()}} algorithm MUST throw a {{SecurityError}} if {{MediaTrackConstraintSet/tilt}} dictionary member exists after a possible normalization. + Tilt capability is a boolean camera property representing camera's ability to tilt which results in a proper non-degenerate setting range. + That capability or whether it is exposed cannot be changed with {{applyConstraints()}}. -
    - There is no defined order when applying pan and tilt, the UA is allowed to apply them in any order. In practice this should not matter since these values are absolute, so order will not affect the final position. However, if applying pan and tilt is slow enough, the order in which they are applied may be visually noticeable. -
  • + In the {{getUserMedia()}} algorithm, if the {{MediaTrackConstraintSet/tilt}} dictionary member of a {{MediaTrackConstraintSet}} object exists after a normalization and the algorithm uses that dictionary member: + -
  • Zoom is a numeric camera setting that controls the focal length of the lens. The setting usually represents a ratio, e.g. 4 is a zoom ratio of 4:1. The minimum value is usually 1, to represent a 1:1 ratio (i.e. no zoom). + If the {{visibilityState}} of the top-level browsing context value is "hidden", the {{applyConstraints()}} algorithm MUST throw a {{SecurityError}} if {{MediaTrackConstraintSet/tilt}} dictionary member exists after a normalization. - Any algorithm which uses a {{MediaTrackConstraintSet}} object and its {{MediaTrackConstraintSet/zoom}} dictionary member which exists after a possible normalization MUST request permission to use (as defined in [[!permissions]]) a PermissionDescriptor with its name member set to {{PermissionName/camera}} and its {{CameraDevicePermissionDescriptor/panTiltZoom}} member set to true, and, optionally, consider its {{DevicePermissionDescriptor/deviceId}} member set to any appropriate device's deviceId. +
    + There is no defined order when applying pan and tilt, the UA is allowed to apply them in any order. In practice this should not matter since these values are absolute, so order will not affect the final position. However, if applying pan and tilt is slow enough, the order in which they are applied may be visually noticeable. +
    +
  • + +
  • + Zoom is a numeric camera setting that controls the focal length of the lens. The setting usually represents a ratio, e.g. 4 is a zoom ratio of 4:1. The minimum value is usually 1, to represent a 1:1 ratio (i.e. no zoom). - If the {{visibilityState}} of the top-level browsing context value is "hidden", the {{applyConstraints()}} algorithm MUST throw a {{SecurityError}} if {{MediaTrackConstraintSet/zoom}} dictionary member exists after a possible normalization. + Zoom capability is a boolean camera property representing camera's ability to zoom which results in a proper non-degenerate setting range. + That capability or whether it is exposed cannot be changed with {{applyConstraints()}}. + In the {{getUserMedia()}} algorithm, if the {{MediaTrackConstraintSet/zoom}} dictionary member of a {{MediaTrackConstraintSet}} object exists after a normalization and the algorithm uses that dictionary member: + + + If the {{visibilityState}} of the top-level browsing context value is "hidden", the {{applyConstraints()}} algorithm MUST throw a {{SecurityError}} if {{MediaTrackConstraintSet/zoom}} dictionary member exists after a normalization. +
  • Fill light mode describes the flash setting of the capture device (e.g. `auto`, `off`, `on`). Torch describes the setting of the source's fill light as continuously connected, staying on as long as {{track}} is active.
  • @@ -1182,9 +1214,12 @@ urlPrefix: https://www.w3.org/TR/mediacapture-streams/#; type: dictionary; text: urlPrefix: https://www.w3.org/TR/mediacapture-streams/#; type: dictionary; text: MediaTrackSettings; url: idl-def-MediaTrackSettings +urlPrefix: https://www.w3.org/TR/mediacapture-streams/#; type: interface; text: OverconstrainedError; url: overconstrainederror-object urlPrefix: https://www.w3.org/TR/mediacapture-streams/#; type: dfn; text: constrainable property; url: defining-a-new-constrainable-property +urlPrefix: https://www.w3.org/TR/mediacapture-streams/#; type: dfn; text: required; url: dfn-required + urlPrefix: https://www.w3.org/TR/page-visibility/; type: attribute; text: visibilityState; for: Document; url: dom-visibilitystate