PSA: Removal of WebRTC getStats encoderImplementation "unknown" and dataChannelIdentifier "-1"

21 views
Skip to first unread message

Philipp Hancke

unread,
Jun 5, 2023, 6:34:11 AMJun 5
to discuss...@googlegroups.com, blink-dev

The WebRTC getStats API exposes the encoder and decoder implementation names for outbound and inbound video:

https://w3c.github.io/webrtc-stats/#dom-rtcoutboundrtpstreamstats-encoderimplementation

It will no longer provide the value “unknown” in cases where statistics are queried before a video frame was encoded or decoded. Instead, the dictionary member will be omitted which follows the general pattern not to return meaningless information described in

https://w3c.github.io/webrtc-stats/#guidelines-for-implementing-stats-objects

The stats collector implementation actually checks for the empty string but the underlying data source has a default value of "unknown".


Similarly, the datachannel statistics dataChannelIdentifier

https://w3c.github.io/webrtc-stats/#dom-rtcdatachannelstats-datachannelidentifier

is currently being set to -1 before the DTLS connection is established.

This is being guarded against in the “legacy stats” but not the spec stats sadly.


Both properties are not available in Firefox or Safari yet as can be seen in WPT so applications should be prepared for this already.

For more details see the respectives changes [1, 2] in libwebrtc.


Chromestatus feature links:

https://chromestatus.com/feature/5072770423062528

https://chromestatus.com/feature/5088165401985024


Reply all
Reply to author
Forward
0 new messages