Bug 230624

Summary: MediaStream canvas.captureStream() for Canvas element provides frames too late
Product: WebKit Reporter: Kimmo Kinnunen <kkinnunen>
Component: WebRTCAssignee: Nobody <webkit-unassigned>
Status: REOPENED ---    
Severity: Normal CC: webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=230613

Description Kimmo Kinnunen 2021-09-22 06:28:44 PDT
MediaStream canvas.captureStream() for Canvas element provides frames too late

To observe, obtain bug 230613 testcase mediastream-canvas-to-video.html

When canvas draws, the frame should go to the video.
Instead it doesn't go anywhere.
When the canvas draws a new frame, previous frame goes to video.
Comment 1 Radar WebKit Bug Importer 2021-09-29 06:29:18 PDT
<rdar://problem/83668648>
Comment 2 Kimmo Kinnunen 2021-10-01 02:56:43 PDT
Will be fixed by bug 231022

*** This bug has been marked as a duplicate of bug 231022 ***
Comment 3 Kimmo Kinnunen 2021-10-01 03:12:59 PDT
Scratch that, probably too risky. Should fix it separately
Comment 4 Kimmo Kinnunen 2021-10-01 03:25:32 PDT
The frame should be captured and provided to video element during canvas display buffer preparation. However, at that moment the tree is already laid out. Submitting a frame will cause needs-layout assertion.