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 |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 TestCaptureOneFrame(capturers, drawer.get(), rect, color); | 122 TestCaptureOneFrame(capturers, drawer.get(), rect, color); |
123 } | 123 } |
124 } | 124 } |
125 } | 125 } |
126 | 126 |
127 void TestCaptureUpdatedRegion() { | 127 void TestCaptureUpdatedRegion() { |
128 TestCaptureUpdatedRegion({capturer_.get()}); | 128 TestCaptureUpdatedRegion({capturer_.get()}); |
129 } | 129 } |
130 | 130 |
131 #if defined(WEBRTC_WIN) | 131 #if defined(WEBRTC_WIN) |
| 132 // Enable allow_directx_capturer in DesktopCaptureOptions, but let |
| 133 // ScreenCapturer::Create to decide whether a DirectX capturer should be used. |
| 134 void MaybeCreateDirectxCapturer() { |
| 135 DesktopCaptureOptions options(DesktopCaptureOptions::CreateDefault()); |
| 136 options.set_allow_directx_capturer(true); |
| 137 capturer_.reset(ScreenCapturer::Create(options)); |
| 138 } |
| 139 |
132 bool CreateDirectxCapturer() { | 140 bool CreateDirectxCapturer() { |
133 if (!ScreenCapturerWinDirectx::IsSupported()) { | 141 if (!ScreenCapturerWinDirectx::IsSupported()) { |
134 LOG(LS_WARNING) << "Directx capturer is not supported"; | 142 LOG(LS_WARNING) << "Directx capturer is not supported"; |
135 return false; | 143 return false; |
136 } | 144 } |
137 | 145 |
138 DesktopCaptureOptions options(DesktopCaptureOptions::CreateDefault()); | 146 MaybeCreateDirectxCapturer(); |
139 options.set_allow_directx_capturer(true); | |
140 capturer_.reset(ScreenCapturer::Create(options)); | |
141 return true; | 147 return true; |
142 } | 148 } |
143 | 149 |
144 void CreateMagnifierCapturer() { | 150 void CreateMagnifierCapturer() { |
145 DesktopCaptureOptions options(DesktopCaptureOptions::CreateDefault()); | 151 DesktopCaptureOptions options(DesktopCaptureOptions::CreateDefault()); |
146 options.set_allow_use_magnification_api(true); | 152 options.set_allow_use_magnification_api(true); |
147 capturer_.reset(ScreenCapturer::Create(options)); | 153 capturer_.reset(ScreenCapturer::Create(options)); |
148 } | 154 } |
149 #endif // defined(WEBRTC_WIN) | 155 #endif // defined(WEBRTC_WIN) |
150 | 156 |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 | 381 |
376 // Disabled due to being flaky due to the fact that it useds rendering / UI, | 382 // Disabled due to being flaky due to the fact that it useds rendering / UI, |
377 // see webrtc/6366. | 383 // see webrtc/6366. |
378 TEST_F(ScreenCapturerTest, DISABLED_TwoMagnifierCapturers) { | 384 TEST_F(ScreenCapturerTest, DISABLED_TwoMagnifierCapturers) { |
379 CreateMagnifierCapturer(); | 385 CreateMagnifierCapturer(); |
380 std::unique_ptr<ScreenCapturer> capturer2 = std::move(capturer_); | 386 std::unique_ptr<ScreenCapturer> capturer2 = std::move(capturer_); |
381 CreateMagnifierCapturer(); | 387 CreateMagnifierCapturer(); |
382 TestCaptureUpdatedRegion({capturer_.get(), capturer2.get()}); | 388 TestCaptureUpdatedRegion({capturer_.get(), capturer2.get()}); |
383 } | 389 } |
384 | 390 |
| 391 // Disabled due to being flaky due to the fact that it useds rendering / UI, |
| 392 // see webrtc/6366. |
| 393 TEST_F(ScreenCapturerTest, |
| 394 DISABLED_MaybeCaptureUpdatedRegionWithDirectxCapturer) { |
| 395 // Even DirectX capturer is not supported in current system, we should be able |
| 396 // to select a usable capturer. |
| 397 MaybeCreateDirectxCapturer(); |
| 398 TestCaptureUpdatedRegion(); |
| 399 } |
| 400 |
385 #endif // defined(WEBRTC_WIN) | 401 #endif // defined(WEBRTC_WIN) |
386 | 402 |
387 } // namespace webrtc | 403 } // namespace webrtc |
OLD | NEW |