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/.
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/
17 "remote-outbound-rtp",
31 DOMHighResTimeStamp timestamp;
36 dictionary RTCRtpStreamStats : RTCStats {
37 required unsigned long ssrc;
38 required DOMString kind;
40 DOMString transportId;
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;
59 dictionary RTCReceivedRtpStreamStats: RTCRtpStreamStats {
60 unsigned long long packetsReceived;
61 long long packetsLost;
63 unsigned long discardedPackets; // non-standard alias for packetsDiscarded
64 unsigned long packetsDiscarded;
67 dictionary RTCInboundRtpStreamStats : RTCReceivedRtpStreamStats {
68 required DOMString trackIdentifier;
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;
99 double totalAudioEnergy;
100 double totalSamplesDuration;
101 unsigned long framesReceived;
104 dictionary RTCRemoteInboundRtpStreamStats : RTCReceivedRtpStreamStats {
106 double roundTripTime;
107 double totalRoundTripTime;
109 unsigned long long roundTripTimeMeasurements;
112 dictionary RTCSentRtpStreamStats : RTCRtpStreamStats {
113 unsigned long packetsSent;
114 unsigned long long bytesSent;
117 dictionary RTCOutboundRtpStreamStats : RTCSentRtpStreamStats {
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 {
138 DOMHighResTimeStamp remoteTimestamp;
141 dictionary RTCMediaSourceStats : RTCStats {
142 required DOMString trackIdentifier;
143 required DOMString kind;
146 dictionary RTCVideoSourceStats : RTCMediaSourceStats {
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 {
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 {
185 dictionary RTCIceCandidatePairStats : RTCStats {
186 DOMString transportId;
187 DOMString localCandidateId;
188 DOMString remoteCandidateId;
189 RTCStatsIceCandidatePairState state;
190 unsigned long long priority;
194 unsigned long long bytesSent;
195 unsigned long long bytesReceived;
196 DOMHighResTimeStamp lastPacketSentTimestamp;
197 DOMHighResTimeStamp lastPacketReceivedTimestamp;
200 unsigned long componentId; // moz
203 dictionary RTCIceCandidateStats : RTCStats {
207 RTCIceCandidateType candidateType;
209 DOMString relayProtocol;
210 // Because we use this internally but don't support RTCIceCandidateStats,
211 // we need to keep the field as ChromeOnly. Bug 1225723
213 DOMString transportId;
218 // This is for tracking the frame rate in about:webrtc
219 dictionary RTCVideoFrameHistoryEntryInternal {
220 required unsigned long width;
221 required unsigned long height;
222 required unsigned long rotationAngle;
223 required DOMHighResTimeStamp firstFrameTimestamp;
224 required DOMHighResTimeStamp lastFrameTimestamp;
225 required unsigned long long consecutiveFrames;
226 required unsigned long localSsrc;
227 required unsigned long remoteSsrc;
230 // Collection over the entries for a single track for about:webrtc
231 dictionary RTCVideoFrameHistoryInternal {
232 required DOMString trackIdentifier;
233 sequence<RTCVideoFrameHistoryEntryInternal> entries = [];
236 // Collection over the libwebrtc bandwidth estimation stats
237 dictionary RTCBandwidthEstimationInternal {
238 required DOMString trackIdentifier;
239 long sendBandwidthBps; // Estimated available send bandwidth
240 long maxPaddingBps; // Cumulative configured max padding
241 long receiveBandwidthBps; // Estimated available receive bandwidth
246 // This is used by about:webrtc to report SDP parsing errors
247 dictionary RTCSdpParsingErrorInternal {
248 required unsigned long lineNumber;
249 required DOMString error;
252 // This is for tracking the flow of SDP for about:webrtc
253 dictionary RTCSdpHistoryEntryInternal {
254 required DOMHighResTimeStamp timestamp;
255 required boolean isLocal;
256 required DOMString sdp;
257 sequence<RTCSdpParsingErrorInternal> errors = [];
260 // This is intended to be a list of dictionaries that inherit from RTCStats
261 // (with some raw ICE candidates thrown in). Unfortunately, we cannot simply
262 // store a sequence<RTCStats> because of slicing. So, we have to have a
263 // separate list for each type. Used in c++ gecko code.
264 dictionary RTCStatsCollection {
265 sequence<RTCInboundRtpStreamStats> inboundRtpStreamStats = [];
266 sequence<RTCOutboundRtpStreamStats> outboundRtpStreamStats = [];
267 sequence<RTCRemoteInboundRtpStreamStats> remoteInboundRtpStreamStats = [];
268 sequence<RTCRemoteOutboundRtpStreamStats> remoteOutboundRtpStreamStats = [];
269 sequence<RTCMediaSourceStats> mediaSourceStats = [];
270 sequence<RTCVideoSourceStats> videoSourceStats = [];
271 sequence<RTCPeerConnectionStats> peerConnectionStats = [];
272 sequence<RTCRTPContributingSourceStats> rtpContributingSourceStats = [];
273 sequence<RTCIceCandidatePairStats> iceCandidatePairStats = [];
274 sequence<RTCIceCandidateStats> iceCandidateStats = [];
275 sequence<RTCIceCandidateStats> trickledIceCandidateStats = [];
276 sequence<RTCDataChannelStats> dataChannelStats = [];
277 sequence<RTCCodecStats> codecStats = [];
279 // For internal use only
280 sequence<DOMString> rawLocalCandidates = [];
281 sequence<DOMString> rawRemoteCandidates = [];
282 sequence<RTCVideoFrameHistoryInternal> videoFrameHistories = [];
283 sequence<RTCBandwidthEstimationInternal> bandwidthEstimations = [];
286 // Details that about:webrtc can display about configured ICE servers
287 dictionary RTCIceServerInternal {
288 sequence<DOMString> urls = [];
289 required boolean credentialProvided;
290 required boolean userNameProvided;
293 // Details that about:webrtc can display about the RTCConfiguration
295 dictionary RTCConfigurationInternal {
296 RTCBundlePolicy bundlePolicy;
297 required boolean certificatesProvided;
298 sequence<RTCIceServerInternal> iceServers = [];
299 RTCIceTransportPolicy iceTransportPolicy;
300 required boolean peerIdentityProvided;
301 DOMString sdpSemantics;
304 dictionary RTCSdpHistoryInternal {
305 required DOMString pcid;
306 sequence<RTCSdpHistoryEntryInternal> sdpHistory = [];
309 // A collection of RTCStats dictionaries, plus some other info. Used by
310 // WebrtcGlobalInformation for about:webrtc, and telemetry.
311 dictionary RTCStatsReportInternal : RTCStatsCollection {
312 required DOMString pcid;
313 required unsigned long browserId;
314 RTCConfigurationInternal configuration;
315 DOMString jsepSessionErrors;
316 // TODO demux from RTCStatsReportInternal in bug 1830824
317 sequence<RTCSdpHistoryEntryInternal> sdpHistory = [];
318 required DOMHighResTimeStamp timestamp;
319 double callDurationMs;
320 required unsigned long iceRestarts;
321 required unsigned long iceRollbacks;
322 boolean offerer; // Is the PC the offerer
323 required boolean closed; // Is the PC now closed
326 [Pref="media.peerconnection.enabled",
328 interface RTCStatsReport {
330 // TODO(bug 1586109): Remove this once we no longer need to be able to
331 // construct empty RTCStatsReports from JS.
335 readonly maplike<DOMString, object>;