Backed out changesets 73f3ce609c23 and 990a21978a2d (bug 951431) because they were...
[gecko.git] / dom / webidl / MediaStreamTrack.webidl
blob027099b90498d16a8cc8e7efb07b8444297afcfd
1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4  * You can obtain one at http://mozilla.org/MPL/2.0/.
5  *
6  * The origin of this IDL file is
7  * http://dev.w3.org/2011/webrtc/editor/getusermedia.html
8  *
9  * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
10  * liability, trademark and document use rules apply.
11  */
13 // Important! Do not ever add members that might need tracing (e.g. object)
14 // to MediaTrackConstraintSet or any dictionary marked XxxInternal here
16 enum VideoFacingModeEnum {
17     "user",
18     "environment",
19     "left",
20     "right"
23 dictionary MediaTrackConstraintSet {
24     VideoFacingModeEnum facingMode;
27 // MediaTrackConstraint = single-property-subset of MediaTrackConstraintSet
28 // Implemented as full set. Test Object.keys(pair).length == 1
30 // typedef MediaTrackConstraintSet MediaTrackConstraint; // TODO: Bug 913053
32 dictionary MediaStreamConstraints {
33     (boolean or object) audio = false; // TODO: Once Bug 767924 fixed change to
34     (boolean or object) video = false; // (boolean or MediaTrackConstraints)
35     boolean picture = false;
36     boolean fake = false;
39 // Internal dictionary to process the raw objects in (boolean or object)
40 // workaround above. Since we cannot yet use unions on non-objects, we process
41 // the data into discrete members for internal use until Bug 767924 is fixed:
43 dictionary MediaStreamConstraintsInternal {
44     boolean audio = false;
45     boolean video = false;
46     boolean picture = false;
47     boolean fake = false;
48     MediaTrackConstraintsInternal audiom;
49     MediaTrackConstraintsInternal videom;
52 dictionary MediaTrackConstraints {
53     object mandatory; // so we can see unknown + unsupported constraints
54     sequence<MediaTrackConstraintSet> _optional; // a.k.a. MediaTrackConstraint
57 dictionary MediaTrackConstraintsInternal {
58     MediaTrackConstraintSet mandatory; // holds only supported constraints
59     sequence<MediaTrackConstraintSet> _optional; // a.k.a. MediaTrackConstraint
62 interface MediaStreamTrack {
63     readonly    attribute DOMString             kind;
64     readonly    attribute DOMString             id;
65     readonly    attribute DOMString             label;
66                 attribute boolean               enabled;
67 //    readonly    attribute MediaStreamTrackState readyState;
68 //    readonly    attribute SourceTypeEnum        sourceType;
69 //    readonly    attribute DOMString             sourceId;
70 //                attribute EventHandler          onstarted;
71 //                attribute EventHandler          onmute;
72 //                attribute EventHandler          onunmute;
73 //                attribute EventHandler          onended;
74 //    any                    getConstraint (DOMString constraintName, optional boolean mandatory = false);
75 //    void                   setConstraint (DOMString constraintName, any constraintValue, optional boolean mandatory = false);
76 //    MediaTrackConstraints? constraints ();
77 //    void                   applyConstraints (MediaTrackConstraints constraints);
78 //    void                   prependConstraint (DOMString constraintName, any constraintValue);
79 //    void                   appendConstraint (DOMString constraintName, any constraintValue);
80 //                attribute EventHandler          onoverconstrained;
81 //    void                   stop ();