Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b9174b433c1dac5b08c54d7d8c88476d30ee4e6e
      
https://github.com/WebKit/WebKit/commit/b9174b433c1dac5b08c54d7d8c88476d30ee4e6e
  Author: Youenn Fablet <[email protected]>
  Date:   2025-04-30 (Wed, 30 Apr 2025)

  Changed paths:
    A LayoutTests/fast/mediastream/image-capture-grabFrame-canvas-expected.txt
    A LayoutTests/fast/mediastream/image-capture-grabFrame-canvas.html
    M Source/WebCore/Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp
    M Source/WebCore/Modules/mediastream/CanvasCaptureMediaStreamTrack.h
    M Source/WebCore/Modules/mediastream/ImageCapture.cpp

  Log Message:
  -----------
  ImageCapture.grabFrame should not wait for canvas change
rdar://149857572
https://bugs.webkit.org/show_bug.cgi?id=291957

Reviewed by Jean-Yves Avenard.

The specification is saying to gather data from track and create an ImageBitmap.
For sources which have regular video frames like cameras, our strategy is to 
wait for the next video frame.

For canvas tracks though, there might be no video frames as the canvas might 
not have been changed recently.
We implement a special case for canvas by reusing the way canvas capture 
sources create a VideoFrame.
We then reuse the same conversion to ImageBuffer as other sources.

* LayoutTests/fast/mediastream/image-capture-grabFrame-canvas-expected.txt: 
Added.
* LayoutTests/fast/mediastream/image-capture-grabFrame-canvas.html: Added.
* Source/WebCore/Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
(WebCore::CanvasCaptureMediaStreamTrack::grabFrame):
(WebCore::CanvasCaptureMediaStreamTrack::Source::grabFrame):
(WebCore::CanvasCaptureMediaStreamTrack::Source::captureCanvas):
* Source/WebCore/Modules/mediastream/CanvasCaptureMediaStreamTrack.h:
* Source/WebCore/Modules/mediastream/ImageCapture.cpp:
(WebCore::createImageCaptureException):
(WebCore::createImageBitmapOrException):
(WebCore::ImageCaptureVideoFrameObserver::processVideoFrame):
(WebCore::ImageCapture::grabFrame):

Canonical link: https://commits.webkit.org/294322@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to