Chromium Code Reviews| Index: webrtc/modules/desktop_capture/win/screen_capturer_win_directx.cc |
| diff --git a/webrtc/modules/desktop_capture/win/screen_capturer_win_directx.cc b/webrtc/modules/desktop_capture/win/screen_capturer_win_directx.cc |
| index e4b2c3e8a225b397d4c67693baa646c2c98c34f3..4201fcee3a18abd684e20da7779eec2067c6c416 100644 |
| --- a/webrtc/modules/desktop_capture/win/screen_capturer_win_directx.cc |
| +++ b/webrtc/modules/desktop_capture/win/screen_capturer_win_directx.cc |
| @@ -16,16 +16,31 @@ |
| #include "webrtc/base/logging.h" |
| #include "webrtc/base/timeutils.h" |
| #include "webrtc/modules/desktop_capture/desktop_frame.h" |
| +#include "webrtc/modules/desktop_capture/screen_capturer_differ_wrapper.h" |
| namespace webrtc { |
| using Microsoft::WRL::ComPtr; |
| +// static |
| bool ScreenCapturerWinDirectx::IsSupported() { |
| // Forward IsSupported function call to DxgiDuplicatorController. |
| return DxgiDuplicatorController::Instance()->IsSupported(); |
| } |
| +// static |
| +std::unique_ptr<ScreenCapturer> ScreenCapturerWinDirectx::Create( |
| + const DesktopCaptureOptions& options) { |
| + if (!IsSupported()) { |
| + return std::unique_ptr<ScreenCapturer>(); |
|
Sergey Ulanov
2016/09/07 22:47:23
return nullptr;
|
| + } |
| + |
| + // Windows is known to return larger updated region, so we wrap a |
| + // ScreenCapturerDirectx instance with ScreenCapturerDifferWrapper. |
| + return std::unique_ptr<ScreenCapturer>(new ScreenCapturerDifferWrapper( |
|
Sergey Ulanov
2016/09/07 22:47:23
I think it's better to keep this code in ScreenCap
|
| + std::unique_ptr<ScreenCapturer>(new ScreenCapturerWinDirectx(options)))); |
| +} |
| + |
| ScreenCapturerWinDirectx::ScreenCapturerWinDirectx( |
| const DesktopCaptureOptions& options) |
| : callback_(nullptr) {} |