Skip to content

Commit 2052baf

Browse files
authored
Update mediacapture-main IDL file (web-platform-tests#9794)
1 parent 726bce7 commit 2052baf

File tree

5 files changed

+194
-185
lines changed

5 files changed

+194
-185
lines changed

interfaces/mediacapture-main.idl

Lines changed: 147 additions & 130 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,43 @@
1+
// GENERATED CONTENT - DO NOT EDIT
2+
// Content of this file was automatically extracted from the Media Capture and Streams spec.
3+
// See https://w3c.github.io/mediacapture-main/
4+
15
[Exposed=Window,
26
Constructor,
3-
Constructor(MediaStream stream),
4-
Constructor(sequence<MediaStreamTrack> tracks)]
7+
Constructor (MediaStream stream),
8+
Constructor (sequence<MediaStreamTrack> tracks)]
59
interface MediaStream : EventTarget {
6-
readonly attribute DOMString id;
7-
sequence<MediaStreamTrack> getAudioTracks();
8-
sequence<MediaStreamTrack> getVideoTracks();
9-
sequence<MediaStreamTrack> getTracks();
10-
MediaStreamTrack? getTrackById(DOMString trackId);
11-
void addTrack(MediaStreamTrack track);
12-
void removeTrack(MediaStreamTrack track);
13-
MediaStream clone();
14-
readonly attribute boolean active;
15-
attribute EventHandler onaddtrack;
16-
attribute EventHandler onremovetrack;
10+
readonly attribute DOMString id;
11+
sequence<MediaStreamTrack> getAudioTracks ();
12+
sequence<MediaStreamTrack> getVideoTracks ();
13+
sequence<MediaStreamTrack> getTracks ();
14+
MediaStreamTrack? getTrackById (DOMString trackId);
15+
void addTrack (MediaStreamTrack track);
16+
void removeTrack (MediaStreamTrack track);
17+
MediaStream clone ();
18+
readonly attribute boolean active;
19+
attribute EventHandler onaddtrack;
20+
attribute EventHandler onremovetrack;
1721
};
1822

1923
[Exposed=Window]
2024
interface MediaStreamTrack : EventTarget {
21-
readonly attribute DOMString kind;
22-
readonly attribute DOMString id;
23-
readonly attribute DOMString label;
24-
attribute boolean enabled;
25-
readonly attribute boolean muted;
26-
attribute EventHandler onmute;
27-
attribute EventHandler onunmute;
28-
readonly attribute MediaStreamTrackState readyState;
29-
attribute EventHandler onended;
30-
MediaStreamTrack clone();
31-
void stop();
32-
MediaTrackCapabilities getCapabilities();
33-
MediaTrackConstraints getConstraints();
34-
MediaTrackSettings getSettings();
35-
Promise<void> applyConstraints(optional MediaTrackConstraints constraints);
36-
attribute EventHandler onoverconstrained;
25+
readonly attribute DOMString kind;
26+
readonly attribute DOMString id;
27+
readonly attribute DOMString label;
28+
attribute boolean enabled;
29+
readonly attribute boolean muted;
30+
attribute EventHandler onmute;
31+
attribute EventHandler onunmute;
32+
readonly attribute MediaStreamTrackState readyState;
33+
attribute EventHandler onended;
34+
MediaStreamTrack clone ();
35+
void stop ();
36+
MediaTrackCapabilities getCapabilities ();
37+
MediaTrackConstraints getConstraints ();
38+
MediaTrackSettings getSettings ();
39+
Promise<void> applyConstraints (optional MediaTrackConstraints constraints);
40+
attribute EventHandler onoverconstrained;
3741
};
3842

