-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
The VideoFrame.copyTo() (https://developer.mozilla.org/en-US/docs/Web/API/VideoFrame/copyTo) takes a TypedArray as an in-out parameter and writes data to the array. Our JS interop around this works in dart2js/ddc because dart TypedList objects are themselves just TypedArray objects under the hood. However, in dart2wasm, TypedList objects are backed by a WasmGC array. As a result, our JS interop does a copy of the buffer across the JS interop boundary, but that just makes VideoFrame.copyTo write data into a copy that is not visible from the Dart side.
A couple of solutions have been discussed, but support of raw JSObject interop would at least allow for a workaround that allows us to get correctness (although it would still be very slow perf-wise).