[whatwg/streams] Life-time management of VideoFrame when used with streams (Issue #1185)

VideoFrame objects require to call close so as to clean resources in advance of garbage collection.
This is important as VideoFrame may be big and scarce resources.
Streams currently rely on garbage collection to do the lifetime management, which is an important mismatch with VideoFrame model.

The first consequence is that it is unclear what the API contract is when dealing with streams of VideoFrame.
When reading a ReadableStream<VideoFrame>, should it be the source or the reader that call close.
Ditto for WritableStream.

It would be good to get a clear understanding of what is desired, document the ideal API contract and, if possible, enforce part or all of the contract in the API and algorithms.

The second issue is that, if a stream has VideoFramed being queued, and the stream gets aborted, we want the VideoFrames to be closed, or at least leave the opportunity for the web application to do that clean-up.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/issues/1185

Received on Tuesday, 16 November 2021 14:14:44 UTC