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 <memory> | 11 #include <memory> |
12 #include <utility> | 12 #include <utility> |
13 | 13 |
| 14 #include "webrtc/modules/desktop_capture/blank_detector_desktop_capturer_wrapper
.h" |
14 #include "webrtc/modules/desktop_capture/desktop_capturer.h" | 15 #include "webrtc/modules/desktop_capture/desktop_capturer.h" |
15 #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/fallback_desktop_capturer_wrapper.h" |
| 18 #include "webrtc/modules/desktop_capture/rgba_color.h" |
16 #include "webrtc/modules/desktop_capture/win/screen_capturer_win_directx.h" | 19 #include "webrtc/modules/desktop_capture/win/screen_capturer_win_directx.h" |
17 #include "webrtc/modules/desktop_capture/win/screen_capturer_win_gdi.h" | 20 #include "webrtc/modules/desktop_capture/win/screen_capturer_win_gdi.h" |
18 #include "webrtc/modules/desktop_capture/win/screen_capturer_win_magnifier.h" | 21 #include "webrtc/modules/desktop_capture/win/screen_capturer_win_magnifier.h" |
19 | 22 |
20 namespace webrtc { | 23 namespace webrtc { |
21 | 24 |
| 25 namespace { |
| 26 |
| 27 std::unique_ptr<DesktopCapturer> CreateScreenCapturerWinDirectx( |
| 28 const DesktopCaptureOptions& options) { |
| 29 std::unique_ptr<DesktopCapturer> capturer( |
| 30 new ScreenCapturerWinDirectx(options)); |
| 31 capturer.reset(new BlankDetectorDesktopCapturerWrapper( |
| 32 std::move(capturer), RgbaColor(0, 0, 0, 0), -1)); |
| 33 return capturer; |
| 34 } |
| 35 |
| 36 } // namespace |
| 37 |
22 // static | 38 // static |
23 std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateRawScreenCapturer( | 39 std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateRawScreenCapturer( |
24 const DesktopCaptureOptions& options) { | 40 const DesktopCaptureOptions& options) { |
25 std::unique_ptr<DesktopCapturer> capturer; | 41 std::unique_ptr<DesktopCapturer> capturer(new ScreenCapturerWinGdi(options)); |
26 if (options.allow_directx_capturer() && | 42 if (options.allow_directx_capturer() && |
27 ScreenCapturerWinDirectx::IsSupported()) { | 43 ScreenCapturerWinDirectx::IsSupported()) { |
28 capturer.reset(new ScreenCapturerWinDirectx(options)); | 44 capturer.reset(new FallbackDesktopCapturerWrapper( |
29 } else { | 45 CreateScreenCapturerWinDirectx(options), std::move(capturer))); |
30 capturer.reset(new ScreenCapturerWinGdi(options)); | |
31 } | 46 } |
32 | 47 |
33 if (options.allow_use_magnification_api()) { | 48 if (options.allow_use_magnification_api()) { |
34 capturer.reset(new ScreenCapturerWinMagnifier(std::move(capturer))); | 49 capturer.reset(new ScreenCapturerWinMagnifier(std::move(capturer))); |
35 } | 50 } |
36 | 51 |
37 return capturer; | 52 return capturer; |
38 } | 53 } |
39 | 54 |
40 } // namespace webrtc | 55 } // namespace webrtc |
OLD | NEW |