-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Backpressure/buffering for hardware decoders? #27
Comments
I think we'd require the implementation to do the buffering internally. I suspect browsers have general frameworks for implementing Streams that can do this (the Streams spec describes it). @pthatcherg could we get a "spec language" label? |
My current implementation estimates the number of frames buffered internally by the codec (assuming one input chunk = one output chunk), and tries to keep internal buffered frames + output buffered frames below a constant. It'll need more tuning to be production ready but it seems workable. |
I believe this is handled via (e.g.) the |
Yes, There is more we could do (a few different statistics, an event when space becomes available), but |
For new queuing stats/events, I vote to track separately should requests for those arise. Otherwise seems like discussion here is concluded. Please re-open if I've overlooked anything. |
The Streams spec assumes you can get some backpressure signal from the implementation of a TransformStream.
But a hardware codec may not give you that much control over what happens after frame data is passed into the codec API. It will typically decode the frame data immediately and render it into a GPU frame buffer.
So the high level feedback is: the spec (at a future level of maturity) should map the behavior of an abstract codec onto the behavior of the TransformStream, and allow codec implementations that run in immediate mode (without buffering). (Or require implementations to do this buffering internally.)
The text was updated successfully, but these errors were encountered: