w3c / media-source

Media Source Extensions
https://w3c.github.io/media-source/
Other
267 stars 59 forks source link

Editorial? Coded Frame eviction algorithm needs to note that "buffer full flag" may be updated immediately based on |new data| #289

Open wolenetz opened 2 years ago

wolenetz commented 2 years ago

Implementations, like Chromium, can immediately respond with a QuotaExceededError synchronously to an attempted appendBuffer(new_data) if new_data is projected to likely exceed buffering availability. This can happen even if nothing were previously buffered (so the conceptual buffer full flag in the spec would be false before that appendBuffer() attempt, in this example.

To afford such implementations to more rapidly provide push-back to apps that their append is likely too large for current resource availability, the spec needs an update to Coded Frame Eviction steps, such as a step just prior to or note associated with the current step: "If the buffer full flag equals false, then abort these steps." that indicates that implementations may include information such as |new data|'s size in attempts to predict whether or not the |buffer full flag| might likely become true when processing |new data|, and if so, proceed to attempt to make room for |new data| even if |buffer full flag| is false.