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] 31a78497cd

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
This commit is contained in:
Rijubrata Bhaumik 2019-04-15 14:37:17 +00:00 коммит произвёл James Graham
Родитель 1ae5e55f15
Коммит 1d9402e6c4
1 изменённых файлов: 1 добавлений и 193 удалений

Просмотреть файл

@ -24,220 +24,28 @@
let advanced_constraints_depth = [{ let advanced_constraints_depth = [{
videoKind: "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 = [{ let advanced_constraints_color = [{
videoKind: "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) { function validateMediaTrackCapabilities(capabilities, type) {
assert_string_field(capabilities, 'videoKind'); 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) { function validateMediaTrackConstraintSet(constraints, type) {
assert_constrain_string_field(constraints, 'videoKind'); 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) { function validateMediaTrackSettings(settings, type) {
assert_string_field(settings, 'videoKind'); assert_string_field(settings, 'videoKind');
assert_enum_field(settings, 'videoKind', ['color', 'depth']) 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) { function validateMediaTrackSupportedConstraints(supports) {
assert_boolean_field(supports, 'videoKind', true); 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) { function runDictionaryTests(type, constraints) {