Re: [mediacapture-transform] MSTP's VideoFrame lifetime management model assumes a single consumer (#56)

> I am wondering whether the set of APIs using VideoFrames (media-capture transform, WebCodecs, Canvas, WebGL/WebGPU) has a consistent strategy with respect to memory handling and implicit close() operations.

> The argument for MSTG implicitly calling VideoFrame.close() is that converting to a MediaStreamTrack is typically the last step in the pipeline. But can we assume that every VideoFrame output by MSTP will eventually be consumed by an API with an implicit close() operation? For example, do other rendering approaches (e.g. canvas or WebGL/GPU) also include an implicit close()?


WebCodecs, Canvas, and WebGL are all consistent in that they don't automatically close(). Specific WebGPU : WebCodecs integration isn't spec'ed yet (beyond Canvas integration), but I anticipate any WebGPU method that takes VideoFrames would not automatically close them.

Media-capture transform is mixed, with only the MSTG automatically closing for reasons you mentioned earlier. With MSTP not automatically closing, it becomes necessary that MSTG do the auto close() to enable code like `processor.readable.pipeThrough(transformer).pipeTo(generator.writable);`. 


-- 
GitHub Notification of comment by chcunningham
Please view or discuss this issue at https://github.com/w3c/mediacapture-transform/issues/56#issuecomment-897259884 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 12 August 2021 00:43:43 UTC