| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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/win/screen_capturer_win_directx.h" | 11 #include "webrtc/modules/desktop_capture/win/screen_capturer_win_directx.h" |
| 12 | 12 |
| 13 #include <utility> | 13 #include <utility> |
| 14 | 14 |
| 15 #include "webrtc/base/checks.h" | 15 #include "webrtc/base/checks.h" |
| 16 #include "webrtc/base/logging.h" | 16 #include "webrtc/base/logging.h" |
| 17 #include "webrtc/base/timeutils.h" | 17 #include "webrtc/base/timeutils.h" |
| 18 #include "webrtc/modules/desktop_capture/desktop_frame.h" | 18 #include "webrtc/modules/desktop_capture/desktop_frame.h" |
| 19 | 19 |
| 20 namespace webrtc { | 20 namespace webrtc { |
| 21 | 21 |
| 22 using Microsoft::WRL::ComPtr; | 22 using Microsoft::WRL::ComPtr; |
| 23 | 23 |
| 24 // static | 24 // static |
| 25 bool ScreenCapturerWinDirectx::IsSupported() { | 25 bool ScreenCapturerWinDirectx::IsSupported() { |
| 26 // Forward IsSupported function call to DxgiDuplicatorController. | 26 // Forwards IsSupported() function call to DxgiDuplicatorController. |
| 27 return DxgiDuplicatorController::Instance()->IsSupported(); | 27 return DxgiDuplicatorController::Instance()->IsSupported(); |
| 28 } | 28 } |
| 29 | 29 |
| 30 // static |
| 31 bool ScreenCapturerWinDirectx::SupportedFeatureLevels( |
| 32 D3D_FEATURE_LEVEL* min_feature_level, |
| 33 D3D_FEATURE_LEVEL* max_feature_level) { |
| 34 // Forwards SupportedFeatureLevels() function call to |
| 35 // DxgiDuplicatorController. |
| 36 return DxgiDuplicatorController::Instance()->SupportedFeatureLevels( |
| 37 min_feature_level, max_feature_level); |
| 38 } |
| 39 |
| 30 ScreenCapturerWinDirectx::ScreenCapturerWinDirectx( | 40 ScreenCapturerWinDirectx::ScreenCapturerWinDirectx( |
| 31 const DesktopCaptureOptions& options) | 41 const DesktopCaptureOptions& options) |
| 32 : callback_(nullptr) {} | 42 : callback_(nullptr) {} |
| 33 | 43 |
| 34 ScreenCapturerWinDirectx::~ScreenCapturerWinDirectx() {} | 44 ScreenCapturerWinDirectx::~ScreenCapturerWinDirectx() {} |
| 35 | 45 |
| 36 void ScreenCapturerWinDirectx::Start(Callback* callback) { | 46 void ScreenCapturerWinDirectx::Start(Callback* callback) { |
| 37 RTC_DCHECK(!callback_); | 47 RTC_DCHECK(!callback_); |
| 38 RTC_DCHECK(callback); | 48 RTC_DCHECK(callback); |
| 39 | 49 |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 | 141 |
| 132 int screen_count = DxgiDuplicatorController::Instance()->ScreenCount(); | 142 int screen_count = DxgiDuplicatorController::Instance()->ScreenCount(); |
| 133 if (id >= 0 && id < screen_count) { | 143 if (id >= 0 && id < screen_count) { |
| 134 current_screen_id_ = id; | 144 current_screen_id_ = id; |
| 135 return true; | 145 return true; |
| 136 } | 146 } |
| 137 return false; | 147 return false; |
| 138 } | 148 } |
| 139 | 149 |
| 140 } // namespace webrtc | 150 } // namespace webrtc |
| OLD | NEW |