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/screen_capturer_differ_wrapper.h" | |
17 #include "webrtc/modules/desktop_capture/win/screen_capturer_win_directx.h" | 18 #include "webrtc/modules/desktop_capture/win/screen_capturer_win_directx.h" |
18 #include "webrtc/modules/desktop_capture/win/screen_capturer_win_gdi.h" | 19 #include "webrtc/modules/desktop_capture/win/screen_capturer_win_gdi.h" |
19 #include "webrtc/modules/desktop_capture/win/screen_capturer_win_magnifier.h" | 20 #include "webrtc/modules/desktop_capture/win/screen_capturer_win_magnifier.h" |
20 | 21 |
21 namespace webrtc { | 22 namespace webrtc { |
22 | 23 |
23 // static | 24 // static |
24 ScreenCapturer* ScreenCapturer::Create(const DesktopCaptureOptions& options) { | 25 ScreenCapturer* ScreenCapturer::Create(const DesktopCaptureOptions& options) { |
25 std::unique_ptr<ScreenCapturer> capturer; | 26 std::unique_ptr<ScreenCapturer> capturer; |
26 if (options.allow_directx_capturer() && | 27 if (options.allow_directx_capturer()) { |
Sergey Ulanov
2016/09/09 17:33:51
Do you still need to check IsSupported() here?
Hzj_jie
2016/09/14 19:35:31
Oh, yes, I still need to check IsSupport here.
Th
| |
27 ScreenCapturerWinDirectx::IsSupported()) { | |
28 capturer.reset(new ScreenCapturerWinDirectx(options)); | 28 capturer.reset(new ScreenCapturerWinDirectx(options)); |
29 } else { | 29 } |
30 if (!capturer) { | |
Sergey Ulanov
2016/09/09 17:33:51
else is still appropriate here.
Hzj_jie
2016/09/14 19:35:31
Done.
| |
30 capturer.reset(new ScreenCapturerWinGdi(options)); | 31 capturer.reset(new ScreenCapturerWinGdi(options)); |
31 } | 32 } |
33 if (options.allow_use_magnification_api()) { | |
34 capturer.reset(new ScreenCapturerWinMagnifier(std::move(capturer))); | |
35 } | |
32 | 36 |
33 if (options.allow_use_magnification_api()) | 37 if (options.detect_updated_region()) { |
34 return new ScreenCapturerWinMagnifier(std::move(capturer)); | 38 capturer.reset(new ScreenCapturerDifferWrapper(std::move(capturer))); |
39 } | |
35 | 40 |
36 return capturer.release(); | 41 return capturer.release(); |
37 } | 42 } |
38 | 43 |
39 } // namespace webrtc | 44 } // namespace webrtc |
OLD | NEW |