Bumping manifests a=b2g-bump
[gecko.git] / dom / webidl / RTCStatsReport.webidl
bloba083629e0d4f63787974590cec2afa764168882f
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/webrtc.html#rtcstatsreport-object
8  * http://www.w3.org/2011/04/webrtc/wiki/Stats
9  */
11 enum RTCStatsType {
12   "inboundrtp",
13   "outboundrtp",
14   "session",
15   "track",
16   "transport",
17   "candidatepair",
18   "localcandidate",
19   "remotecandidate"
22 dictionary RTCStats {
23   DOMHighResTimeStamp timestamp;
24   RTCStatsType type;
25   DOMString id;
28 dictionary RTCRTPStreamStats : RTCStats {
29   DOMString ssrc;
30   DOMString mediaType;
31   DOMString remoteId;
32   boolean isRemote = false;
33   DOMString mediaTrackId;
34   DOMString transportId;
35   DOMString codecId;
37   // Video encoder/decoder measurements (absent for rtcp)
38   double bitrateMean;
39   double bitrateStdDev;
40   double framerateMean;
41   double framerateStdDev;
44 dictionary RTCInboundRTPStreamStats : RTCRTPStreamStats {
45   unsigned long packetsReceived;
46   unsigned long long bytesReceived;
47   double jitter;
48   unsigned long packetsLost;
49   long mozAvSyncDelay;
50   long mozJitterBufferDelay;
51   long mozRtt;
53   // Video decoder measurement (absent in rtcp case)
54   unsigned long discardedPackets;
57 dictionary RTCOutboundRTPStreamStats : RTCRTPStreamStats {
58   unsigned long packetsSent;
59   unsigned long long bytesSent;
60   double targetBitrate;  // config encoder bitrate target of this SSRC in bits/s
62   // Video encoder measurement (absent in rtcp case)
63   unsigned long droppedFrames;
66 dictionary RTCMediaStreamTrackStats : RTCStats {
67   DOMString trackIdentifier;      // track.id property
68   boolean remoteSource;
69   sequence<DOMString> ssrcIds;
70   // Stuff that makes sense for video
71   unsigned long frameWidth;
72   unsigned long frameHeight;
73   double framesPerSecond;        // The nominal FPS value
74   unsigned long framesSent;
75   unsigned long framesReceived;  // Only for remoteSource=true
76   unsigned long framesDecoded;
77   unsigned long framesDropped;   // See VideoPlaybackQuality.droppedVideoFrames
78   unsigned long framesCorrupted; // as above.
79   // Stuff that makes sense for audio
80   double audioLevel;               // linear, 1.0 = 0 dBov (from RFC 6464).
81   // AEC stuff on audio tracks sourced from a microphone where AEC is applied
82   double echoReturnLoss;           // in decibels from G.168 (2012) section 3.14
83   double echoReturnLossEnhancement; // as above, section 3.15
86 dictionary RTCMediaStreamStats : RTCStats {
87   DOMString streamIdentifier;     // stream.id property
88   sequence<DOMString> trackIds;   // Note: stats object ids, not track.id
91 dictionary RTCTransportStats: RTCStats {
92   unsigned long bytesSent;
93   unsigned long bytesReceived;
96 dictionary RTCIceComponentStats : RTCStats {
97   DOMString transportId;
98   long component;
99   unsigned long bytesSent;
100   unsigned long bytesReceived;
101   boolean activeConnection;
104 enum RTCStatsIceCandidatePairState {
105   "frozen",
106   "waiting",
107   "inprogress",
108   "failed",
109   "succeeded",
110   "cancelled"
113 dictionary RTCIceCandidatePairStats : RTCStats {
114   DOMString componentId;
115   DOMString localCandidateId;
116   DOMString remoteCandidateId;
117   RTCStatsIceCandidatePairState state;
118   unsigned long long mozPriority;
119   boolean readable;
120   boolean nominated;
121   boolean selected;
124 enum RTCStatsIceCandidateType {
125   "host",
126   "serverreflexive",
127   "peerreflexive",
128   "relayed"
131 dictionary RTCIceCandidateStats : RTCStats {
132   DOMString componentId;
133   DOMString candidateId;
134   DOMString ipAddress;
135   DOMString transport;
136   DOMString mozLocalTransport; // needs standardization
137   long portNumber;
138   RTCStatsIceCandidateType candidateType;
141 dictionary RTCCodecStats : RTCStats {
142   unsigned long payloadType;       // As used in RTP encoding.
143   DOMString codec;                 // video/vp8 or equivalent
144   unsigned long clockRate;
145   unsigned long channels;          // 2=stereo, missing for most other cases.
146   DOMString parameters;            // From SDP description line
149 callback RTCStatsReportCallback = void (RTCStatsReport obj);
151 // This is the internal representation of the report in this implementation
152 // to be received from c++
154 dictionary RTCStatsReportInternal {
155   DOMString                           pcid = "";
156   sequence<RTCInboundRTPStreamStats>  inboundRTPStreamStats;
157   sequence<RTCOutboundRTPStreamStats> outboundRTPStreamStats;
158   sequence<RTCMediaStreamTrackStats>  mediaStreamTrackStats;
159   sequence<RTCMediaStreamStats>       mediaStreamStats;
160   sequence<RTCTransportStats>         transportStats;
161   sequence<RTCIceComponentStats>      iceComponentStats;
162   sequence<RTCIceCandidatePairStats>  iceCandidatePairStats;
163   sequence<RTCIceCandidateStats>      iceCandidateStats;
164   sequence<RTCCodecStats>             codecStats;
165   DOMString                           localSdp;
166   DOMString                           remoteSdp;
167   DOMHighResTimeStamp                 timestamp;
168   boolean                             closed; // Is the PC now closed
171 [Pref="media.peerconnection.enabled",
172 // TODO: Use MapClass here once it's available (Bug 928114)
173 // MapClass(DOMString, object)
174  JSImplementation="@mozilla.org/dom/rtcstatsreport;1"]
175 interface RTCStatsReport {
176   [ChromeOnly]
177   readonly attribute DOMString mozPcid;
178   void forEach(RTCStatsReportCallback callbackFn, optional any thisArg);
179   object get(DOMString key);
180   boolean has(DOMString key);