Bug 1187315 - Refactor out Constraints.webidl. r=bz

--HG--
extra : transplant_source : r%D6%95%C3%AE%3F%98%E5%2C%2C%067%B8%ABX%90%9F%5D%0Dz
This commit is contained in:
Jan-Ivar Bruaroey 2015-07-29 01:16:19 -04:00
parent 0ce5dacf61
commit f777a670cd
5 changed files with 61 additions and 82 deletions

View File

@ -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;

View File

@ -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<DOMString>) exact;
(DOMString or sequence<DOMString>) ideal;
};

View File

@ -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<DOMString> 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<MediaTrackConstraintSet> advanced;
};

View File

@ -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<DOMString> or ConstrainDOMStringParameters) ConstrainDOMString;
dictionary ConstrainDOMStringParameters {
(DOMString or sequence<DOMString>) exact;
(DOMString or sequence<DOMString>) ideal;
};

View File

@ -83,7 +83,6 @@ WEBIDL_FILES = [
'Comment.webidl',
'CompositionEvent.webidl',
'Console.webidl',
'Constraints.webidl',
'Contacts.webidl',
'ContainerBoxObject.webidl',
'ConvolverNode.webidl',