Bug 1538342 [wpt PR 15926] - [getUserMedia] Revert obsolete depthNear, depthFar, focalLengthX, focalLengthY., a=testonly
authorRijubrata Bhaumik <rijubrata.bhaumik@intel.com>
Mon, 15 Apr 2019 14:37:17 +0000
changeset 470909 78a3bb1878e9759a04865ef136321eac8e8a8508
parent 470908 8326f6b50fd59ba9cd4ed0da282cb1fb204348d1
child 470910 98f0b195b2f577092bb71d11aaa424838611c24f
push id112883
push userjames@hoppipolla.co.uk
push dateWed, 24 Apr 2019 10:45:08 +0000
treeherdermozilla-inbound@a9e8bb1d8a16 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1538342, 15926, 939722, 616098, 1524268, 642850
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1538342 [wpt PR 15926] - [getUserMedia] Revert obsolete depthNear, depthFar, focalLengthX, focalLengthY., a=testonly Automatic update from web-platform-tests [getUserMedia] Revert obsolete depthNear, depthFar, focalLengthX, focalLengthY. mediacapture-depth[1] specification removed depthNear, depthFar, focalLengthX and focalLengthY. Updated IDL looks like - partial dictionary MediaTrackCapabilities { // Applies to both depth stream track and color stream track: DOMString videoKind; }; videoKind property, is implemented in Chrome, behind '--enable-blink-features=MediaCaptureDepthVideoKind' runtime flag. This CL aligns the chromium implementation to reflect the latest spec version [Editor's Draft 04 March 2019]. [1] https://github.com/w3c/mediacapture-depth/commit/31a78497cd7b9f9fcea714e610bdad0f93569ec1 Bug: 939722,616098 Change-Id: I27359c920a52d5d8fa19a3d6dfa171318caf0885 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1524268 Reviewed-by: Christian Fremerey <chfremer@chromium.org> Reviewed-by: Kinuko Yasuda <kinuko@chromium.org> Reviewed-by: Guido Urdaneta <guidou@chromium.org> Commit-Queue: Rijubrata Bhaumik <rijubrata.bhaumik@intel.com> Cr-Commit-Position: refs/heads/master@{#642850} -- wpt-commits: 8addb0181f0b08fb9afa66ec9ed1da1fa1c30145 wpt-pr: 15926
testing/web-platform/tests/mediacapture-depth/dictionary-manual.https.html
--- a/testing/web-platform/tests/mediacapture-depth/dictionary-manual.https.html
+++ b/testing/web-platform/tests/mediacapture-depth/dictionary-manual.https.html
@@ -19,230 +19,38 @@
 </ol>
 
 <div id="log"></div>
 
 <script>
 
 let advanced_constraints_depth = [{
   videoKind: "depth",
-  focalLengthX: 0.5,
-  focalLengthY: 0.5,
-  principalPointX: 0.1,
-  principalPointY: 0.1,
-  deprojectionDistortionCoefficients: true,
-  projectionDistortionCoefficients: true,
-  depthNear: 0.5,
-  depthFar: 1,
-  depthToVideoTransform: true
 }];
 
 let advanced_constraints_color = [{
   videoKind: "color",
-  focalLengthX: 0.5,
-  focalLengthY: 0.5,
-  principalPointX: 0.1,
-  principalPointY: 0.1,
-  deprojectionDistortionCoefficients: true,
-  projectionDistortionCoefficients: true
-}];
-
-/*
-  partial dictionary MediaTrackCapabilities {
-    // Apply to both depth stream track and color stream track:
-    DOMString               videoKind;
-    (double or DoubleRange) focalLengthX;
-    (double or DoubleRange) focalLengthY;
-    (double or DoubleRange) principalPointX;
-    (double or DoubleRange) principalPointY;
-    boolean                 deprojectionDistortionCoefficients;
-    boolean                 projectionDistortionCoefficients;
-    // Apply to depth stream track:
-    (double or DoubleRange) depthNear;
-    (double or DoubleRange) depthFar;
-    boolean                 depthToVideoTransform;
-  };
-
-  dictionary DoubleRange {
-    double max;
-    double min;
-  };
-*/
+  }];
 
 function validateMediaTrackCapabilities(capabilities, type) {
   assert_string_field(capabilities, 'videoKind');
-  assert_number_or_number_range_field(capabilities, 'focalLengthX');
-  assert_number_or_number_range_field(capabilities, 'focalLengthY');
-  assert_number_or_number_range_field(capabilities, 'principalPointX');
-  assert_number_or_number_range_field(capabilities, 'principalPointY');
-  assert_boolean_field(capabilities, 'deprojectionDistortionCoefficients');
-  assert_boolean_field(capabilities, 'projectionDistortionCoefficients');
-  if (type == "depth") {
-    assert_number_or_number_range_field(capabilities, 'depthNear');
-    assert_number_or_number_range_field(capabilities, 'depthFar');
-    assert_boolean_field(capabilities, 'depthToVideoTransform');
-  }
 }
 
