Bug 987186 - support echoCancellation constraint, pass test draft
authorBrian Armstrong <brian.armstrong.ece+moz@gmail.com>
Fri, 15 Jan 2016 16:29:15 -0800
changeset 323629 31c216088f73a454d643fb59a7dc5494f609e710
parent 322175 9879757aa0d4f88df8c79cde4a777ac7eff0152f
child 323630 ddfae98499e70e98eddac295454f270258ac4223
child 324045 ae6382d160c6266f857113bd8f2bd62b55c2fcb5
push id9759
push userbmo:brian.armstrong.ece+github@gmail.com
push dateWed, 20 Jan 2016 21:19:45 +0000
bugs987186
milestone46.0a1
Bug 987186 - support echoCancellation constraint, pass test this doesn't actually add the plumbing for the constraint, but it allows us to support it
dom/media/tests/mochitest/test_getUserMedia_constraints.html
dom/webidl/MediaStreamTrack.webidl
dom/webidl/MediaTrackSupportedConstraints.webidl
--- 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