dom/webidl/RTCStatsReport.webidl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/webidl/RTCStatsReport.webidl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,156 @@
     1.4 +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this file,
     1.7 + * You can obtain one at http://mozilla.org/MPL/2.0/.
     1.8 + *
     1.9 + * The origin of this IDL file is
    1.10 + * http://dev.w3.org/2011/webrtc/editor/webrtc.html#rtcstatsreport-object
    1.11 + */
    1.12 +
    1.13 +enum RTCStatsType {
    1.14 +  "inboundrtp",
    1.15 +  "outboundrtp",
    1.16 +  "session",
    1.17 +  "track",
    1.18 +  "transport",
    1.19 +  "candidatepair",
    1.20 +  "localcandidate",
    1.21 +  "remotecandidate"
    1.22 +};
    1.23 +
    1.24 +dictionary RTCStats {
    1.25 +  DOMHighResTimeStamp timestamp;
    1.26 +  RTCStatsType type;
    1.27 +  DOMString id;
    1.28 +};
    1.29 +
    1.30 +dictionary RTCRTPStreamStats : RTCStats {
    1.31 +  DOMString ssrc;
    1.32 +  DOMString remoteId;
    1.33 +  boolean isRemote = false;
    1.34 +  DOMString mediaTrackId;
    1.35 +  DOMString transportId;
    1.36 +  DOMString codecId;
    1.37 +};
    1.38 +
    1.39 +dictionary RTCInboundRTPStreamStats : RTCRTPStreamStats {
    1.40 +  unsigned long packetsReceived;
    1.41 +  unsigned long long bytesReceived;
    1.42 +  double jitter;
    1.43 +  unsigned long packetsLost;
    1.44 +  long mozAvSyncDelay;
    1.45 +  long mozJitterBufferDelay;
    1.46 +  long mozRtt;
    1.47 +};
    1.48 +
    1.49 +dictionary RTCOutboundRTPStreamStats : RTCRTPStreamStats {
    1.50 +  unsigned long packetsSent;
    1.51 +  unsigned long long bytesSent;
    1.52 +};
    1.53 +
    1.54 +dictionary RTCMediaStreamTrackStats : RTCStats {
    1.55 +  DOMString trackIdentifier;      // track.id property
    1.56 +  boolean remoteSource;
    1.57 +  sequence<DOMString> ssrcIds;
    1.58 +  unsigned long audioLevel;       // Only for audio, the rest are only for video
    1.59 +  unsigned long frameWidth;
    1.60 +  unsigned long frameHeight;
    1.61 +  double framesPerSecond;         // The nominal FPS value
    1.62 +  unsigned long framesSent;
    1.63 +  unsigned long framesReceived;   // Only for remoteSource=true
    1.64 +  unsigned long framesDecoded;
    1.65 +};
    1.66 +
    1.67 +dictionary RTCMediaStreamStats : RTCStats {
    1.68 +  DOMString streamIdentifier;     // stream.id property
    1.69 +  sequence<DOMString> trackIds;   // Note: stats object ids, not track.id
    1.70 +};
    1.71 +
    1.72 +dictionary RTCTransportStats: RTCStats {
    1.73 +  unsigned long bytesSent;
    1.74 +  unsigned long bytesReceived;
    1.75 +};
    1.76 +
    1.77 +dictionary RTCIceComponentStats : RTCStats {
    1.78 +  DOMString transportId;
    1.79 +  long component;
    1.80 +  unsigned long bytesSent;
    1.81 +  unsigned long bytesReceived;
    1.82 +  boolean activeConnection;
    1.83 +};
    1.84 +
    1.85 +enum RTCStatsIceCandidatePairState {
    1.86 +  "frozen",
    1.87 +  "waiting",
    1.88 +  "inprogress",
    1.89 +  "failed",
    1.90 +  "succeeded",
    1.91 +  "cancelled"
    1.92 +};
    1.93 +
    1.94 +dictionary RTCIceCandidatePairStats : RTCStats {
    1.95 +  DOMString componentId;
    1.96 +  DOMString localCandidateId;
    1.97 +  DOMString remoteCandidateId;
    1.98 +  RTCStatsIceCandidatePairState state;
    1.99 +  unsigned long long mozPriority;
   1.100 +  boolean readable;
   1.101 +  boolean nominated;
   1.102 +  boolean selected;
   1.103 +};
   1.104 +
   1.105 +enum RTCStatsIceCandidateType {
   1.106 +  "host",
   1.107 +  "serverreflexive",
   1.108 +  "peerreflexive",
   1.109 +  "relayed"
   1.110 +};
   1.111 +
   1.112 +dictionary RTCIceCandidateStats : RTCStats {
   1.113 +  DOMString componentId;
   1.114 +  DOMString candidateId;
   1.115 +  DOMString ipAddress;
   1.116 +  DOMString transport;
   1.117 +  DOMString mozLocalTransport; // needs standardization
   1.118 +  long portNumber;
   1.119 +  RTCStatsIceCandidateType candidateType;
   1.120 +};
   1.121 +
   1.122 +dictionary RTCCodecStats : RTCStats {
   1.123 +  unsigned long payloadType;       // As used in RTP encoding.
   1.124 +  DOMString codec;                 // video/vp8 or equivalent
   1.125 +  unsigned long clockRate;
   1.126 +  unsigned long channels;          // 2=stereo, missing for most other cases.
   1.127 +  DOMString parameters;            // From SDP description line
   1.128 +};
   1.129 +
   1.130 +callback RTCStatsReportCallback = void (RTCStatsReport obj);
   1.131 +
   1.132 +// This is the internal representation of the report in this implementation
   1.133 +// to be received from c++
   1.134 +
   1.135 +dictionary RTCStatsReportInternal {
   1.136 +  DOMString                           pcid = "";
   1.137 +  sequence<RTCRTPStreamStats>         rtpStreamStats;
   1.138 +  sequence<RTCInboundRTPStreamStats>  inboundRTPStreamStats;
   1.139 +  sequence<RTCOutboundRTPStreamStats> outboundRTPStreamStats;
   1.140 +  sequence<RTCMediaStreamTrackStats>  mediaStreamTrackStats;
   1.141 +  sequence<RTCMediaStreamStats>       mediaStreamStats;
   1.142 +  sequence<RTCTransportStats>         transportStats;
   1.143 +  sequence<RTCIceComponentStats>      iceComponentStats;
   1.144 +  sequence<RTCIceCandidatePairStats>  iceCandidatePairStats;
   1.145 +  sequence<RTCIceCandidateStats>      iceCandidateStats;
   1.146 +  sequence<RTCCodecStats>             codecStats;
   1.147 +};
   1.148 +
   1.149 +[Pref="media.peerconnection.enabled",
   1.150 +// TODO: Use MapClass here once it's available (Bug 928114)
   1.151 +// MapClass(DOMString, object)
   1.152 + JSImplementation="@mozilla.org/dom/rtcstatsreport;1"]
   1.153 +interface RTCStatsReport {
   1.154 +  [ChromeOnly]
   1.155 +  readonly attribute DOMString mozPcid;
   1.156 +  void forEach(RTCStatsReportCallback callbackFn, optional any thisArg);
   1.157 +  object get(DOMString key);
   1.158 +  boolean has(DOMString key);
   1.159 +};

mercurial