-/*
-  partial dictionary MediaTrackConstraintSet {
-    // Apply to both depth stream track and color stream track:
-    ConstrainDOMString videoKind;
-    ConstrainDouble    focalLengthX;
-    ConstrainDouble    focalLengthY;
-    ConstrainDouble    principalPointX;
-    ConstrainDouble    principalPointY;
-    ConstrainBoolean   deprojectionDistortionCoefficients;
-    ConstrainBoolean   projectionDistortionCoefficients;
-    // Apply to depth stream track:
-    ConstrainDouble    depthNear;
-    ConstrainDouble    depthFar;
-    ConstrainBoolean   depthToVideoTransform;
-  };
-
-  typedef (DOMString or sequence<DOMString> or ConstrainDOMStringParameters) ConstrainDOMString;
-
-  dictionary ConstrainDOMStringParameters {
-    (DOMString or sequence<DOMString>) exact;
-    (DOMString or sequence<DOMString>) ideal;
-  };
-
-  typedef (double or ConstrainDoubleRange) ConstrainDouble;
-
-  dictionary DoubleRange {
-    double max;
-    double min;
-  };
-
-  dictionary ConstrainDoubleRange : DoubleRange {
-    double exact;
-    double ideal;
-  };
-
-  typedef (boolean or ConstrainBooleanParameters) ConstrainBoolean;
-
-  dictionary ConstrainBooleanParameters {
-    boolean exact;
-    boolean ideal;
-  };
-*/
 
 function validateMediaTrackConstraintSet(constraints, type) {
   assert_constrain_string_field(constraints, 'videoKind');
-  assert_constrain_number_field(constraints, 'focalLengthX');
-  assert_constrain_number_field(constraints, 'focalLengthY');
-  assert_constrain_number_field(constraints, 'principalPointX');
-  assert_constrain_number_field(constraints, 'principalPointY');
-  assert_constrain_boolean_field(constraints, 'deprojectionDistortionCoefficients');
-  assert_constrain_boolean_field(constraints, 'projectionDistortionCoefficients');
-  if (type == "depth") {
-    assert_constrain_number_field(constraints, 'depthNear');
-    assert_constrain_number_field(constraints, 'depthFar');
-    assert_constrain_boolean_field(constraints, 'depthToVideoTransform');
-  }
-}
-
-/*
-  partial dictionary MediaTrackSettings {
-    // Apply to both depth stream track and color stream track:
-    DOMString              videoKind;
-    double                 focalLengthX;
-    double                 focalLengthY;
-    double                 principalPointX;
-    double                 principalPointY;
-    DistortionCoefficients deprojectionDistortionCoefficients;
-    DistortionCoefficients projectionDistortionCoefficients;
-    // Apply to depth stream track:
-    double                 depthNear;
-    double                 depthFar;
-    Transformation         depthToVideoTransform;
-  };
-
-  dictionary DistortionCoefficients {
-    double k1;
-    double k2;
-    double p1;
-    double p2;
-    double k3;
-  };
-
-  dictionary Transformation {
-    Float32Array transformationMatrix;
-    DOMString    videoDeviceId;
-  };
-
-  enum VideoKindEnum {
-    "color",
-    "depth"
-  };
-*/
-
-function validateDistortionCoefficients(coefficients) {
-  assert_number_field(coefficients, 'k1');
-  assert_number_field(coefficients, 'k2');
-  assert_number_field(coefficients, 'p1');
-  assert_number_field(coefficients, 'p2');
-  assert_number_field(coefficients, 'k3');
-}
-
-function validateTransformation(depthToVideoTransform) {
-  assert_array_field(depthToVideoTransform, 'transformationMatrix');
-  assert_string_field(depthToVideoTransform, 'videoDeviceId');
 }
 
 function validateMediaTrackSettings(settings, type) {
   assert_string_field(settings, 'videoKind');
   assert_enum_field(settings, 'videoKind', ['color', 'depth'])
-  assert_number_field(settings, 'focalLengthX');
-  assert_number_field(settings, 'focalLengthY');
-  assert_number_field(settings, 'principalPointX');
-  assert_number_field(settings, 'principalPointY');
-  if (settings.deprojectionDistortionCoefficients) {
-    validateDistortionCoefficients(settings.deprojectionDistortionCoefficients);
-  }
-  if (settings.projectionDistortionCoefficients) {
-    validateDistortionCoefficients(settings.projectionDistortionCoefficients);
-  }
-  if (type == "depth") {
-    assert_number_field(settings, 'depthNear');
-    assert_number_field(settings, 'depthFar');
-    if (settings.depthToVideoTransform) {
-      validateTransformation(settings.depthToVideoTransform);
-    }
-  }
 }
 
-/*
-  partial dictionary MediaTrackSupportedConstraints {
-    // Apply to both depth stream track and color stream track:
-    boolean videoKind = true;
-    boolean focalLengthX = false;
-    boolean focalLengthY = false;
-    boolean principalPointX = false;
-    boolean principalPointY = false;
-    boolean deprojectionDistortionCoefficients = false;
-    boolean projectionDistortionCoefficients = false;
-    // Apply to depth stream track:
-    boolean depthNear = false;
-    boolean depthFar = false;
-    boolean depthToVideoTransform = false;
-  };
-*/
-
 function validateMediaTrackSupportedConstraints(supports) {
   assert_boolean_field(supports, 'videoKind', true);
-  assert_boolean_field(supports, 'focalLengthX', false);
-  assert_boolean_field(supports, 'focalLengthY', false);
-  assert_boolean_field(supports, 'principalPointX', false);
-  assert_boolean_field(supports, 'principalPointY', false);
-  assert_boolean_field(supports, 'deprojectionDistortionCoefficients', false);
-  assert_boolean_field(supports, 'projectionDistortionCoefficients', false);
-  assert_boolean_field(supports, 'depthNear', false);
-  assert_boolean_field(supports, 'depthFar', false);
-  assert_boolean_field(supports, 'depthToVideoTransform', false);
 }
 
 function runDictionaryTests(type, constraints) {
   promise_test(t => {
     return navigator.mediaDevices.getUserMedia({video: {advanced: constraints}})
     .then(stream => {
       let capabilities = stream.getTracks()[0].getCapabilities();
       validateMediaTrackCapabilities(capabilities, type);