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
23 DOMHighResTimeStamp timestamp;
28 dictionary RTCRTPStreamStats : RTCStats {
32 boolean isRemote = false;
33 DOMString mediaTrackId;
34 DOMString transportId;
37 // Video encoder/decoder measurements (absent for rtcp)
41 double framerateStdDev;
44 dictionary RTCInboundRTPStreamStats : RTCRTPStreamStats {
45 unsigned long packetsReceived;
46 unsigned long long bytesReceived;
48 unsigned long packetsLost;
50 long mozJitterBufferDelay;
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
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;
99 unsigned long bytesSent;
100 unsigned long bytesReceived;
101 boolean activeConnection;
104 enum RTCStatsIceCandidatePairState {
113 dictionary RTCIceCandidatePairStats : RTCStats {
114 DOMString componentId;
115 DOMString localCandidateId;
116 DOMString remoteCandidateId;
117 RTCStatsIceCandidatePairState state;
118 unsigned long long mozPriority;
124 enum RTCStatsIceCandidateType {
131 dictionary RTCIceCandidateStats : RTCStats {
132 DOMString componentId;
133 DOMString candidateId;
136 DOMString mozLocalTransport; // needs standardization
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 {
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;
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 {
177 readonly attribute DOMString mozPcid;
178 void forEach(RTCStatsReportCallback callbackFn, optional any thisArg);
179 object get(DOMString key);
180 boolean has(DOMString key);