Closed henbos closed 6 months ago
Personally I think it would be fine to let the user agent optimize for accuracy depending on how often the getters are called, and I'm not sure the spec even needs to say anything about this, but we could add a note.
I sensed no WG interest or technical reason for delaying frame counting and the API has now been implemented and shipped in Chromium browsers without delaying initialization. For this reason I would like to close this issue (WontFix).
On the performance side, the lockless ring buffer can even be set up cross-process, so beyond sending a couple of pointers of shared memory over initially, this is a zero-overhead API. And on the ergonomics side it's pretty clear that it's nicer to use an API without having to say up front that you want to use it later.
In issue #112, @youennf expressed a desire to asynchronously expose the
MediaStreamTrackVIdeoStats
, or to have aready
promise, in order to allow optimizations for use cases that don't care about track stats. This would only be the init steps, and does not challenge the TPAC decision that the frame counter attributes are synchronous getters.@jan-ivar commented that instead of initializing, we could let the user agent give a less accurate value the first time the getters are called.