RTCStatsReport.webidl (11462B)
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 */ 11 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" 28 }; 29 30 dictionary RTCStats { 31 DOMHighResTimeStamp timestamp; 32 RTCStatsType type; 33 DOMString id; 34 }; 35 36 dictionary RTCRtpStreamStats : RTCStats { 37 required unsigned long ssrc; 38 required DOMString kind; 39 DOMString mediaType; 40 DOMString transportId; 41 DOMString codecId; 42 }; 43 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; 52 }; 53 54 enum RTCCodecType { 55 "encode", 56 "decode", 57 }; 58 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; 65 }; 66 67 dictionary RTCInboundRtpStreamStats : RTCReceivedRtpStreamStats { 68 required DOMString trackIdentifier; 69 DOMString mid; 70 DOMString remoteId; 71 unsigned long framesDecoded; 72 unsigned long keyFramesDecoded; 73 unsigned long framesDropped; 74 unsigned long frameWidth; 75 unsigned long frameHeight; 76 double framesPerSecond; 77 unsigned long long qpSum; 78 double totalDecodeTime; 79 double totalInterFrameDelay; 80 double totalSquaredInterFrameDelay; 81 unsigned long pauseCount; 82 double totalPausesDuration; 83 unsigned long freezeCount; 84 double totalFreezesDuration; 85 DOMHighResTimeStamp lastPacketReceivedTimestamp; 86 unsigned long long headerBytesReceived; 87 unsigned long long fecPacketsReceived; 88 unsigned long long fecPacketsDiscarded; 89 unsigned long long bytesReceived; 90 unsigned long nackCount; 91 unsigned long firCount; 92 unsigned long pliCount; 93 double totalProcessingDelay; 94 DOMHighResTimeStamp estimatedPlayoutTimestamp; 95 double jitterBufferDelay; 96 unsigned long long jitterBufferEmittedCount; 97 double jitterBufferTargetDelay; 98 double jitterBufferMinimumDelay; 99 unsigned long long totalSamplesReceived; 100 unsigned long long concealedSamples; 101 unsigned long long silentConcealedSamples; 102 unsigned long long concealmentEvents; 103 unsigned long long insertedSamplesForDeceleration; 104 unsigned long long removedSamplesForAcceleration; 105 double audioLevel; 106 double totalAudioEnergy; 107 double totalSamplesDuration; 108 unsigned long framesReceived; 109 unsigned long framesAssembledFromMultiplePackets; 110 double totalAssemblyTime; 111 }; 112 113 dictionary RTCRemoteInboundRtpStreamStats : RTCReceivedRtpStreamStats { 114 DOMString localId; 115 double roundTripTime; 116 double totalRoundTripTime; 117 double fractionLost; 118 unsigned long long roundTripTimeMeasurements; 119 }; 120 121 dictionary RTCSentRtpStreamStats : RTCRtpStreamStats { 122 unsigned long packetsSent; 123 unsigned long long bytesSent; 124 }; 125 126 dictionary RTCOutboundRtpStreamStats : RTCSentRtpStreamStats { 127 DOMString mid; 128 DOMString remoteId; 129 DOMString rid; 130 unsigned long framesEncoded; 131 unsigned long long qpSum; 132 unsigned long nackCount; 133 unsigned long firCount; 134 unsigned long pliCount; 135 unsigned long long headerBytesSent; 136 unsigned long long retransmittedPacketsSent; 137 unsigned long long retransmittedBytesSent; 138 unsigned long long totalEncodedBytesTarget; 139 unsigned long frameWidth; 140 unsigned long frameHeight; 141 double framesPerSecond; 142 unsigned long framesSent; 143 unsigned long hugeFramesSent; 144 double totalEncodeTime; 145 }; 146 147 dictionary RTCRemoteOutboundRtpStreamStats : RTCSentRtpStreamStats { 148 DOMString localId; 149 DOMHighResTimeStamp remoteTimestamp; 150 }; 151 152 dictionary RTCMediaSourceStats : RTCStats { 153 required DOMString trackIdentifier; 154 required DOMString kind; 155 }; 156 157 dictionary RTCVideoSourceStats : RTCMediaSourceStats { 158 unsigned long width; 159 unsigned long height; 160 unsigned long frames; 161 double framesPerSecond; 162 }; 163 164 dictionary RTCPeerConnectionStats : RTCStats { 165 unsigned long dataChannelsOpened; 166 unsigned long dataChannelsClosed; 167 }; 168 169 dictionary RTCRTPContributingSourceStats : RTCStats { 170 unsigned long contributorSsrc; 171 DOMString inboundRtpStreamId; 172 }; 173 174 dictionary RTCDataChannelStats : RTCStats { 175 DOMString label; 176 DOMString protocol; 177 long dataChannelIdentifier; 178 // RTCTransportId is not yet implemented - Bug 1225723 179 // DOMString transportId; 180 RTCDataChannelState state; 181 unsigned long messagesSent; 182 unsigned long long bytesSent; 183 unsigned long messagesReceived; 184 unsigned long long bytesReceived; 185 }; 186 187 enum RTCStatsIceCandidatePairState { 188 "frozen", 189 "waiting", 190 "in-progress", 191 "failed", 192 "succeeded", 193 "cancelled" 194 }; 195 196 dictionary RTCIceCandidatePairStats : RTCStats { 197 DOMString transportId; 198 DOMString localCandidateId; 199 DOMString remoteCandidateId; 200 RTCStatsIceCandidatePairState state; 201 unsigned long long priority; 202 boolean nominated; 203 boolean writable; 204 boolean readable; 205 unsigned long long bytesSent; 206 unsigned long long bytesReceived; 207 DOMHighResTimeStamp lastPacketSentTimestamp; 208 DOMHighResTimeStamp lastPacketReceivedTimestamp; 209 boolean selected; 210 double totalRoundTripTime; 211 double currentRoundTripTime; 212 unsigned long long responsesReceived; 213 [ChromeOnly] 214 unsigned long componentId; // moz 215 }; 216 217 dictionary RTCIceCandidateStats : RTCStats { 218 DOMString address; 219 long port; 220 DOMString protocol; 221 RTCIceCandidateType candidateType; 222 long priority; 223 DOMString relayProtocol; 224 // Because we use this internally but don't support RTCIceCandidateStats, 225 // we need to keep the field as ChromeOnly. Bug 1225723 226 [ChromeOnly] 227 DOMString transportId; 228 [ChromeOnly] 229 DOMString proxied; 230 }; 231 232 // This is for tracking the frame rate in about:webrtc 233 dictionary RTCVideoFrameHistoryEntryInternal { 234 required unsigned long width; 235 required unsigned long height; 236 required unsigned long rotationAngle; 237 required DOMHighResTimeStamp firstFrameTimestamp; 238 required DOMHighResTimeStamp lastFrameTimestamp; 239 required unsigned long long consecutiveFrames; 240 required unsigned long localSsrc; 241 required unsigned long remoteSsrc; 242 }; 243 244 // Collection over the entries for a single track for about:webrtc 245 dictionary RTCVideoFrameHistoryInternal { 246 required DOMString trackIdentifier; 247 sequence<RTCVideoFrameHistoryEntryInternal> entries = []; 248 }; 249 250 // Collection over the libwebrtc bandwidth estimation stats 251 dictionary RTCBandwidthEstimationInternal { 252 required DOMString trackIdentifier; 253 long sendBandwidthBps; // Estimated available send bandwidth 254 long maxPaddingBps; // Cumulative configured max padding 255 long receiveBandwidthBps; // Estimated available receive bandwidth 256 long pacerDelayMs; 257 long rttMs; 258 }; 259 260 // This is used by about:webrtc to report SDP parsing errors 261 dictionary RTCSdpParsingErrorInternal { 262 required unsigned long lineNumber; 263 required DOMString error; 264 }; 265 266 // This is for tracking the flow of SDP for about:webrtc 267 dictionary RTCSdpHistoryEntryInternal { 268 required DOMHighResTimeStamp timestamp; 269 required boolean isLocal; 270 required DOMString sdp; 271 sequence<RTCSdpParsingErrorInternal> errors = []; 272 }; 273 274 // This is intended to be a list of dictionaries that inherit from RTCStats 275 // (with some raw ICE candidates thrown in). Unfortunately, we cannot simply 276 // store a sequence<RTCStats> because of slicing. So, we have to have a 277 // separate list for each type. Used in c++ gecko code. 278 dictionary RTCStatsCollection { 279 sequence<RTCInboundRtpStreamStats> inboundRtpStreamStats = []; 280 sequence<RTCOutboundRtpStreamStats> outboundRtpStreamStats = []; 281 sequence<RTCRemoteInboundRtpStreamStats> remoteInboundRtpStreamStats = []; 282 sequence<RTCRemoteOutboundRtpStreamStats> remoteOutboundRtpStreamStats = []; 283 sequence<RTCMediaSourceStats> mediaSourceStats = []; 284 sequence<RTCVideoSourceStats> videoSourceStats = []; 285 sequence<RTCPeerConnectionStats> peerConnectionStats = []; 286 sequence<RTCRTPContributingSourceStats> rtpContributingSourceStats = []; 287 sequence<RTCIceCandidatePairStats> iceCandidatePairStats = []; 288 sequence<RTCIceCandidateStats> iceCandidateStats = []; 289 sequence<RTCIceCandidateStats> trickledIceCandidateStats = []; 290 sequence<RTCDataChannelStats> dataChannelStats = []; 291 sequence<RTCCodecStats> codecStats = []; 292 293 // For internal use only 294 sequence<DOMString> rawLocalCandidates = []; 295 sequence<DOMString> rawRemoteCandidates = []; 296 sequence<RTCVideoFrameHistoryInternal> videoFrameHistories = []; 297 sequence<RTCBandwidthEstimationInternal> bandwidthEstimations = []; 298 }; 299 300 // Details that about:webrtc can display about configured ICE servers 301 dictionary RTCIceServerInternal { 302 sequence<DOMString> urls = []; 303 required boolean credentialProvided; 304 required boolean userNameProvided; 305 }; 306 307 // Details that about:webrtc can display about the RTCConfiguration 308 // Chrome only 309 dictionary RTCConfigurationInternal { 310 RTCBundlePolicy bundlePolicy; 311 required boolean certificatesProvided; 312 sequence<RTCIceServerInternal> iceServers = []; 313 RTCIceTransportPolicy iceTransportPolicy; 314 required boolean peerIdentityProvided; 315 DOMString sdpSemantics; 316 }; 317 318 dictionary RTCSdpHistoryInternal { 319 required DOMString pcid; 320 sequence<RTCSdpHistoryEntryInternal> sdpHistory = []; 321 }; 322 323 // A collection of RTCStats dictionaries, plus some other info. Used by 324 // WebrtcGlobalInformation for about:webrtc, and telemetry. 325 dictionary RTCStatsReportInternal : RTCStatsCollection { 326 required DOMString pcid; 327 required unsigned long browserId; 328 RTCConfigurationInternal configuration; 329 DOMString jsepSessionErrors; 330 // TODO demux from RTCStatsReportInternal in bug 1830824 331 sequence<RTCSdpHistoryEntryInternal> sdpHistory = []; 332 required DOMHighResTimeStamp timestamp; 333 double callDurationMs; 334 required unsigned long iceRestarts; 335 required unsigned long iceRollbacks; 336 boolean offerer; // Is the PC the offerer 337 required boolean closed; // Is the PC now closed 338 }; 339 340 [Pref="media.peerconnection.enabled", 341 Exposed=Window] 342 interface RTCStatsReport { 343 344 // TODO(bug 1586109): Remove this once we no longer need to be able to 345 // construct empty RTCStatsReports from JS. 346 [ChromeOnly] 347 constructor(); 348 349 readonly maplike<DOMString, object>; 350 };