Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 76398a9a4508d5b249c6544c5c79fcc6824b43e3
https://github.com/WebKit/WebKit/commit/76398a9a4508d5b249c6544c5c79fcc6824b43e3
Author: Youenn Fablet <[email protected]>
Date: 2024-10-09 (Wed, 09 Oct 2024)
Changed paths:
M Source/WebCore/platform/mediastream/mac/ScreenCaptureKitCaptureSource.h
M Source/WebCore/platform/mediastream/mac/ScreenCaptureKitCaptureSource.mm
Log Message:
-----------
Regression (284080@main): ScreenCaptureKitCaptureSource may fail capture due
to the whenReady callback being called before totally stopping capture
https://bugs.webkit.org/show_bug.cgi?id=280964
rdar://problem/137414283
Reviewed by Jean-Yves Avenard.
284080@main added a way to get the initial capture size by starting the
capture, getting a first frame and stopping the capture.
Once stopping the capture, the source is said to be ready and we synchronously
send an IPC message to WebProcess.
WebProcess will then send back an IPC message to start the capture.
The issue is that stopping the capture is asynchronous.
Stopping the capture after the first frame might not be finished when receiving
the IPC message to restart capture.
If that is the case, stopping the capture will fail, which fails the whole
capture.
To prevent this race before the WebProcess IPC message and stopping the
capture, we wait for stopping the capture to finish before stating that the
source is ready.
Manually tested as there is no ScreenCaptureKitCaptureSource mock.
* Source/WebCore/platform/mediastream/mac/ScreenCaptureKitCaptureSource.h:
* Source/WebCore/platform/mediastream/mac/ScreenCaptureKitCaptureSource.mm:
(WebCore::ScreenCaptureKitCaptureSource::whenReady):
(WebCore::ScreenCaptureKitCaptureSource::stopInternal):
(WebCore::ScreenCaptureKitCaptureSource::stop): Deleted.
Canonical link: https://commits.webkit.org/284891@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