w3c / webcodecs

WebCodecs is a flexible web API for encoding and decoding audio and video.

Home Page:https://w3c.github.io/webcodecs/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The encoder/decoder configure methods is not using a queue to check for configuration support

youennf opened this issue · comments

Following on web-platform-tests/interop#382 (comment) and web-platform-tests/wpt#42127, we could improve the spec related to the configure methods.

In particular:

  • configure should probably be using a parallel queue to check for configuration support, like isConfigSupported is.
  • once the check is done and config is not supported, configure could queue a task to call the close decoder/encoder algorithm, like done in https://w3c.github.io/webcodecs/#dom-audiodecoder-decode. This would work nicely if we change the close decoder algorithm to synchronously call the error callback.

Other editorial notes while reading the spec (probably applicable to all decoders/encoders) :

@dalecurtis, I filed this issue following on our WPT test discussions.
Let me know if that aligns with your thoughts.
I can also submit the corresponding PR(s) if that helps.

I'm not sure about [[codec saturated]] since that might have performance implications, but the rest sgtm and matches what our implementation (after the recent fixes). Your help with the PRs would be most welcome, thanks!

Additional remark related to [[codec implementation]]as spec says it should only be used from the [[codec queue]].
But the spec currently signals or clears [[codec implementation]] from reset/close algorithms, which can be called from JS directly, without queueing a task to the [[codec queue]].