Skip to content

VideoFrame.copyTo() is broken in dart2wasm #118334

Closed
flutter/engine
#40931
@eyebrowsoffire

Description

@eyebrowsoffire

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    blockedIssue is blocked by another issuedependency: dartDart team may need to help use: web_canvaskitCanvasKit (a.k.a. Skia-on-WebGL) rendering backend for Webengineflutter/engine repository. See also e: labels.platform-webWeb applications specifically

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions