Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 #include "webrtc/modules/desktop_capture/screen_capturer.h" | 11 #include "webrtc/modules/desktop_capture/screen_capturer.h" |
| 12 | 12 |
| 13 #include <memory> | 13 #include <memory> |
| 14 #include <utility> | 14 #include <utility> |
| 15 | 15 |
| 16 #include "webrtc/modules/desktop_capture/desktop_capture_options.h" | 16 #include "webrtc/modules/desktop_capture/desktop_capture_options.h" |
| 17 #include "webrtc/modules/desktop_capture/win/screen_capturer_win_directx.h" | |
| 17 #include "webrtc/modules/desktop_capture/win/screen_capturer_win_gdi.h" | 18 #include "webrtc/modules/desktop_capture/win/screen_capturer_win_gdi.h" |
| 18 #include "webrtc/modules/desktop_capture/win/screen_capturer_win_magnifier.h" | 19 #include "webrtc/modules/desktop_capture/win/screen_capturer_win_magnifier.h" |
| 19 | 20 |
| 20 namespace webrtc { | 21 namespace webrtc { |
| 21 | 22 |
| 22 // static | 23 // static |
| 23 ScreenCapturer* ScreenCapturer::Create(const DesktopCaptureOptions& options) { | 24 ScreenCapturer* ScreenCapturer::Create(const DesktopCaptureOptions& options) { |
| 24 std::unique_ptr<ScreenCapturer> gdi_capturer( | 25 std::unique_ptr<ScreenCapturer> capturer; |
| 25 new ScreenCapturerWinGdi(options)); | 26 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.
| |
| 27 capturer.reset(new ScreenCapturerWinDirectX(options)); | |
| 28 } else { | |
| 29 capturer.reset(new ScreenCapturerWinGdi(options)); | |
| 30 } | |
| 26 | 31 |
| 27 if (options.allow_use_magnification_api()) | 32 if (options.allow_use_magnification_api()) |
| 28 return new ScreenCapturerWinMagnifier(std::move(gdi_capturer)); | 33 return new ScreenCapturerWinMagnifier(std::move(capturer)); |
| 29 | 34 |
| 30 return gdi_capturer.release(); | 35 return capturer.release(); |
| 31 } | 36 } |
| 32 | 37 |
| 33 } // namespace webrtc | 38 } // namespace webrtc |
| OLD | NEW |