3943
enum MediaStreamTrackState {
@@ -42,71 +46,83 @@ enum MediaStreamTrackState {
4246
};
4347

4448
dictionary MediaTrackSupportedConstraints {
45-
boolean width = true;
46-
boolean height = true;
47-
boolean aspectRatio = true;
48-
boolean frameRate = true;
49-
boolean facingMode = true;
50-
boolean volume = true;
51-
boolean sampleRate = true;
52-
boolean sampleSize = true;
53-
boolean echoCancellation = true;
54-
boolean latency = true;
55-
boolean channelCount = true;
56-
boolean deviceId = true;
57-
boolean groupId = true;
49+
boolean width = true;
50+
boolean height = true;
51+
boolean aspectRatio = true;
52+
boolean frameRate = true;
53+
boolean facingMode = true;
54+
boolean resizeMode = true;
55+
boolean volume = true;
56+
boolean sampleRate = true;
57+
boolean sampleSize = true;
58+
boolean echoCancellation = true;
59+
boolean autoGainControl = true;
60+
boolean noiseSuppression = true;
61+
boolean latency = true;
62+
boolean channelCount = true;
63+
boolean deviceId = true;
64+
boolean groupId = true;
5865
};
5966

6067
dictionary MediaTrackCapabilities {
61-
LongRange width;
62-
LongRange height;
63-
DoubleRange aspectRatio;
64-
DoubleRange frameRate;
65-
sequence<DOMString> facingMode;
66-
DoubleRange volume;
67-
LongRange sampleRate;
68-
LongRange sampleSize;
69-
sequence<boolean> echoCancellation;
70-
DoubleRange latency;
71-
LongRange channelCount;
72-
DOMString deviceId;
73-
DOMString groupId;
74-
};
75-
76-
dictionary MediaTrackConstraints : MediaTrackConstraintSet {
77-
sequence<MediaTrackConstraintSet> advanced;
68+
ULongRange width;
69+
ULongRange height;
70+
DoubleRange aspectRatio;
71+
DoubleRange frameRate;
72+
sequence<DOMString> facingMode;
73+
sequence<DOMString> resizeMode;
74+
DoubleRange volume;
75+
ULongRange sampleRate;
76+
ULongRange sampleSize;
77+
sequence<boolean> echoCancellation;
78+
sequence<boolean> autoGainControl;
79+
sequence<boolean> noiseSuppression;
80+
DoubleRange latency;
81+
ULongRange channelCount;
82+
DOMString deviceId;
83+
DOMString groupId;
84+
};
85+
86+
dictionary MediaTrackConstraints : MediaTrackConstraintSet {
87+
sequence<MediaTrackConstraintSet> advanced;
7888
};
7989

8090
dictionary MediaTrackConstraintSet {
81-
ConstrainLong width;
82-
ConstrainLong height;
83-
ConstrainDouble aspectRatio;
84-
ConstrainDouble frameRate;
85-
ConstrainDOMString facingMode;
86-
ConstrainDouble volume;
87-
ConstrainLong sampleRate;
88-
ConstrainLong sampleSize;
89-
ConstrainBoolean echoCancellation;
90-
ConstrainDouble latency;
91-
ConstrainLong channelCount;
92-
ConstrainDOMString deviceId;
93-
ConstrainDOMString groupId;
91+
ConstrainULong width;
92+
ConstrainULong height;
93+
ConstrainDouble aspectRatio;
94+
ConstrainDouble frameRate;
95+
ConstrainDOMString facingMode;
96+
ConstrainDOMString resizeMode;
97+
ConstrainDouble volume;
98+
ConstrainULong sampleRate;
99+
ConstrainULong sampleSize;
100+
ConstrainBoolean echoCancellation;
101+
ConstrainBoolean autoGainControl;
102+
ConstrainBoolean noiseSuppression;
103+
ConstrainDouble latency;
104+
ConstrainULong channelCount;
105+
ConstrainDOMString deviceId;
106+
ConstrainDOMString groupId;
94107
};
95108

96109
dictionary MediaTrackSettings {
97-
long width;
98-
long height;
99-
double aspectRatio;
100-
double frameRate;
101-
DOMString facingMode;
102-
double volume;
103-
long sampleRate;
104-
long sampleSize;
105-
boolean echoCancellation;
106-
double latency;
107-
long channelCount;
108-
DOMString deviceId;
109-
DOMString groupId;
110+
long width;
111+
long height;
112+
double aspectRatio;
113+
double frameRate;
114+
DOMString facingMode;
115+
DOMString resizeMode;
116+
double volume;
117+
long sampleRate;
118+
long sampleSize;
119+
boolean echoCancellation;
120+
boolean autoGainControl;
121+
boolean noiseSuppression;
122+
double latency;
123+
long channelCount;
124+
DOMString deviceId;
125+
DOMString groupId;
110126
};
111127

112128
enum VideoFacingModeEnum {
@@ -116,48 +132,52 @@ enum VideoFacingModeEnum {
116132
"right"
117133
};
118134

135+
enum VideoResizeModeEnum {
136+
"none",
137+
"crop-and-scale"
138+
};
139+
119140
[Exposed=Window,
120-
Constructor(DOMString type, MediaStreamTrackEventInit eventInitDict)]
141+
Constructor (DOMString type, MediaStreamTrackEventInit eventInitDict)]
121142
interface MediaStreamTrackEvent : Event {
122143
[SameObject]
123-
readonly attribute MediaStreamTrack track;
144+
readonly attribute MediaStreamTrack track;
124145
};
125146

126147
dictionary MediaStreamTrackEventInit : EventInit {
127148
required MediaStreamTrack track;
128149
};
129150

130151
[Exposed=Window,
131-
Constructor(DOMString type, OverconstrainedErrorEventInit eventInitDict)]
152+
Constructor (DOMString type, OverconstrainedErrorEventInit eventInitDict)]
132153
interface OverconstrainedErrorEvent : Event {
133-
readonly attribute OverconstrainedError? error;
154+
readonly attribute OverconstrainedError? error;
134155
};
135156

136157
dictionary OverconstrainedErrorEventInit : EventInit {
137-
OverconstrainedError? error = null;
158+
OverconstrainedError? error = null;
138159
};
139160

140-
[Exposed=Window,
141-
NoInterfaceObject]
161+
[Exposed=Window, NoInterfaceObject]
142162
interface NavigatorUserMedia {
143163
[SameObject]
144-
readonly attribute MediaDevices mediaDevices;
164+
readonly attribute MediaDevices mediaDevices;
145165
};
146166

