Bug 987186 - support echoCancellation constraint, pass test
this doesn't actually add the plumbing for the constraint, but it allows us to support it
--- a/dom/media/tests/mochitest/test_getUserMedia_constraints.html
+++ b/dom/media/tests/mochitest/test_getUserMedia_constraints.html
@@ -65,25 +65,27 @@ var tests = [
constraints: { video: { mandatory: { facingMode: 'left' } } },
error: null },
];
var mustSupport = [
'width', 'height', 'frameRate', 'facingMode', 'deviceId',
// Yet to add:
// 'aspectRatio', 'frameRate', 'volume', 'sampleRate', 'sampleSize',
- // 'echoCancellation', 'latency', 'groupId'
+ // 'latency', 'groupId'
// http://fluffy.github.io/w3c-screen-share/#screen-based-video-constraints
// OBE by http://w3c.github.io/mediacapture-screen-share
'mediaSource',
// Experimental https://bugzilla.mozilla.org/show_bug.cgi?id=1131568#c3
'browserWindow', 'scrollWithPage',
- 'viewportOffsetX', 'viewportOffsetY', 'viewportWidth', 'viewportHeight'
+ 'viewportOffsetX', 'viewportOffsetY', 'viewportWidth', 'viewportHeight',
+
+ 'echoCancellation'
];
var mustFailWith = (msg, reason, constraint, f) =>
f().then(() => ok(false, msg + " must fail"), e => {
is(e.name, reason, msg + " must fail: " + e.message);
if (constraint !== undefined) {
is(e.constraint, constraint, msg + " must fail w/correct constraint.");
}
--- a/dom/webidl/MediaStreamTrack.webidl
+++ b/dom/webidl/MediaStreamTrack.webidl
@@ -49,16 +49,17 @@ dictionary MediaTrackConstraintSet {
DOMString mediaSource = "camera";
long long browserWindow;
boolean scrollWithPage;
ConstrainDOMString deviceId;
ConstrainLong viewportOffsetX;
ConstrainLong viewportOffsetY;
ConstrainLong viewportWidth;
ConstrainLong viewportHeight;
+ ConstrainBoolean echoCancellation;
};
dictionary MediaTrackConstraints : MediaTrackConstraintSet {
sequence<MediaTrackConstraintSet> advanced;
};
[Exposed=Window]
interface MediaStreamTrack : EventTarget {
--- a/dom/webidl/MediaTrackSupportedConstraints.webidl
+++ b/dom/webidl/MediaTrackSupportedConstraints.webidl
@@ -11,17 +11,17 @@ dictionary MediaTrackSupportedConstraint
boolean width = true;
boolean height = true;
boolean aspectRatio; // to be supported
boolean frameRate = true;
boolean facingMode = true;
boolean volume; // to be supported
boolean sampleRate; // to be supported
boolean sampleSize; // to be supported
- boolean echoCancellation; // to be supported
+ boolean echoCancellation = true;
boolean latency; // to be supported
boolean deviceId = true;
boolean groupId; // to be supported
// Mozilla-specific extensions:
// http://fluffy.github.io/w3c-screen-share/#screen-based-video-constraints
// OBE by http://w3c.github.io/mediacapture-screen-share