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