Backed out changeset 62f7af8fe549 (bug 1843981) for causing valgrind bustage. CLOSED...
[gecko.git] / dom / webidl / RTCStatsReport.webidl
blob8f61dceeb99fd358e60b47676e3017d9e2289072
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  * https://www.w3.org/TR/webrtc-stats/
10  */
12 enum RTCStatsType {
13   "codec",
14   "inbound-rtp",
15   "outbound-rtp",
16   "remote-inbound-rtp",
17   "remote-outbound-rtp",
18   "media-source",
19   "peer-connection",
20   "csrc",
21   "data-channel",
22   "session",
23   "track",
24   "transport",
25   "candidate-pair",
26   "local-candidate",
27   "remote-candidate"
30 dictionary RTCStats {
31   DOMHighResTimeStamp timestamp;
32   RTCStatsType type;
33   DOMString id;
36 dictionary RTCRtpStreamStats : RTCStats {
37   required unsigned long ssrc;
38   required DOMString kind;
39   DOMString mediaType;
40   DOMString transportId;
41   DOMString codecId;
44 dictionary RTCCodecStats : RTCStats {
45   required unsigned long payloadType;
46   RTCCodecType  codecType;
47   required DOMString     transportId;
48   required DOMString     mimeType;
49   unsigned long clockRate;
50   unsigned long channels;
51   DOMString     sdpFmtpLine;
54 enum RTCCodecType {
55   "encode",
56   "decode",
59 dictionary RTCReceivedRtpStreamStats: RTCRtpStreamStats {
60   unsigned long long packetsReceived;
61   long long packetsLost;
62   double jitter;
63   unsigned long discardedPackets; // non-standard alias for packetsDiscarded
64   unsigned long packetsDiscarded;
67 dictionary RTCInboundRtpStreamStats : RTCReceivedRtpStreamStats {
68   required DOMString trackIdentifier;
69   DOMString remoteId;
70   unsigned long framesDecoded;
71   unsigned long framesDropped;
72   unsigned long frameWidth;
73   unsigned long frameHeight;
74   double framesPerSecond;
75   unsigned long long qpSum;
76   double totalDecodeTime;
77   double totalInterFrameDelay;
78   double totalSquaredInterFrameDelay;
79   DOMHighResTimeStamp lastPacketReceivedTimestamp;
80   unsigned long long headerBytesReceived;
81   unsigned long long fecPacketsReceived;
82   unsigned long long fecPacketsDiscarded;
83   unsigned long long bytesReceived;
84   unsigned long nackCount;
85   unsigned long firCount;
86   unsigned long pliCount;
87   double totalProcessingDelay;
88   // Always missing from libwebrtc
89   // DOMHighResTimeStamp  estimatedPlayoutTimestamp;
90   double jitterBufferDelay;
91   unsigned long long jitterBufferEmittedCount;
92   unsigned long long totalSamplesReceived;
93   unsigned long long concealedSamples;
94   unsigned long long silentConcealedSamples;
95   unsigned long long concealmentEvents;
96   unsigned long long insertedSamplesForDeceleration;
97   unsigned long long removedSamplesForAcceleration;
98   double audioLevel;
99   double totalAudioEnergy;
100   double totalSamplesDuration;
101   unsigned long framesReceived;
104 dictionary RTCRemoteInboundRtpStreamStats : RTCReceivedRtpStreamStats {
105   DOMString localId;
106   double roundTripTime;
107   double totalRoundTripTime;
108   double fractionLost;
109   unsigned long long roundTripTimeMeasurements;
112 dictionary RTCSentRtpStreamStats : RTCRtpStreamStats {
113   unsigned long packetsSent;
114   unsigned long long bytesSent;
117 dictionary RTCOutboundRtpStreamStats : RTCSentRtpStreamStats {
118   DOMString remoteId;
119   unsigned long framesEncoded;
120   unsigned long long qpSum;
121   unsigned long nackCount;
122   unsigned long firCount;
123   unsigned long pliCount;
124   unsigned long long headerBytesSent;
125   unsigned long long retransmittedPacketsSent;
126   unsigned long long retransmittedBytesSent;
127   unsigned long long totalEncodedBytesTarget;
128   unsigned long frameWidth;
129   unsigned long frameHeight;
130   double framesPerSecond;
131   unsigned long framesSent;
132   unsigned long hugeFramesSent;
133   double totalEncodeTime;
136 dictionary RTCRemoteOutboundRtpStreamStats : RTCSentRtpStreamStats {
137   DOMString localId;
138   DOMHighResTimeStamp remoteTimestamp;
141 dictionary RTCMediaSourceStats : RTCStats {
142   required DOMString trackIdentifier;
143   required DOMString kind;
146 dictionary RTCVideoSourceStats : RTCMediaSourceStats {
147   unsigned long   width;
148   unsigned long   height;
149   unsigned long   frames;
150   double          framesPerSecond;
153 dictionary RTCPeerConnectionStats : RTCStats {
154   unsigned long dataChannelsOpened;
155   unsigned long dataChannelsClosed;
158 dictionary RTCRTPContributingSourceStats : RTCStats {
159   unsigned long contributorSsrc;
160   DOMString     inboundRtpStreamId;
163 dictionary RTCDataChannelStats : RTCStats {
164   DOMString           label;
165   DOMString           protocol;
166   long                dataChannelIdentifier;
167   // RTCTransportId is not yet implemented - Bug 1225723
168   // DOMString transportId;
169   RTCDataChannelState state;
170   unsigned long       messagesSent;
171   unsigned long long  bytesSent;
172   unsigned long       messagesReceived;
173   unsigned long long  bytesReceived;
176 enum RTCStatsIceCandidatePairState {
177   "frozen",
178   "waiting",
179   "inprogress",
180   "failed",
181   "succeeded",
182   "cancelled"
185 dictionary RTCIceCandidatePairStats : RTCStats {
186   DOMString transportId;
187   DOMString localCandidateId;
188   DOMString remoteCandidateId;
189   RTCStatsIceCandidatePairState state;
190   unsigned long long priority;
191   boolean nominated;
192   boolean writable;
193   boolean readable;
194   unsigned long long bytesSent;
195   unsigned long long bytesReceived;
196   DOMHighResTimeStamp lastPacketSentTimestamp;
197   DOMHighResTimeStamp lastPacketReceivedTimestamp;
198   boolean selected;
199   [ChromeOnly]
200   unsigned long componentId; // moz
203 enum RTCIceCandidateType {
204   "host",
205   "srflx",
206   "prflx",
207   "relay"
210 dictionary RTCIceCandidateStats : RTCStats {
211   DOMString address;
212   long port;
213   DOMString protocol;
214   RTCIceCandidateType candidateType;
215   long priority;
216   DOMString relayProtocol;
217   // Because we use this internally but don't support RTCIceCandidateStats,
218   // we need to keep the field as ChromeOnly. Bug 1225723
219   [ChromeOnly]
220   DOMString transportId;
221   [ChromeOnly]
222   DOMString proxied;
225 // This is for tracking the frame rate in about:webrtc
226 dictionary RTCVideoFrameHistoryEntryInternal {
227   required unsigned long       width;
228   required unsigned long       height;
229   required unsigned long       rotationAngle;
230   required DOMHighResTimeStamp firstFrameTimestamp;
231   required DOMHighResTimeStamp lastFrameTimestamp;
232   required unsigned long long  consecutiveFrames;
233   required unsigned long       localSsrc;
234   required unsigned long       remoteSsrc;
237 // Collection over the entries for a single track for about:webrtc
238 dictionary RTCVideoFrameHistoryInternal {
239   required DOMString                          trackIdentifier;
240   sequence<RTCVideoFrameHistoryEntryInternal> entries = [];
243 // Collection over the libwebrtc bandwidth estimation stats
244 dictionary RTCBandwidthEstimationInternal {
245   required DOMString  trackIdentifier;
246   long                sendBandwidthBps;    // Estimated available send bandwidth
247   long                maxPaddingBps;       // Cumulative configured max padding
248   long                receiveBandwidthBps; // Estimated available receive bandwidth
249   long                pacerDelayMs;
250   long                rttMs;
253 // This is used by about:webrtc to report SDP parsing errors
254 dictionary RTCSdpParsingErrorInternal {
255   required unsigned long lineNumber;
256   required DOMString     error;
259 // This is for tracking the flow of SDP for about:webrtc
260 dictionary RTCSdpHistoryEntryInternal {
261   required DOMHighResTimeStamp         timestamp;
262   required boolean                     isLocal;
263   required DOMString                   sdp;
264   sequence<RTCSdpParsingErrorInternal> errors = [];
267 // This is intended to be a list of dictionaries that inherit from RTCStats
268 // (with some raw ICE candidates thrown in). Unfortunately, we cannot simply
269 // store a sequence<RTCStats> because of slicing. So, we have to have a
270 // separate list for each type. Used in c++ gecko code.
271 dictionary RTCStatsCollection {
272   sequence<RTCInboundRtpStreamStats>        inboundRtpStreamStats = [];
273   sequence<RTCOutboundRtpStreamStats>       outboundRtpStreamStats = [];
274   sequence<RTCRemoteInboundRtpStreamStats>  remoteInboundRtpStreamStats = [];
275   sequence<RTCRemoteOutboundRtpStreamStats> remoteOutboundRtpStreamStats = [];
276   sequence<RTCMediaSourceStats>             mediaSourceStats = [];
277   sequence<RTCVideoSourceStats>             videoSourceStats = [];
278   sequence<RTCPeerConnectionStats>          peerConnectionStats = [];
279   sequence<RTCRTPContributingSourceStats>   rtpContributingSourceStats = [];
280   sequence<RTCIceCandidatePairStats>        iceCandidatePairStats = [];
281   sequence<RTCIceCandidateStats>            iceCandidateStats = [];
282   sequence<RTCIceCandidateStats>            trickledIceCandidateStats = [];
283   sequence<RTCDataChannelStats>             dataChannelStats = [];
284   sequence<RTCCodecStats>                   codecStats = [];
286   // For internal use only
287   sequence<DOMString>                       rawLocalCandidates = [];
288   sequence<DOMString>                       rawRemoteCandidates = [];
289   sequence<RTCVideoFrameHistoryInternal>    videoFrameHistories = [];
290   sequence<RTCBandwidthEstimationInternal>  bandwidthEstimations = [];
293 // Details that about:webrtc can display about configured ICE servers
294 dictionary RTCIceServerInternal {
295   sequence<DOMString> urls = [];
296   required boolean    credentialProvided;
297   required boolean    userNameProvided;
300 // Details that about:webrtc can display about the RTCConfiguration
301 // Chrome only
302 dictionary RTCConfigurationInternal {
303   RTCBundlePolicy                bundlePolicy;
304   required boolean               certificatesProvided;
305   sequence<RTCIceServerInternal> iceServers = [];
306   RTCIceTransportPolicy          iceTransportPolicy;
307   required boolean               peerIdentityProvided;
308   DOMString                      sdpSemantics;
311 dictionary RTCSdpHistoryInternal {
312   required DOMString pcid;
313   sequence<RTCSdpHistoryEntryInternal> sdpHistory = [];
316 // A collection of RTCStats dictionaries, plus some other info. Used by
317 // WebrtcGlobalInformation for about:webrtc, and telemetry.
318 dictionary RTCStatsReportInternal : RTCStatsCollection {
319   required DOMString                        pcid;
320   required unsigned long                    browserId;
321   RTCConfigurationInternal                  configuration;
322   DOMString                                 jsepSessionErrors;
323   // TODO demux from RTCStatsReportInternal in bug 1830824
324   sequence<RTCSdpHistoryEntryInternal>      sdpHistory = [];
325   required DOMHighResTimeStamp              timestamp;
326   double                                    callDurationMs;
327   required unsigned long                    iceRestarts;
328   required unsigned long                    iceRollbacks;
329   boolean                                   offerer; // Is the PC the offerer
330   required boolean                          closed; // Is the PC now closed
333 [Pref="media.peerconnection.enabled",
334  Exposed=Window]
335 interface RTCStatsReport {
337   // TODO(bug 1586109): Remove this once we no longer need to be able to
338   // construct empty RTCStatsReports from JS.
339   [ChromeOnly]
340   constructor();
342   readonly maplike<DOMString, object>;