147167
Navigator implements NavigatorUserMedia;
148168

149169
[Exposed=Window]
150170
interface MediaDevices : EventTarget {
151-
attribute EventHandler ondevicechange;
152-
Promise<sequence<MediaDeviceInfo>> enumerateDevices();
171+
attribute EventHandler ondevicechange;
172+
Promise<sequence<MediaDeviceInfo>> enumerateDevices ();
153173
};
154174

155175
[Exposed=Window]
156176
interface MediaDeviceInfo {
157-
readonly attribute DOMString deviceId;
158-
readonly attribute MediaDeviceKind kind;
159-
readonly attribute DOMString label;
160-
readonly attribute DOMString groupId;
177+
readonly attribute DOMString deviceId;
178+
readonly attribute MediaDeviceKind kind;
179+
readonly attribute DOMString label;
180+
readonly attribute DOMString groupId;
161181
[Default] object toJSON();
162182
};
163183

@@ -167,25 +187,22 @@ enum MediaDeviceKind {
167187
"videoinput"
168188
};
169189

170-
[Exposed=Window]
171-
interface InputDeviceInfo : MediaDeviceInfo {
172-
MediaTrackCapabilities getCapabilities();
190+
[Exposed=Window] interface InputDeviceInfo : MediaDeviceInfo {
191+
MediaTrackCapabilities getCapabilities ();
173192
};
174193

175194
partial interface NavigatorUserMedia {
176-
void getUserMedia(MediaStreamConstraints constraints,
177-
NavigatorUserMediaSuccessCallback successCallback,
178-
NavigatorUserMediaErrorCallback errorCallback);
195+
void getUserMedia (MediaStreamConstraints constraints, NavigatorUserMediaSuccessCallback successCallback, NavigatorUserMediaErrorCallback errorCallback);
179196
};
180197

181198
partial interface MediaDevices {
182-
MediaTrackSupportedConstraints getSupportedConstraints();
183-
Promise<MediaStream> getUserMedia(optional MediaStreamConstraints constraints);
199+
MediaTrackSupportedConstraints getSupportedConstraints ();
200+
Promise<MediaStream> getUserMedia (optional MediaStreamConstraints constraints);
184201
};
185202

186203
dictionary MediaStreamConstraints {
187-
(boolean or MediaTrackConstraints) video = false;
188-
(boolean or MediaTrackConstraints) audio = false;
204+
(boolean or MediaTrackConstraints) video = false;
205+
(boolean or MediaTrackConstraints) audio = false;
189206
};
190207

191208
callback NavigatorUserMediaSuccessCallback = void (MediaStream stream);
@@ -196,44 +213,44 @@ typedef object MediaStreamError;
196213

197214
[NoInterfaceObject]
198215
interface ConstrainablePattern {
199-
Capabilities getCapabilities();
200-
Constraints getConstraints();
201-
Settings getSettings();
202-
Promise<void> applyConstraints(optional Constraints constraints);
203-
attribute EventHandler onoverconstrained;
216+
Capabilities getCapabilities ();
217+
Constraints getConstraints ();
218+
Settings getSettings ();
219+
Promise<void> applyConstraints (optional Constraints constraints);
220+
attribute EventHandler onoverconstrained;
204221
};
205222

206223
dictionary DoubleRange {
207-
double max;
208-
double min;
224+
double max;
225+
double min;
209226
};
210227

211228
dictionary ConstrainDoubleRange : DoubleRange {
212-
double exact;
213-
double ideal;
229+
double exact;
230+
double ideal;
214231
};
215232

216-
dictionary LongRange {
217-
long max;
218-
long min;
233+
dictionary ULongRange {
234+
[Clamp] unsigned long max;
235+
[Clamp] unsigned long min;
219236
};
220237

221-
dictionary ConstrainLongRange : LongRange {
222-
long exact;
223-
long ideal;
238+
dictionary ConstrainULongRange : ULongRange {
239+
[Clamp] unsigned long exact;
240+
[Clamp] unsigned long ideal;
224241
};
225242

226243
dictionary ConstrainBooleanParameters {
227-
boolean exact;
228-
boolean ideal;
244+
boolean exact;
245+
boolean ideal;
229246
};
230247

231248
dictionary ConstrainDOMStringParameters {
232-
(DOMString or sequence<DOMString>) exact;
233-
(DOMString or sequence<DOMString>) ideal;
249+
(DOMString or sequence<DOMString>) exact;
250+
(DOMString or sequence<DOMString>) ideal;
234251
};
235252

236-
typedef (long or ConstrainLongRange) ConstrainLong;
253+
typedef ([Clamp] unsigned long or ConstrainULongRange) ConstrainULong;
237254

238255
typedef (double or ConstrainDoubleRange) ConstrainDouble;
239256

@@ -251,5 +268,5 @@ dictionary ConstraintSet {
251268
};
252269

253270
dictionary Constraints : ConstraintSet {
254-
sequence<ConstraintSet> advanced;
271+
sequence<ConstraintSet> advanced;
255272
};

0 commit comments

Comments
 (0)