diff --git a/dom/media/MediaManager.cpp b/dom/media/MediaManager.cpp index b9324853b7de..943bd9caac04 100644 --- a/dom/media/MediaManager.cpp +++ b/dom/media/MediaManager.cpp @@ -122,8 +122,6 @@ using dom::MediaStreamError; using dom::GetUserMediaRequest; using dom::Sequence; using dom::OwningBooleanOrMediaTrackConstraints; -using dom::SupportedAudioConstraints; -using dom::SupportedVideoConstraints; using media::Pledge; using media::NewRunnableFrom; using media::NewTaskFrom; diff --git a/dom/webidl/Constraints.webidl b/dom/webidl/Constraints.webidl deleted file mode 100644 index f7f0c706a9d7..000000000000 --- a/dom/webidl/Constraints.webidl +++ /dev/null @@ -1,54 +0,0 @@ -/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. - */ - -// These dictionaries need to be in a separate file from their use in unions -// in MediaTrackConstraintSet.webidl due to a webidl compiler limitation. - -// These enums are in the spec even though they're not used directly in the API -// due to https://www.w3.org/Bugs/Public/show_bug.cgi?id=19936 -// Their binding code is quite useful though, and is used in the implementation. - -enum VideoFacingModeEnum { - "user", - "environment", - "left", - "right" -}; - -enum MediaSourceEnum { - "camera", - "screen", - "application", - "window", - "browser", - "microphone", - "audioCapture", - "other" -}; - -dictionary ConstrainLongRange { - long min; - long max; - long exact; - long ideal; -}; - -dictionary ConstrainDoubleRange { - double min; - double max; - double exact; - double ideal; -}; - -dictionary ConstrainBooleanParameters { - boolean exact; - boolean ideal; -}; - -dictionary ConstrainDOMStringParameters { - (DOMString or sequence) exact; - (DOMString or sequence) ideal; -}; diff --git a/dom/webidl/MediaStreamTrack.webidl b/dom/webidl/MediaStreamTrack.webidl index 12d8b32ebb23..69e465506ae0 100644 --- a/dom/webidl/MediaStreamTrack.webidl +++ b/dom/webidl/MediaStreamTrack.webidl @@ -10,6 +10,44 @@ * liability, trademark and document use rules apply. */ +// These two enums are in the spec even though they're not used directly in the +// API due to https://www.w3.org/Bugs/Public/show_bug.cgi?id=19936 +// Their binding code is used in the implementation. + +enum VideoFacingModeEnum { + "user", + "environment", + "left", + "right" +}; + +enum MediaSourceEnum { + "camera", + "screen", + "application", + "window", + "browser", + "microphone", + "audioCapture", + "other" +}; + +typedef (long or ConstrainLongRange) ConstrainLong; +typedef (double or ConstrainDoubleRange) ConstrainDouble; +typedef (boolean or ConstrainBooleanParameters) ConstrainBoolean; +typedef (DOMString or sequence or ConstrainDOMStringParameters) ConstrainDOMString; + +dictionary MediaTrackConstraintSet { + ConstrainLong width; + ConstrainLong height; + ConstrainDouble frameRate; + ConstrainDOMString facingMode; + DOMString mediaSource = "camera"; + long long browserWindow; + boolean scrollWithPage; + ConstrainDOMString deviceId; +}; + dictionary MediaTrackConstraints : MediaTrackConstraintSet { sequence advanced; }; diff --git a/dom/webidl/MediaTrackConstraintSet.webidl b/dom/webidl/MediaTrackConstraintSet.webidl index a44de9f84750..63bc6bac5da8 100644 --- a/dom/webidl/MediaTrackConstraintSet.webidl +++ b/dom/webidl/MediaTrackConstraintSet.webidl @@ -7,34 +7,32 @@ * http://dev.w3.org/2011/webrtc/editor/getusermedia.html */ -enum SupportedVideoConstraints { - "other", - "facingMode", - "width", - "height", - "frameRate", - "mediaSource", - "browserWindow", - "scrollWithPage", - "deviceId" +// These dictionaries need to be in a separate file from their use in unions +// in MediaSreamTrack.webidl due to a webidl compiler limitation: +// +// TypeError: Dictionary contains a union that contains a dictionary in the same +// WebIDL file. This won't compile. Move the inner dictionary to a different file. + +dictionary ConstrainLongRange { + long min; + long max; + long exact; + long ideal; }; -enum SupportedAudioConstraints { - "other" +dictionary ConstrainDoubleRange { + double min; + double max; + double exact; + double ideal; }; -dictionary MediaTrackConstraintSet { - ConstrainLong width; - ConstrainLong height; - ConstrainDouble frameRate; - ConstrainDOMString facingMode; - DOMString mediaSource = "camera"; - long long browserWindow; - boolean scrollWithPage; - ConstrainDOMString deviceId; +dictionary ConstrainBooleanParameters { + boolean exact; + boolean ideal; }; -typedef (long or ConstrainLongRange) ConstrainLong; -typedef (double or ConstrainDoubleRange) ConstrainDouble; -typedef (boolean or ConstrainBooleanParameters) ConstrainBoolean; -typedef (DOMString or sequence or ConstrainDOMStringParameters) ConstrainDOMString; +dictionary ConstrainDOMStringParameters { + (DOMString or sequence) exact; + (DOMString or sequence) ideal; +}; diff --git a/dom/webidl/moz.build b/dom/webidl/moz.build index 6cb6a1d270b8..25f4e6260f1b 100644 --- a/dom/webidl/moz.build +++ b/dom/webidl/moz.build @@ -83,7 +83,6 @@ WEBIDL_FILES = [ 'Comment.webidl', 'CompositionEvent.webidl', 'Console.webidl', - 'Constraints.webidl', 'Contacts.webidl', 'ContainerBoxObject.webidl', 'ConvolverNode.webidl',