Open Bug 1861769 Opened 2 years ago Updated 6 months ago

Implement `transfer` for VideoFrameBufferInit

Categories

(Core :: Audio/Video: Web Codecs, task, P3)

task

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 = [];
};
Priority: P2 → P3
Summary: Add `transfer` to VideoFrameBufferInit → Implement `transfer` for VideoFrameBufferInit

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.

See Also: → 1861770
See Also: → 1994891
See Also: → 1994894
See Also: → 1994898
You need to log in before you can comment on or make changes to this bug.