Repository navigation
Add resource reclamation section - #282
Conversation
chcunningham
left a comment
There was a problem hiding this comment.
Generally looks good. A few simple questions.
padenot
left a comment
There was a problem hiding this comment.
Quite a few comments on this that we need to talk about.
| foreground pages. | ||
| - Any other heuristics, determined by the User Agent. For example, | ||
| heuristics might prioritize reclaiming the oldest codecs, the ones with | ||
| the least recent activity, or the least frequent activity. |
There was a problem hiding this comment.
This is going to be a web compat nightmare.
There was a problem hiding this comment.
In my initial read of this I agreed, but then I re-read the intro and felt better.
A User Agent may only reclaim a codec that is either an inactive codec, a background codec, or both. A User Agent MUST NOT reclaim a codec that is both active and in the foreground, e.g any codec that is neither an inactive codec nor a background codec.
This caused me to read the highlighted sentence as purely informational description (perhaps it should be a note) of the narrow flexibility afforded by the above rule and how UAs might prioritize codecs for reclamation. For instance, the UA may choose to reclaim only one of two inactive codecs if one codec was holding onto a more precious resource than the other. The UA may also choose to reclaim both innactive codecs or neither. But this sentence does not allow the UA to reclaim an active foreground codec.
There was a problem hiding this comment.
This needs to be specced a bit more tightly, #121 (comment) is my latest thinking, transcribed by @chcunningham.
tguilbert-google
left a comment
There was a problem hiding this comment.
I've added restrictions to background reclamations. I think these new ones cover the RTC case @chcunningham mention in this comment
I've removed all language specifying how a User Agent might want to prioritize codecs reclamation within the pool of acceptable codecs.
chcunningham
left a comment
There was a problem hiding this comment.
Gernally looks good. @padenot a few questions for you
| - [=Active=] {{AudioDecoder}}s or {{VideoDecoder}}s, if there is | ||
| respectively an [=active=] {{AudioEncoder}} or {{VideoEncoder}} in the | ||
| same context, to prevent breaking long running transcoding tasks. | ||
| - [=Active=] {{AudioDecoder}}s when their respective tabs is actively |
There was a problem hiding this comment.
@padenot is there some better way to say "tab is actively playing audio". Does WA have this notion?
There was a problem hiding this comment.
Not that I know of in terms of spec. That said in Gecko we prefer to use the term "audible", because sometimes we adopt a different behaviour if a page is technically playing audio (i.e. an audio stream is running), but it's been silent for a while.
padenot
left a comment
There was a problem hiding this comment.
Approved with the comments fixed, thanks!
| received a call to `encode()` or `decode()` in the past `10 seconds`, or has | ||
| called its `output()` callback in the past `10 seconds`. An | ||
| <dfn lt="inactive codec|inactive">inactive codec</dfn> is any codec that does | ||
| not meet the definition of an [=active codec=]. |
There was a problem hiding this comment.
This is good, but we need to add another condition, when a frame is being encoded: it's well possible that there is 10s between calling encode() and the encoded frame being output. I tested encoding a 1080p file to av1 on my rather powerful Macbook with rav1e, a high quality encoding is > 10s per frame.
There was a problem hiding this comment.
I added a special case for VideoEncoder, and added a note.
A concern @chcunningham and I shared was "how do we reclaim stalled VideoEncoders", which is why I went with "making progress in encoding" as the definition for activity
| - [=Active=] {{AudioDecoder}}s or {{VideoDecoder}}s, if there is | ||
| respectively an [=active=] {{AudioEncoder}} or {{VideoEncoder}} in the | ||
| same context, to prevent breaking long running transcoding tasks. | ||
| - [=Active=] {{AudioDecoder}}s when their respective tabs is actively |
There was a problem hiding this comment.
Not that I know of in terms of spec. That said in Gecko we prefer to use the term "audible", because sometimes we adopt a different behaviour if a page is technically playing audio (i.e. an audio stream is running), but it's been silent for a while.
SHA: 79a1416 Reason: push, by @chcunningham Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
SHA: 79a1416 Reason: push, by @chcunningham Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
SHA: 79a1416 Reason: push, by @chcunningham Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
SHA: 79a1416 Reason: push, by @chcunningham Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
SHA: 79a1416 Reason: push, by @chcunningham Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
SHA: 79a1416 Reason: push, by @chcunningham Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
SHA: 79a1416 Reason: push, by @chcunningham Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
SHA: 79a1416 Reason: push, by @chcunningham Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
SHA: 79a1416 Reason: push, by @chcunningham Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
SHA: 79a1416 Reason: push, by @chcunningham Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This PR fixes #121.
Areas of this PR that should be scrutinized (amongst others):
Preview | Diff