Do not use Magnifier if there are multiple screens since it sometimes crashes.

BUG=crbug/478825
R=sergeyu@chromium.org

Review URL: https://webrtc-codereview.appspot.com/43289004

Cr-Commit-Position: refs/heads/master@{#9082}
This commit is contained in:
Jiayang Liu 2015-04-24 08:46:35 -07:00
parent 77d444a433
commit 12e0329007
2 changed files with 3 additions and 13 deletions

View File

@ -109,9 +109,9 @@ void ScreenCapturerWinMagnifier::Capture(const DesktopRegion& region) {
bool succeeded = false;
// Do not try to use the magnfiier if it's capturing non-primary screen, or it
// failed before.
if (magnifier_initialized_ && IsCapturingPrimaryScreenOnly() &&
// Do not try to use the magnifier if it failed before and in multi-screen
// setup (where the API crashes sometimes).
if (magnifier_initialized_ && (GetSystemMetrics(SM_CMONITORS) == 1) &&
magnifier_capture_succeeded_) {
DesktopRect rect = GetScreenRect(current_screen_id_, current_device_key_);
CreateCurrentFrameIfNecessary(rect.size());
@ -436,13 +436,6 @@ void ScreenCapturerWinMagnifier::CreateCurrentFrameIfNecessary(
}
}
bool ScreenCapturerWinMagnifier::IsCapturingPrimaryScreenOnly() const {
if (current_screen_id_ != kFullDesktopScreenId)
return current_screen_id_ == 0; // the primary screen is always '0'.
return GetSystemMetrics(SM_CMONITORS) == 1;
}
void ScreenCapturerWinMagnifier::StartFallbackCapturer() {
assert(fallback_capturer_);
if (!fallback_capturer_started_) {

View File

@ -96,9 +96,6 @@ class ScreenCapturerWinMagnifier : public ScreenCapturer {
// Makes sure the current frame exists and matches |size|.
void CreateCurrentFrameIfNecessary(const DesktopSize& size);
// Returns true if we are capturing the primary screen only.
bool IsCapturingPrimaryScreenOnly() const;
// Start the fallback capturer and select the screen.
void StartFallbackCapturer();