dom/webidl/RTCStatsReport.webidl

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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  */
    10 enum RTCStatsType {
    11   "inboundrtp",
    12   "outboundrtp",
    13   "session",
    14   "track",
    15   "transport",
    16   "candidatepair",
    17   "localcandidate",
    18   "remotecandidate"
    19 };
    21 dictionary RTCStats {
    22   DOMHighResTimeStamp timestamp;
    23   RTCStatsType type;
    24   DOMString id;
    25 };
    27 dictionary RTCRTPStreamStats : RTCStats {
    28   DOMString ssrc;
    29   DOMString remoteId;
    30   boolean isRemote = false;
    31   DOMString mediaTrackId;
    32   DOMString transportId;
    33   DOMString codecId;
    34 };
    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 };
    46 dictionary RTCOutboundRTPStreamStats : RTCRTPStreamStats {
    47   unsigned long packetsSent;
    48   unsigned long long bytesSent;
    49 };
    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 };
    64 dictionary RTCMediaStreamStats : RTCStats {
    65   DOMString streamIdentifier;     // stream.id property
    66   sequence<DOMString> trackIds;   // Note: stats object ids, not track.id
    67 };
    69 dictionary RTCTransportStats: RTCStats {
    70   unsigned long bytesSent;
    71   unsigned long bytesReceived;
    72 };
    74 dictionary RTCIceComponentStats : RTCStats {
    75   DOMString transportId;
    76   long component;
    77   unsigned long bytesSent;
    78   unsigned long bytesReceived;
    79   boolean activeConnection;
    80 };
    82 enum RTCStatsIceCandidatePairState {
    83   "frozen",
    84   "waiting",
    85   "inprogress",
    86   "failed",
    87   "succeeded",
    88   "cancelled"
    89 };
    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 };
   102 enum RTCStatsIceCandidateType {
   103   "host",
   104   "serverreflexive",
   105   "peerreflexive",
   106   "relayed"
   107 };
   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 };
   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 };
   127 callback RTCStatsReportCallback = void (RTCStatsReport obj);
   129 // This is the internal representation of the report in this implementation
   130 // to be received from c++
   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 };
   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