From 8253e50e9c9a7ff2557e39e7dfd4286486d8c03d Mon Sep 17 00:00:00 2001 From: Andy Locascio Date: Wed, 17 Jan 2018 14:34:36 -0800 Subject: [PATCH] use same settings for screen thumbnails as chrome does webrtc capturing Following along from http://crrev.com/2961193002: make sure the thumbnail capturers initialize with the same settings as the capturer from a getUserMedia request does. Otherwise, there is no guarentee that the sources on Windows will match. --- atom/browser/api/atom_api_desktop_capturer.cc | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/atom/browser/api/atom_api_desktop_capturer.cc b/atom/browser/api/atom_api_desktop_capturer.cc index 79feb7520b0d..f5eca03fd531 100644 --- a/atom/browser/api/atom_api_desktop_capturer.cc +++ b/atom/browser/api/atom_api_desktop_capturer.cc @@ -13,6 +13,7 @@ using base::PlatformThreadRef; #include "native_mate/dictionary.h" #include "third_party/webrtc/modules/desktop_capture/desktop_capture_options.h" #include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h" +#include "content/public/browser/desktop_capture.h" #include "atom/common/node_includes.h" @@ -49,18 +50,7 @@ DesktopCapturer::~DesktopCapturer() { void DesktopCapturer::StartHandling(bool capture_window, bool capture_screen, const gfx::Size& thumbnail_size) { - webrtc::DesktopCaptureOptions options = - webrtc::DesktopCaptureOptions::CreateDefault(); - -#if defined(OS_WIN) - // On windows, desktop effects (e.g. Aero) will be disabled when the Desktop - // capture API is active by default. - // We keep the desktop effects in most times. Howerver, the screen still - // fickers when the API is capturing the window due to limitation of current - // implemetation. This is a known and wontFix issue in webrtc (see: - // http://code.google.com/p/webrtc/issues/detail?id=3373) - options.set_disable_effects(false); -#endif + webrtc::DesktopCaptureOptions options = content::CreateDesktopCaptureOptions(); std::unique_ptr screen_capturer( capture_screen ? webrtc::DesktopCapturer::CreateScreenCapturer(options)