Index: webrtc/modules/desktop_capture/win/screen_capturer_win_magnifier.cc |
diff --git a/webrtc/modules/desktop_capture/win/screen_capturer_win_magnifier.cc b/webrtc/modules/desktop_capture/win/screen_capturer_win_magnifier.cc |
index 2a686c4384c65581be035130b21938efb3eb8b1e..20e2bde1a994814a3f98bb415d3c6157218318bf 100644 |
--- a/webrtc/modules/desktop_capture/win/screen_capturer_win_magnifier.cc |
+++ b/webrtc/modules/desktop_capture/win/screen_capturer_win_magnifier.cc |
@@ -22,7 +22,6 @@ |
#include "webrtc/modules/desktop_capture/win/cursor.h" |
#include "webrtc/modules/desktop_capture/win/desktop.h" |
#include "webrtc/modules/desktop_capture/win/screen_capture_utils.h" |
-#include "webrtc/system_wrappers/include/logging.h" |
namespace webrtc { |
@@ -58,7 +57,6 @@ void ScreenCapturerWinMagnifier::Start(Callback* callback) { |
callback_ = callback; |
if (!InitializeMagnifier()) { |
- LOG_F(LS_WARNING) << "Magnifier initialization failed."; |
} |
} |
@@ -70,7 +68,6 @@ void ScreenCapturerWinMagnifier::SetSharedMemoryFactory( |
void ScreenCapturerWinMagnifier::CaptureFrame() { |
RTC_DCHECK(callback_); |
if (!magnifier_initialized_) { |
- LOG_F(LS_WARNING) << "Magnifier initialization failed."; |
callback_->OnCaptureResult(Result::ERROR_PERMANENT, nullptr); |
return; |
} |
@@ -97,7 +94,6 @@ void ScreenCapturerWinMagnifier::CaptureFrame() { |
// CaptureImage may fail in some situations, e.g. windows8 metro mode. So |
// defer to the fallback capturer if magnifier capturer did not work. |
if (!CaptureImage(rect)) { |
- LOG_F(LS_WARNING) << "Magnifier capturer failed to capture a frame."; |
callback_->OnCaptureResult(Result::ERROR_PERMANENT, nullptr); |
return; |
} |
@@ -142,9 +138,6 @@ bool ScreenCapturerWinMagnifier::CaptureImage(const DesktopRect& rect) { |
BOOL result = SetWindowPos(magnifier_window_, NULL, rect.left(), rect.top(), |
rect.width(), rect.height(), 0); |
if (!result) { |
- LOG_F(LS_WARNING) << "Failed to call SetWindowPos: " << GetLastError() |
- << ". Rect = {" << rect.left() << ", " << rect.top() |
- << ", " << rect.right() << ", " << rect.bottom() << "}"; |
return false; |
} |
@@ -159,9 +152,6 @@ bool ScreenCapturerWinMagnifier::CaptureImage(const DesktopRect& rect) { |
result = set_window_source_func_(magnifier_window_, native_rect); |
if (!result) { |
- LOG_F(LS_WARNING) << "Failed to call MagSetWindowSource: " << GetLastError() |
- << ". Rect = {" << rect.left() << ", " << rect.top() |
- << ", " << rect.right() << ", " << rect.bottom() << "}"; |
return false; |
} |
@@ -196,8 +186,6 @@ bool ScreenCapturerWinMagnifier::InitializeMagnifier() { |
if (GetSystemMetrics(SM_CMONITORS) != 1) { |
// Do not try to use the magnifier in multi-screen setup (where the API |
// crashes sometimes). |
- LOG_F(LS_WARNING) << "Magnifier capturer cannot work on multi-screen " |
- "system."; |
return false; |
} |
@@ -223,15 +211,11 @@ bool ScreenCapturerWinMagnifier::InitializeMagnifier() { |
if (!mag_initialize_func_ || !mag_uninitialize_func_ || |
!set_window_source_func_ || !set_window_filter_list_func_ || |
!set_image_scaling_callback_func_) { |
- LOG_F(LS_WARNING) << "Failed to initialize ScreenCapturerWinMagnifier: " |
- << "library functions missing."; |
return false; |
} |
BOOL result = mag_initialize_func_(); |
if (!result) { |
- LOG_F(LS_WARNING) << "Failed to initialize ScreenCapturerWinMagnifier: " |
- << "error from MagInitialize " << GetLastError(); |
return false; |
} |
@@ -242,8 +226,7 @@ bool ScreenCapturerWinMagnifier::InitializeMagnifier() { |
&hInstance); |
if (!result) { |
mag_uninitialize_func_(); |
- LOG_F(LS_WARNING) << "Failed to initialize ScreenCapturerWinMagnifier: " |
- << "error from GetModulehandleExA " << GetLastError(); |
+ |
return false; |
} |
@@ -265,8 +248,7 @@ bool ScreenCapturerWinMagnifier::InitializeMagnifier() { |
0, 0, 0, nullptr, nullptr, hInstance, nullptr); |
if (!host_window_) { |
mag_uninitialize_func_(); |
- LOG_F(LS_WARNING) << "Failed to initialize ScreenCapturerWinMagnifier: " |
- << "error from creating host window " << GetLastError(); |
+ |
return false; |
} |
@@ -276,9 +258,7 @@ bool ScreenCapturerWinMagnifier::InitializeMagnifier() { |
host_window_, nullptr, hInstance, nullptr); |
if (!magnifier_window_) { |
mag_uninitialize_func_(); |
- LOG_F(LS_WARNING) << "Failed to initialize ScreenCapturerWinMagnifier: " |
- << "error from creating magnifier window " |
- << GetLastError(); |
+ |
return false; |
} |
@@ -291,9 +271,7 @@ bool ScreenCapturerWinMagnifier::InitializeMagnifier() { |
&ScreenCapturerWinMagnifier::OnMagImageScalingCallback); |
if (!result) { |
mag_uninitialize_func_(); |
- LOG_F(LS_WARNING) << "Failed to initialize ScreenCapturerWinMagnifier: " |
- << "error from MagSetImageScalingCallback " |
- << GetLastError(); |
+ |
return false; |
} |
@@ -302,9 +280,7 @@ bool ScreenCapturerWinMagnifier::InitializeMagnifier() { |
magnifier_window_, MW_FILTERMODE_EXCLUDE, 1, &excluded_window_); |
if (!result) { |
mag_uninitialize_func_(); |
- LOG_F(LS_WARNING) << "Failed to initialize ScreenCapturerWinMagnifier: " |
- << "error from MagSetWindowFilterList " |
- << GetLastError(); |
+ |
return false; |
} |
} |
@@ -333,13 +309,7 @@ void ScreenCapturerWinMagnifier::OnCaptured(void* data, |
header.height != static_cast<UINT>(current_frame->size().height()) || |
header.stride != static_cast<UINT>(current_frame->stride()) || |
captured_bytes_per_pixel != DesktopFrame::kBytesPerPixel) { |
- LOG_F(LS_WARNING) << "Output format does not match the captured format: " |
- << "width = " << header.width << ", " |
- << "height = " << header.height << ", " |
- << "stride = " << header.stride << ", " |
- << "bpp = " << captured_bytes_per_pixel << ", " |
- << "pixel format RGBA ? " |
- << (header.format == GUID_WICPixelFormat32bppRGBA) << "."; |
+ |
return; |
} |