Title: [245216] trunk/Source/WebCore
Revision
245216
Author
[email protected]
Date
2019-05-12 19:56:13 -0700 (Sun, 12 May 2019)

Log Message

Use the main screen for screen capture
https://bugs.webkit.org/show_bug.cgi?id=197804
<rdar://problem/47671383>

Reviewed by Eric Carlson.

If the main screen, i.e. the screen that has focus at the time of
selection of the screen to capture, is capturable, add it to the list
of screen devices, but do not add any other screen.
This will make sure the main screen is selected.
Manually tested.

* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
(WebCore::ScreenDisplayCaptureSourceMac::screenCaptureDevices):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (245215 => 245216)


--- trunk/Source/WebCore/ChangeLog	2019-05-12 23:05:20 UTC (rev 245215)
+++ trunk/Source/WebCore/ChangeLog	2019-05-13 02:56:13 UTC (rev 245216)
@@ -1,3 +1,20 @@
+2019-05-12  Youenn Fablet  <[email protected]>
+
+        Use the main screen for screen capture
+        https://bugs.webkit.org/show_bug.cgi?id=197804
+        <rdar://problem/47671383>
+
+        Reviewed by Eric Carlson.
+
+        If the main screen, i.e. the screen that has focus at the time of
+        selection of the screen to capture, is capturable, add it to the list
+        of screen devices, but do not add any other screen.
+        This will make sure the main screen is selected.
+        Manually tested.
+
+        * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
+        (WebCore::ScreenDisplayCaptureSourceMac::screenCaptureDevices):
+
 2019-05-12  Takashi Komori  <[email protected]>
 
         [Curl] Suppress extra didReceiveAuthenticationChallenge call when accessing a server which checks basic auth.

Modified: trunk/Source/WebCore/platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm (245215 => 245216)


--- trunk/Source/WebCore/platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm	2019-05-12 23:05:20 UTC (rev 245215)
+++ trunk/Source/WebCore/platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm	2019-05-13 02:56:13 UTC (rev 245216)
@@ -35,6 +35,7 @@
 #include "MediaSampleAVFObjC.h"
 #include "NotImplemented.h"
 #include "PlatformLayer.h"
+#include "PlatformScreen.h"
 #include "RealtimeMediaSourceSettings.h"
 #include "RealtimeVideoUtilities.h"
 
@@ -303,6 +304,14 @@
 
 void ScreenDisplayCaptureSourceMac::screenCaptureDevices(Vector<CaptureDevice>& displays)
 {
+    auto screenID = displayID([NSScreen mainScreen]);
+    if (CGDisplayIDToOpenGLDisplayMask(screenID)) {
+        CaptureDevice displayDevice(String::number(screenID), CaptureDevice::DeviceType::Screen, makeString("Screen 0"));
+        displayDevice.setEnabled(true);
+        displays.append(WTFMove(displayDevice));
+        return;
+    }
+
     uint32_t displayCount = 0;
     auto err = CGGetActiveDisplayList(0, nullptr, &displayCount);
     if (err) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to