Bug 1915562 - For the SCK backend, Add a pref to allow enumerating displays with the CG backend. r=padenot

Differential Revision: https://phabricator.services.mozilla.com/D220565
This commit is contained in:
Andreas Pehrson 2024-08-29 14:04:30 +00:00
parent 4b478f1f10
commit ebbda8290c
2 changed files with 19 additions and 2 deletions

View File

@ -112,8 +112,15 @@ std::shared_ptr<VideoCaptureModule::DeviceInfo>
DesktopCaptureImpl::CreateDeviceInfo(const int32_t aId,
const CaptureDeviceType aType) {
if (aType == CaptureDeviceType::Screen) {
return CreateDesktopDeviceInfo(
aId, CreateScreenCaptureInfo(CreateDesktopCaptureOptions()));
auto options = CreateDesktopCaptureOptions();
#ifdef XP_MACOSX
options.set_allow_sck_capturer(
mozilla::StaticPrefs::
media_getdisplaymedia_screencapturekit_enabled_AtStartup() &&
mozilla::StaticPrefs::
media_getdisplaymedia_screencapturekit_enumeration_enabled_AtStartup());
#endif
return CreateDesktopDeviceInfo(aId, CreateScreenCaptureInfo(options));
}
if (aType == CaptureDeviceType::Window) {
return CreateDesktopDeviceInfo(

View File

@ -11389,6 +11389,16 @@
type: bool
value: false
mirror: once
# Use the libwebrtc ScreenCaptureKit desktop capture backend on Mac for screen
# enumeration when enabled.
# When this is false and the backend is used (see above), the older CoreGraphics
# backend is used to enumerate CGDirectDisplayIDs, which the ScreenCaptureKit
# backend understand as well.
- name: media.getdisplaymedia.screencapturekit.enumeration.enabled
type: bool
value: false
mirror: once
#endif
# Turn off any cameras (but not mics) while in the background. This is desirable