Changeset 245216 in webkit


Ignore:
Timestamp:
May 12, 2019 7:56:13 PM (5 years ago)
Author:
youenn@apple.com
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):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r245215 r245216  
     12019-05-12  Youenn Fablet  <youenn@apple.com>
     2
     3        Use the main screen for screen capture
     4        https://bugs.webkit.org/show_bug.cgi?id=197804
     5        <rdar://problem/47671383>
     6
     7        Reviewed by Eric Carlson.
     8
     9        If the main screen, i.e. the screen that has focus at the time of
     10        selection of the screen to capture, is capturable, add it to the list
     11        of screen devices, but do not add any other screen.
     12        This will make sure the main screen is selected.
     13        Manually tested.
     14
     15        * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
     16        (WebCore::ScreenDisplayCaptureSourceMac::screenCaptureDevices):
     17
    1182019-05-12  Takashi Komori  <Takashi.Komori@sony.com>
    219
  • trunk/Source/WebCore/platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm

    r243033 r245216  
    3636#include "NotImplemented.h"
    3737#include "PlatformLayer.h"
     38#include "PlatformScreen.h"
    3839#include "RealtimeMediaSourceSettings.h"
    3940#include "RealtimeVideoUtilities.h"
     
    304305void ScreenDisplayCaptureSourceMac::screenCaptureDevices(Vector<CaptureDevice>& displays)
    305306{
     307    auto screenID = displayID([NSScreen mainScreen]);
     308    if (CGDisplayIDToOpenGLDisplayMask(screenID)) {
     309        CaptureDevice displayDevice(String::number(screenID), CaptureDevice::DeviceType::Screen, makeString("Screen 0"));
     310        displayDevice.setEnabled(true);
     311        displays.append(WTFMove(displayDevice));
     312        return;
     313    }
     314
    306315    uint32_t displayCount = 0;
    307316    auto err = CGGetActiveDisplayList(0, nullptr, &displayCount);
Note: See TracChangeset for help on using the changeset viewer.