Re: stats api webidl implementers feedback

On 10/23/13 2:14 AM, Jan-Ivar Bruaroey wrote:
> 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"
> +};

We added more types for IceCandidatePairs.

> 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

We didn't know about this one. New?

> 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

I didn't catch that framesPerSecond is float. Is this for NTSC and such?

> - 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 {

We renamed some stuff for consistency.

> 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?
> -}
> +};

Here we added a few things we wanted for debugging (we're using a 
privileged version of the API internally for an about:webrtc page) but 
we're not sure about exposing it to content - any privacy-implications? 
- Not sure why we didn't add readable and writable.

> +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);

Sorry, this should have been unchanged. i.e. callback 
RTCStatsReportCallback = void (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);
> };

I mentioned this difference in an earlier post. We're trying MapClass 
instead of a getter (to avoid stat name conflicts with JS properties, I 
believe).

.: Jan-Ivar :.

Received on Wednesday, 23 October 2013 06:35:58 UTC