- From: youennf <notifications@github.com>
- Date: Wed, 15 Dec 2021 00:51:48 -0800
- To: whatwg/streams <streams@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Wednesday, 15 December 2021 08:52:01 UTC
@youennf commented on this pull request. > +If A does not close `VideoFrame`, it is the responsibility of the remaining of the pipeline to close it. +There is a need to clearly identify who is owning these objects and who is responsible to close these objects at any point in time. + +The proposed solution is to transfer ownership of an object to the stream when it gets written or enqueueud to the stream. +By doing so, the processing unit that enqueues/writes objects will not be able to mutate objects manipulated by the stream and is relieved of the lifetime management of these objects. +Conversely, processing units take ownership of objects when they receive them from a stream. + +Transferring ownership should be opt-in. For that purpose, a new streams type, named 'transfer' in this document, would be added. + +## Example + +Below is an example of JavaScript that shows how this can be used. +The example creates a processing pipe starting with a camera stream and applying two transforms, one for doing a processing for every 30 frame, and one for doing background blur. + +```javascript +// JS transform Right -- 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/pull/1193#discussion_r769392612
Received on Wednesday, 15 December 2021 08:52:01 UTC