Implement `transfer` for VideoFrameBufferInit
Categories
(Core :: Audio/Video: Web Codecs, task, P3)
Tracking
()
People
(Reporter: chunmin, Assigned: chunmin)
References
(Blocks 1 open bug)
Details
The newly added transfer in the latest spec of webcodecs should be implemented
dictionary VideoFrameBufferInit {
...
VideoColorSpaceInit colorSpace;
sequence<ArrayBuffer> transfer = [];
};
Updated•1 year ago
|
| Assignee | ||
Updated•6 months ago
|
| Assignee | ||
Comment 1•6 months ago
•
|
||
The rationale behind introducing the transfer property is discussed in w3c/webcodecs#104 (especially this). In short, transfer is used to indicate ownership transfer of the provided ArrayBuffer, similar to how the transfer parameter works in window.postMessage().
Currently, the VideoFrame constructor copies the given ArrayBuffer when creating its image. The byte data from a JS-created ArrayBuffer is accessed through the TypedArray API.
To support ownership transfer, so that the VideoFrame can take the byte data directly from the provided ArrayBuffer instead of copying it, we'll need a mechanism that allows the ownership transfer when the ArrayBuffer is listed in the transfer property. Once ownership transfer from the ArrayBuffer to the VideoFrame is implemented, we should be able to implement steps 12–16 of the VideoFrame constructor algorithm in the latest WebCodecs spec.
The expected outcome is that the implementation should pass the first five tests in transfering.https.any.js.
Description
•