-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Cocoa] Use new screen/window picker API when available #9789
[Cocoa] Use new screen/window picker API when available #9789
Conversation
EWS run on previous version of this PR (hash 6e7c917) |
6e7c917
to
f8837f9
Compare
EWS run on previous version of this PR (hash f8837f9) |
f8837f9
to
74eff18
Compare
EWS run on previous version of this PR (hash 74eff18) |
74eff18
to
d52283d
Compare
EWS run on previous version of this PR (hash d52283d) |
d52283d
to
b88334d
Compare
EWS run on previous version of this PR (hash b88334d) |
b88334d
to
309c521
Compare
309c521
to
5638682
Compare
EWS run on previous version of this PR (hash 5638682)
|
5638682
to
14e91b9
Compare
EWS run on previous version of this PR (hash 14e91b9)
|
14e91b9
to
40f5b24
Compare
EWS run on previous version of this PR (hash 40f5b24)
|
{ | ||
ASSERT(isMainThread()); | ||
ASSERT(sampleBuffer); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should avoid going through main thread at some point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, lets do that in a followup.
Source/WebCore/platform/mediastream/mac/ScreenCaptureKitSharingSessionManager.mm
Outdated
Show resolved
Hide resolved
Source/WebCore/platform/mediastream/mac/ScreenCaptureKitCaptureSource.h
Outdated
Show resolved
Hide resolved
if (!strongSelf->_callback) | ||
ASSERT(type == SCStreamOutputTypeScreen); | ||
|
||
if (!sampleBuffer) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In which case can sampleBuffer be null?
Source/WebCore/platform/mediastream/mac/ScreenCaptureKitSharingSessionManager.mm
Show resolved
Hide resolved
Source/WebCore/platform/mediastream/mac/ScreenCaptureKitSharingSessionManager.mm
Outdated
Show resolved
Hide resolved
Source/WebCore/platform/mediastream/mac/ScreenCaptureKitSharingSessionManager.mm
Outdated
Show resolved
Hide resolved
{ | ||
sendWithAsyncReply(Messages::GPUProcess::ShowScreenPicker { }, WTFMove(completionHandler)); | ||
sendWithAsyncReply(Messages::GPUProcess::PromptForGetDisplayMedia { type }, WTFMove(completionHandler)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we pass m_useSCContentSharingPicker here instead of the separate IPC?
40f5b24
to
bcedbec
Compare
EWS run on previous version of this PR (hash bcedbec)
|
bcedbec
to
60c27b8
Compare
EWS run on previous version of this PR (hash 60c27b8)
|
60c27b8
to
1034d18
Compare
EWS run on previous version of this PR (hash 1034d18)
|
1034d18
to
62c864b
Compare
EWS run on previous version of this PR (hash 62c864b)
|
62c864b
to
876e55a
Compare
EWS run on previous version of this PR (hash 876e55a)
|
876e55a
to
5eb4f73
Compare
EWS run on previous version of this PR (hash 5eb4f73)
|
5eb4f73
to
e37c1d9
Compare
EWS run on current version of this PR (hash e37c1d9)
|
https://bugs.webkit.org/show_bug.cgi?id=251893 rdar://101206117 Reviewed by Jer Noble. * Source/WebCore/Headers.cmake: Add DisplayCapturePromptType.h. * Source/WebCore/WebCore.xcodeproj/project.pbxproj: Ditto. * Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml: SC_CONTENT_SHARING_SESSION -> SCREEN_CAPTURE_KIT. Add new runtime preference. * Source/WTF/wtf/PlatformHave.h: Remove HAVE_SC_CONTENT_SHARING_SESSION. * Source/WebCore/PAL/pal/mac/ScreenCaptureKitSoftLink.h:SCStreamFrameInfoStatus is always available when ScreenCaptureKit is available. * Source/WebCore/PAL/pal/mac/ScreenCaptureKitSoftLink.mm: * Source/WebCore/PAL/pal/spi/mac/ScreenCaptureKitSPI.h: * Source/WebKit/Shared/Cocoa/WebPreferencesDefaultValuesCocoa.mm: (WebKit::defaultUseSCContentSharingPicker): Initialize to feature flag value. * Source/WebKit/Shared/WebPreferencesDefaultValues.h: * Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp: (WebCore::PlatformMediaSessionManager::setUseSCContentSharingPicker): New preference access. (WebCore::PlatformMediaSessionManager::useSCContentSharingPicker): * Source/WebCore/platform/audio/PlatformMediaSessionManager.h: * Source/WebCore/platform/mediastream/mac/ScreenCaptureKitCaptureSource.h: * Source/WebCore/platform/mediastream/mac/ScreenCaptureKitCaptureSource.mm: Rewrite to not be a direct `SCContentSharingSession` delegate and to not create `SCContentStream` directly, but to do both through the ScreenCaptureKitSharingSessionManager.h. (-[WebCoreScreenCaptureKitHelper stream:didStopWithError:]): (-[WebCoreScreenCaptureKitHelper stream:didOutputSampleBuffer:ofType:]): (WebCore::ScreenCaptureKitCaptureSource::~ScreenCaptureKitCaptureSource): (WebCore::ScreenCaptureKitCaptureSource::stop): (WebCore::ScreenCaptureKitCaptureSource::sessionFailedWithError): (WebCore::ScreenCaptureKitCaptureSource::sessionFilterDidChange): (WebCore::ScreenCaptureKitCaptureSource::sessionStreamDidEnd): (WebCore::ScreenCaptureKitCaptureSource::startContentStream): (WebCore::ScreenCaptureKitCaptureSource::updateStreamConfiguration): (WebCore::ScreenCaptureKitCaptureSource::commitConfiguration): (WebCore::ScreenCaptureKitCaptureSource::streamDidOutputVideoSampleBuffer): (-[WebCoreScreenCaptureKitHelper sessionDidEnd:]): Deleted. (-[WebCoreScreenCaptureKitHelper sessionDidChangeContent:]): Deleted. (-[WebCoreScreenCaptureKitHelper pickerCanceledForSession:]): Deleted. (WebCore::ScreenCaptureKitCaptureSource::streamFailedWithError): Deleted. (WebCore::ScreenCaptureKitCaptureSource::sessionDidChangeContent): Deleted. (WebCore::ScreenCaptureKitCaptureSource::sessionDidEnd): Deleted. (WebCore::findSharableDevice): Deleted. (WebCore::ScreenCaptureKitCaptureSource::findShareableContent): Deleted. (WebCore::ScreenCaptureKitCaptureSource::frameAvailableHandler): Deleted. (WebCore::ScreenCaptureKitCaptureSource::streamDidOutputSampleBuffer): Deleted. * Source/WebCore/platform/mediastream/mac/ScreenCaptureKitSharingSessionManager.h: (WebCore::ScreenCaptureSessionSource::stream const): (WebCore::ScreenCaptureSessionSource::contentFilter const): (WebCore::ScreenCaptureSessionSource::sharingSession const): (WebCore::ScreenCaptureSessionSource::observer const): * Source/WebCore/platform/mediastream/mac/ScreenCaptureKitSharingSessionManager.mm: Don't pass ownership of `SCContentSharingSession` to ScreenCaptureSessionSource, instead pass necessary information through ScreenCaptureSessionSource interface to source. (-[WebDisplayMediaPromptHelper initWithCallback:]): (-[WebDisplayMediaPromptHelper sessionDidEnd:]): (-[WebDisplayMediaPromptHelper sessionDidChangeContent:]): (-[WebDisplayMediaPromptHelper pickerCanceledForSession:]): (-[WebDisplayMediaPromptHelper contentSharingPicker:didSelectFilter:forStream:]): (-[WebDisplayMediaPromptHelper contentSharingPickerDidCancel:forStream:]): (-[WebDisplayMediaPromptHelper contentSharingPickerStartDidFailWithError:]): (-[WebDisplayMediaPromptHelper contentSharingPicker:didRequestNewStreamWithFilter:]): (-[WebDisplayMediaPromptHelper contentSharingPicker:didRequestUpdateWithFilter:forStream:]): (WebCore::ScreenCaptureKitSharingSessionManager::isAvailable): (WebCore::ScreenCaptureKitSharingSessionManager::useSCContentSharingPicker): (WebCore::ScreenCaptureKitSharingSessionManager::~ScreenCaptureKitSharingSessionManager): (WebCore::ScreenCaptureKitSharingSessionManager::cancelPicking): (WebCore::ScreenCaptureKitSharingSessionManager::completeDeviceSelection): (WebCore::ScreenCaptureKitSharingSessionManager::findActiveSource): (WebCore::ScreenCaptureKitSharingSessionManager::sharingSessionDidEnd): (WebCore::ScreenCaptureKitSharingSessionManager::sharingSessionDidChangeContent): (WebCore::ScreenCaptureKitSharingSessionManager::contentSharingPickerSelectedFilterForStream): (WebCore::ScreenCaptureKitSharingSessionManager::contentSharingPickerUpdatedFilterForStream): (WebCore::ScreenCaptureKitSharingSessionManager::promptForGetDisplayMedia): (WebCore::ScreenCaptureKitSharingSessionManager::promptWithSCContentSharingSession): (WebCore::ScreenCaptureKitSharingSessionManager::promptWithSCContentSharingPicker): (WebCore::ScreenCaptureKitSharingSessionManager::contentSharingPickerFailedWithError): (WebCore::operator==): (WebCore::ScreenCaptureKitSharingSessionManager::createSessionSourceForDevice): (WebCore::ScreenCaptureKitSharingSessionManager::cleanupSessionSource): (WebCore::ScreenCaptureSessionSource::create): (WebCore::ScreenCaptureSessionSource::ScreenCaptureSessionSource): (WebCore::ScreenCaptureSessionSource::~ScreenCaptureSessionSource): (WebCore::ScreenCaptureSessionSource::operator== const): (WebCore::screenCaptureKitPickerFeatureEnabled): Deleted. (WebCore::ScreenCaptureKitSharingSessionManager::pickerCanceledForSession): Deleted. (WebCore::ScreenCaptureKitSharingSessionManager::sessionDidEnd): Deleted. (WebCore::ScreenCaptureKitSharingSessionManager::sessionDidChangeContent): Deleted. (WebCore::ScreenCaptureKitSharingSessionManager::showWindowPicker): Deleted. (WebCore::ScreenCaptureKitSharingSessionManager::showScreenPicker): Deleted. (WebCore::ScreenCaptureKitSharingSessionManager::takeSharingSessionForFilter): Deleted. * Source/WebKit/GPUProcess/GPUProcess.cpp: (WebKit::GPUProcess::promptForGetDisplayMedia): Combine showWindowPicker and showScreenPicker. (WebKit::GPUProcess::showWindowPicker): Deleted. (WebKit::GPUProcess::showScreenPicker): Deleted. * Source/WebKit/GPUProcess/GPUProcess.h: * Source/WebKit/GPUProcess/GPUProcess.messages.in: * Source/WebKit/GPUProcess/mac/com.apple.WebKit.GPUProcess.sb.in: * Source/WebKit/UIProcess/Cocoa/UIDelegate.mm: (WebKit::UIDelegate::UIClient::promptForDisplayCapturePermission): Cleanup and simplify. (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest): * Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm: SC_CONTENT_SHARING_SESSION -> SCREEN_CAPTURE_KIT * Source/WebKit/UIProcess/GPU/GPUProcessProxy.cpp: (WebKit::GPUProcessProxy::updateSandboxAccess): Ditto. (WebKit::GPUProcessProxy::promptForGetDisplayMedia): (WebKit::GPUProcessProxy::showWindowPicker): Deleted. (WebKit::GPUProcessProxy::showScreenPicker): Deleted. * Source/WebKit/UIProcess/GPU/GPUProcessProxy.h: * Source/WebKit/UIProcess/UserMediaPermissionRequestProxy.cpp: (WebKit::UserMediaPermissionRequestProxy::promptForGetDisplayMedia): canPromptForGetDisplayMedia -> canRequestDisplayCapturePermission. (WebKit::UserMediaPermissionRequestProxy::doDefaultAction): (WebKit::UserMediaPermissionRequestProxy::canRequestDisplayCapturePermission): Rename from canPromptForGetDisplayMedia. (WebKit::UserMediaPermissionRequestProxy::canPromptForGetDisplayMedia): Deleted. * Source/WebKit/UIProcess/UserMediaPermissionRequestProxy.h: * Source/WebKit/UIProcess/WebPageProxy.cpp: * Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivateForTesting.h: * Source/WebKit/UIProcess/API/Cocoa/WKWebViewTesting.mm: (-[WKWebView _setSystemCanPromptForGetDisplayMediaForTesting:]): Simulate when system can and can not prompt for type of display capture. * Source/WebKit/UIProcess/mac/DisplayCaptureSessionManager.h: * Source/WebKit/UIProcess/mac/DisplayCaptureSessionManager.mm: (WebKit::DisplayCaptureSessionManager::showWindowPicker): (WebKit::DisplayCaptureSessionManager::showScreenPicker): (WebKit::DisplayCaptureSessionManager::canRequestDisplayCapturePermission): (WebKit::toScreenCaptureKitPromptType): (WebKit::DisplayCaptureSessionManager::promptForGetDisplayMedia): * Source/WebKit/UIProcess/mac/UserMediaPermissionRequestProxyMac.h: * Source/WebKit/UIProcess/mac/UserMediaPermissionRequestProxyMac.mm: (WebKit::UserMediaPermissionRequestProxyMac::promptForGetDisplayMedia): (WebKit::UserMediaPermissionRequestProxyMac::canRequestDisplayCapturePermission): (WebKit::UserMediaPermissionRequestProxyMac::canPromptForGetDisplayMedia): Deleted. * Source/WebKit/WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::updatePreferences): * Tools/TestWebKitAPI/Tests/WebKitCocoa/GetDisplayMedia.mm: Test when system can and can not prompt for type of capture. (-[GetDisplayMediaUIDelegate _webView:requestDisplayCapturePermissionForOrigin:initiatedByFrame:withSystemAudio:decisionHandler:]): (TestWebKitAPI::GetDisplayMediaTest::promptForCapture): (TestWebKitAPI::TEST_F): (-[GetDisplayMediaUIDelegate _webView:requestUserMediaAuthorizationForDevices:url:mainFrameURL:decisionHandler:]): Deleted. Canonical link: https://commits.webkit.org/261180@main
e37c1d9
to
fe99ba1
Compare
Committed 261180@main (fe99ba1): https://commits.webkit.org/261180@main Reviewed commits have been landed. Closing PR #9789 and removing active labels. |
fe99ba1
e37c1d9
π macπ wpeπ wincairoπ§ͺ wpe-wk2π§ͺ ios-wk2π§ͺ api-macπ§ͺ api-iosπ§ͺ mac-wk1π§ͺ gtk-wk2π π§ͺ jscπ tvπ§ͺ mac-wk2π§ͺ api-gtkπ tv-simπ§ͺ mac-AS-debug-wk2π§ͺ mac-wk2-stressπ π§ͺ mergeπ watch-sim