dom/webidl/RTCStatsReport.webidl

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:8c039823032a
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 */
9
10 enum RTCStatsType {
11 "inboundrtp",
12 "outboundrtp",
13 "session",
14 "track",
15 "transport",
16 "candidatepair",
17 "localcandidate",
18 "remotecandidate"
19 };
20
21 dictionary RTCStats {
22 DOMHighResTimeStamp timestamp;
23 RTCStatsType type;
24 DOMString id;
25 };
26
27 dictionary RTCRTPStreamStats : RTCStats {
28 DOMString ssrc;
29 DOMString remoteId;
30 boolean isRemote = false;
31 DOMString mediaTrackId;
32 DOMString transportId;
33 DOMString codecId;
34 };
35
36 dictionary RTCInboundRTPStreamStats : RTCRTPStreamStats {
37 unsigned long packetsReceived;
38 unsigned long long bytesReceived;
39 double jitter;
40 unsigned long packetsLost;
41 long mozAvSyncDelay;
42 long mozJitterBufferDelay;
43 long mozRtt;
44 };
45
46 dictionary RTCOutboundRTPStreamStats : RTCRTPStreamStats {
47 unsigned long packetsSent;
48 unsigned long long bytesSent;
49 };
50
51 dictionary RTCMediaStreamTrackStats : RTCStats {
52 DOMString trackIdentifier; // track.id property
53 boolean remoteSource;
54 sequence<DOMString> ssrcIds;
55 unsigned long audioLevel; // Only for audio, the rest are only for video
56 unsigned long frameWidth;
57 unsigned long frameHeight;
58 double framesPerSecond; // The nominal FPS value
59 unsigned long framesSent;
60 unsigned long framesReceived; // Only for remoteSource=true
61 unsigned long framesDecoded;
62 };
63
64 dictionary RTCMediaStreamStats : RTCStats {
65 DOMString streamIdentifier; // stream.id property
66 sequence<DOMString> trackIds; // Note: stats object ids, not track.id
67 };
68
69 dictionary RTCTransportStats: RTCStats {
70 unsigned long bytesSent;
71 unsigned long bytesReceived;
72 };
73
74 dictionary RTCIceComponentStats : RTCStats {
75 DOMString transportId;
76 long component;
77 unsigned long bytesSent;
78 unsigned long bytesReceived;
79 boolean activeConnection;
80 };
81
82 enum RTCStatsIceCandidatePairState {
83 "frozen",
84 "waiting",
85 "inprogress",
86 "failed",
87 "succeeded",
88 "cancelled"
89 };
90
91 dictionary RTCIceCandidatePairStats : RTCStats {
92 DOMString componentId;
93 DOMString localCandidateId;
94 DOMString remoteCandidateId;
95 RTCStatsIceCandidatePairState state;
96 unsigned long long mozPriority;
97 boolean readable;
98 boolean nominated;
99 boolean selected;
100 };
101
102 enum RTCStatsIceCandidateType {
103 "host",
104 "serverreflexive",
105 "peerreflexive",
106 "relayed"
107 };
108
109 dictionary RTCIceCandidateStats : RTCStats {
110 DOMString componentId;
111 DOMString candidateId;
112 DOMString ipAddress;
113 DOMString transport;
114 DOMString mozLocalTransport; // needs standardization
115 long portNumber;
116 RTCStatsIceCandidateType candidateType;
117 };
118
119 dictionary RTCCodecStats : RTCStats {
120 unsigned long payloadType; // As used in RTP encoding.
121 DOMString codec; // video/vp8 or equivalent
122 unsigned long clockRate;
123 unsigned long channels; // 2=stereo, missing for most other cases.
124 DOMString parameters; // From SDP description line
125 };
126
127 callback RTCStatsReportCallback = void (RTCStatsReport obj);
128
129 // This is the internal representation of the report in this implementation
130 // to be received from c++
131
132 dictionary RTCStatsReportInternal {
133 DOMString pcid = "";
134 sequence<RTCRTPStreamStats> rtpStreamStats;
135 sequence<RTCInboundRTPStreamStats> inboundRTPStreamStats;
136 sequence<RTCOutboundRTPStreamStats> outboundRTPStreamStats;
137 sequence<RTCMediaStreamTrackStats> mediaStreamTrackStats;
138 sequence<RTCMediaStreamStats> mediaStreamStats;
139 sequence<RTCTransportStats> transportStats;
140 sequence<RTCIceComponentStats> iceComponentStats;
141 sequence<RTCIceCandidatePairStats> iceCandidatePairStats;
142 sequence<RTCIceCandidateStats> iceCandidateStats;
143 sequence<RTCCodecStats> codecStats;
144 };
145
146 [Pref="media.peerconnection.enabled",
147 // TODO: Use MapClass here once it's available (Bug 928114)
148 // MapClass(DOMString, object)
149 JSImplementation="@mozilla.org/dom/rtcstatsreport;1"]
150 interface RTCStatsReport {
151 [ChromeOnly]
152 readonly attribute DOMString mozPcid;
153 void forEach(RTCStatsReportCallback callbackFn, optional any thisArg);
154 object get(DOMString key);
155 boolean has(DOMString key);
156 };

mercurial