W3C home > Mailing lists > Public > public-webrtc@w3.org > October 2013

stats api webidl implementers feedback

From: Jan-Ivar Bruaroey <jib@mozilla.com>
Date: Wed, 23 Oct 2013 02:14:29 -0400
Message-ID: <52676945.6030903@mozilla.com>
To: Göran Eriksson AP <goran.ap.eriksson@ericsson.com>, "Harald Alvestrand (harald@alvestrand.no)" <harald@alvestrand.no>, "public-webrtc@w3.org" <public-webrtc@w3.org>
On 10/18/13 5:54 PM, Göran Eriksson AP wrote:
> Hi Harald,
>
> Great to see the updated proposal for stats parameters uploaded on the W3C WebRTC Wiki, http://www.w3.org/2011/04/webrtc/wiki/Stats- this makes it much easier to discuss it before it ends up in the spec.

Thanks for that.

We recently added the stats skeleton in Nightly, so I have some early 
feedback from that - mostly webidl differences (this is just a skeleton, 
it doesn't return much yet).

Here's what we have at the moment: 
http://mxr.mozilla.org/mozilla-central/source/dom/webidl/RTCStatsReport.webidl 
- In addition, we have some changes for IceCandidatePairs in 
https://bug906990.bugzilla.mozilla.org/attachment.cgi?id=820548 that 
haven't landed yet, but work.

Mostly these are small differences. Here they are (I'll post comments in 
a follow-up):

enum RTCStatsType {
"inbound-rtp",
"outbound-rtp",
+ "cand-pair",
+ "local-candidate",
+ "remote-candidate"
+};

dictionary RTCStats {
- DOMHiResTimeStamp timestamp;
+ DOMHighResTimeStamp timestamp;
RTCStatsType type;
DOMString id;
};

All SSRCs:

dictionary RTCRTPStreamStats : RTCStats {
DOMString ssrc;
DOMString remoteId;
// New stuff:
- boolean isRemote // default false
DOMString mediaTrackId;
DOMString transportId;
DOMString codecId;
};

Note the convention that names ending in “Id” are identifiers of other 
stats objects.
Directed SSRCs:

dictionary RTCInboundRTPStreamStats : RTCRTPStreamStats {
unsigned long packetsReceived;
unsigned long bytesReceived;
// In addition to current spec:
float jitter;
};

@@ -31,63 +37,83 @@
unsigned long bytesSent;
};

Representing MediaStreamTracks:

dictionary RTCMediaStreamTrackStats : RTCStats {
DOMString trackIdentifier; // track.id property
boolean remoteSource;
sequence<DOMString> ssrcIds;
// Only makes sense for audio
- unsigned int audioLevel;
+ unsigned long audioLevel;
// Only makes sense for video
- unsigned int frameWidth;
- unsigned int frameHeight;
- unsigned float framesPerSecond; // The nominal FPS value
- unsigned int framesSent;
- unsigned int framesReceived; // Only makes sense for remoteSource=true
- unsigned int framesDecoded;
- int firs;
+ unsigned long frameWidth;
+ unsigned long frameHeight;
+ unsigned long framesPerSecond; // The nominal FPS value
+ unsigned long framesSent;
+ unsigned long framesReceived; // Only for remoteSource=true
+ unsigned long framesDecoded;
+ long first;
-}
+};

-dictionary MediaStream : RTCStats {
+dictionary RTCMediaStreamStats : RTCStats {
DOMString streamIdentifier; // stream.id property
sequence<DOMString> trackIds; // Note: This is the id of the stats 
object, not the track.id
-}
+};

Representing transports:

-dictionary RTCTransport: RTCStats {
+dictionary RTCTransportStats: RTCStats {
unsigned long bytesSent;
unsigned long bytesReceived;
-}
+};

dictionary RTCIceComponentStats : RTCStats {
DOMString transportId;
- int component;
+ long component;
unsigned long bytesSent;
unsigned long bytesReceived;
- bool activeConnection;
+ boolean activeConnection;
-}
+};

+enum RTCStatsIceCandidatePairState {
+ "frozen",
+ "waiting",
+ "in_progress",
+ "failed",
+ "succeeded",
+ "cancelled"
+};

dictionary RTCIceCandidatePairStats : RTCStats {
- DOMString componentId;
+ DOMString candidatePairId;
DOMString localCandidateId;
DOMString remoteCandidateId;
+ RTCStatsIceCandidatePairState state;
- boolean writable; // Has gotten ACK to an ICE request
- boolean readable; // Has gotten a valid incoming ICE request
+ unsigned long long priority;
+ boolean nominated; // Internal?
+ boolean selected; // Internal?
-}
+};

+enum RTCStatsIceCandidateType {
+ "host",
+ "server-reflexive",
+ "peer-reflexive",
+ "relayed"
+};

-dictionary RTCIceCandidate : RTCStats {
+dictionary RTCIceCandidateStats : RTCStats {
+ DOMString candidateId;
DOMString ipAddress;
- int portNumber;
+ long portNumber;
- DOMString transport; // "tcp" or "udp"
// More ICE-related info goes here.
+ RTCStatsIceCandidateType candidateType;
-}
+};

-dictionary RTCCodec : RTCStats {
+dictionary RTCCodecStats : RTCStats {
- unsigned int payloadType; // As used in RTP encoding.
+ unsigned long payloadType; // As used in RTP encoding.
DOMString codec; // video/vp8 or equivalent
- unsigned int clockRate;
- unsigned int channels; // 2 for stereo, missing for most other cases.
+ unsigned long clockRate;
+ unsigned long channels; // 2=stereo, missing for most other cases.
DOMString parameters; // From SDP description line
-}
+};

+callback RTCStatsReportCallback = void (object value, DOMString key, 
RTCStatsReport obj);

+// [MapClass(DOMString, object)] // TODO: Use once it's available (Bug 
928114)
interface RTCStatsReport {
- getter RTCStats (DOMString id);
+ void forEach(RTCStatsReportCallback callbackFn, optional any thisArg);
+ object get(DOMString key);
+ boolean has(DOMString key);
};

.: Jan-Ivar :.
Received on Wednesday, 23 October 2013 06:14:57 UTC

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 15:19:36 UTC