michael@0: /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: * michael@0: * The origin of this IDL file is michael@0: * http://dev.w3.org/2011/webrtc/editor/webrtc.html#rtcstatsreport-object michael@0: */ michael@0: michael@0: enum RTCStatsType { michael@0: "inboundrtp", michael@0: "outboundrtp", michael@0: "session", michael@0: "track", michael@0: "transport", michael@0: "candidatepair", michael@0: "localcandidate", michael@0: "remotecandidate" michael@0: }; michael@0: michael@0: dictionary RTCStats { michael@0: DOMHighResTimeStamp timestamp; michael@0: RTCStatsType type; michael@0: DOMString id; michael@0: }; michael@0: michael@0: dictionary RTCRTPStreamStats : RTCStats { michael@0: DOMString ssrc; michael@0: DOMString remoteId; michael@0: boolean isRemote = false; michael@0: DOMString mediaTrackId; michael@0: DOMString transportId; michael@0: DOMString codecId; michael@0: }; michael@0: michael@0: dictionary RTCInboundRTPStreamStats : RTCRTPStreamStats { michael@0: unsigned long packetsReceived; michael@0: unsigned long long bytesReceived; michael@0: double jitter; michael@0: unsigned long packetsLost; michael@0: long mozAvSyncDelay; michael@0: long mozJitterBufferDelay; michael@0: long mozRtt; michael@0: }; michael@0: michael@0: dictionary RTCOutboundRTPStreamStats : RTCRTPStreamStats { michael@0: unsigned long packetsSent; michael@0: unsigned long long bytesSent; michael@0: }; michael@0: michael@0: dictionary RTCMediaStreamTrackStats : RTCStats { michael@0: DOMString trackIdentifier; // track.id property michael@0: boolean remoteSource; michael@0: sequence ssrcIds; michael@0: unsigned long audioLevel; // Only for audio, the rest are only for video michael@0: unsigned long frameWidth; michael@0: unsigned long frameHeight; michael@0: double framesPerSecond; // The nominal FPS value michael@0: unsigned long framesSent; michael@0: unsigned long framesReceived; // Only for remoteSource=true michael@0: unsigned long framesDecoded; michael@0: }; michael@0: michael@0: dictionary RTCMediaStreamStats : RTCStats { michael@0: DOMString streamIdentifier; // stream.id property michael@0: sequence trackIds; // Note: stats object ids, not track.id michael@0: }; michael@0: michael@0: dictionary RTCTransportStats: RTCStats { michael@0: unsigned long bytesSent; michael@0: unsigned long bytesReceived; michael@0: }; michael@0: michael@0: dictionary RTCIceComponentStats : RTCStats { michael@0: DOMString transportId; michael@0: long component; michael@0: unsigned long bytesSent; michael@0: unsigned long bytesReceived; michael@0: boolean activeConnection; michael@0: }; michael@0: michael@0: enum RTCStatsIceCandidatePairState { michael@0: "frozen", michael@0: "waiting", michael@0: "inprogress", michael@0: "failed", michael@0: "succeeded", michael@0: "cancelled" michael@0: }; michael@0: michael@0: dictionary RTCIceCandidatePairStats : RTCStats { michael@0: DOMString componentId; michael@0: DOMString localCandidateId; michael@0: DOMString remoteCandidateId; michael@0: RTCStatsIceCandidatePairState state; michael@0: unsigned long long mozPriority; michael@0: boolean readable; michael@0: boolean nominated; michael@0: boolean selected; michael@0: }; michael@0: michael@0: enum RTCStatsIceCandidateType { michael@0: "host", michael@0: "serverreflexive", michael@0: "peerreflexive", michael@0: "relayed" michael@0: }; michael@0: michael@0: dictionary RTCIceCandidateStats : RTCStats { michael@0: DOMString componentId; michael@0: DOMString candidateId; michael@0: DOMString ipAddress; michael@0: DOMString transport; michael@0: DOMString mozLocalTransport; // needs standardization michael@0: long portNumber; michael@0: RTCStatsIceCandidateType candidateType; michael@0: }; michael@0: michael@0: dictionary RTCCodecStats : RTCStats { michael@0: unsigned long payloadType; // As used in RTP encoding. michael@0: DOMString codec; // video/vp8 or equivalent michael@0: unsigned long clockRate; michael@0: unsigned long channels; // 2=stereo, missing for most other cases. michael@0: DOMString parameters; // From SDP description line michael@0: }; michael@0: michael@0: callback RTCStatsReportCallback = void (RTCStatsReport obj); michael@0: michael@0: // This is the internal representation of the report in this implementation michael@0: // to be received from c++ michael@0: michael@0: dictionary RTCStatsReportInternal { michael@0: DOMString pcid = ""; michael@0: sequence rtpStreamStats; michael@0: sequence inboundRTPStreamStats; michael@0: sequence outboundRTPStreamStats; michael@0: sequence mediaStreamTrackStats; michael@0: sequence mediaStreamStats; michael@0: sequence transportStats; michael@0: sequence iceComponentStats; michael@0: sequence iceCandidatePairStats; michael@0: sequence iceCandidateStats; michael@0: sequence codecStats; michael@0: }; michael@0: michael@0: [Pref="media.peerconnection.enabled", michael@0: // TODO: Use MapClass here once it's available (Bug 928114) michael@0: // MapClass(DOMString, object) michael@0: JSImplementation="@mozilla.org/dom/rtcstatsreport;1"] michael@0: interface RTCStatsReport { michael@0: [ChromeOnly] michael@0: readonly attribute DOMString mozPcid; michael@0: void forEach(RTCStatsReportCallback callbackFn, optional any thisArg); michael@0: object get(DOMString key); michael@0: boolean has(DOMString key); michael@0: };