-
Notifications
You must be signed in to change notification settings - Fork 139
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
Detach codec inputs (where feasible) #104
Comments
Previously we decided against this for two reasons:
The primary alternative to transferring inputs is to always copy inputs immediately. |
Title update: problem isn't unique to ImageDecoder. Lets fix this everywhere. Agree with points 1 and 2 above. |
Dropping some questions for TAG
|
There are evidences in the Web Audio issue tracker that folks in the video game industry find this problematic and like "zero-garbage" paths. I don't have a solution however, but a chat with representatives from this industry is planned. |
An update after talking with a couple of people from different industries: it's getting increasingly clear that detaching is needed, but that also internal copy is useful. We'll probably have to support both. |
A related issue is #212, where the detached input is reattached to another array buffer on output, so that authors can reuse it. This means we can have the best of both world: zero-copy input, but not a lot of |
I discussed this with @domenic (html and transferable expert) last week but haven't found time to send a PR. Here's a quick outline:
Either way, we can do this without making a breaking change. |
triage note: marking extension, as we're converging on non-breaking proposals that simply add new arguments/keys. Similarly, removing from launch blockers. This was only blocking when we thought it might be breaking. Offering a transfer ability is important, but hasn't blocked anyone currently experimenting with the API. |
Discussed in editors call. We like the last option
|
See also #212, that could also use the design mentioned in #104 (comment). |
Transfer lists inside the dicts seem like a nice easy improvement. Will mark this ready for PR if someone wants to put that together. @Djuffin |
Proposal to add
|
Implementation for w3c/webcodecs#104 Change-Id: Ifbc1fb1739a0bc19dc6db27943fff0cecae0156d
Implementation for w3c/webcodecs#104 Change-Id: Ifbc1fb1739a0bc19dc6db27943fff0cecae0156d
Implementation for w3c/webcodecs#104 Change-Id: Ifbc1fb1739a0bc19dc6db27943fff0cecae0156d
Discussed in Media WG meeting 30 May 2023, minutes. |
From #104 (comment) above
Would proposed Immutable ArrayBuffers enable you to avoid this copy? |
ImageDecoder isn't in the draft spec yet, but see here for latest interface in Chromium.
This is issue is a reminder that we should consider specifying that inputs are detached after the call to decode returns (neutering the buffer from JS pov). Similar to WebAudio's decodeAudio(). Detaching the inputs transfers ownership for the UA to safely perform asynch decoding without requiring a copy.
The text was updated successfully, but these errors were encountered: