Chromium Code Reviews| Index: webrtc/modules/desktop_capture/screen_capturer_win.cc |
| diff --git a/webrtc/modules/desktop_capture/screen_capturer_win.cc b/webrtc/modules/desktop_capture/screen_capturer_win.cc |
| index 22113a870df4fa4c54a140801aecf8c694206ecb..8a524647d13bbdc5f1867ecfe7c1f86747c66d52 100644 |
| --- a/webrtc/modules/desktop_capture/screen_capturer_win.cc |
| +++ b/webrtc/modules/desktop_capture/screen_capturer_win.cc |
| @@ -14,6 +14,7 @@ |
| #include <utility> |
| #include "webrtc/modules/desktop_capture/desktop_capture_options.h" |
| +#include "webrtc/modules/desktop_capture/win/screen_capturer_win_directx.h" |
| #include "webrtc/modules/desktop_capture/win/screen_capturer_win_gdi.h" |
| #include "webrtc/modules/desktop_capture/win/screen_capturer_win_magnifier.h" |
| @@ -21,13 +22,17 @@ namespace webrtc { |
| // static |
| ScreenCapturer* ScreenCapturer::Create(const DesktopCaptureOptions& options) { |
| - std::unique_ptr<ScreenCapturer> gdi_capturer( |
| - new ScreenCapturerWinGdi(options)); |
| + std::unique_ptr<ScreenCapturer> capturer; |
| + if (ScreenCapturerWinDirectX::Initialize()) { |
|
Sergey Ulanov
2016/03/31 18:41:15
I think until we know that the new capturer works
Hzj_jie
2016/04/05 23:15:17
Done.
|
| + capturer.reset(new ScreenCapturerWinDirectX(options)); |
| + } else { |
| + capturer.reset(new ScreenCapturerWinGdi(options)); |
| + } |
| if (options.allow_use_magnification_api()) |
| - return new ScreenCapturerWinMagnifier(std::move(gdi_capturer)); |
| + return new ScreenCapturerWinMagnifier(std::move(capturer)); |
| - return gdi_capturer.release(); |
| + return capturer.release(); |
| } |
| } // namespace webrtc |