Index: webrtc/modules/desktop_capture/win/screen_capturer_win_directx.cc |
diff --git a/webrtc/modules/desktop_capture/win/screen_capturer_win_directx.cc b/webrtc/modules/desktop_capture/win/screen_capturer_win_directx.cc |
index 9630265c63e8720ee3089b9fccb9f1b873aa05e8..331379b8a56d0e7307c500a810ac8336bdddb068 100644 |
--- a/webrtc/modules/desktop_capture/win/screen_capturer_win_directx.cc |
+++ b/webrtc/modules/desktop_capture/win/screen_capturer_win_directx.cc |
@@ -36,11 +36,10 @@ bool ScreenCapturerWinDirectx::RetrieveD3dInfo(D3dInfo* info) { |
return DxgiDuplicatorController::Instance()->RetrieveD3dInfo(info); |
} |
-ScreenCapturerWinDirectx::ScreenCapturerWinDirectx( |
- const DesktopCaptureOptions& options) |
- : callback_(nullptr) {} |
+ScreenCapturerWinDirectx::ScreenCapturerWinDirectx() |
+ : controller_(DxgiDuplicatorController::Instance()) {} |
-ScreenCapturerWinDirectx::~ScreenCapturerWinDirectx() {} |
+ScreenCapturerWinDirectx::~ScreenCapturerWinDirectx() = default; |
void ScreenCapturerWinDirectx::Start(Callback* callback) { |
RTC_DCHECK(!callback_); |
@@ -67,10 +66,9 @@ void ScreenCapturerWinDirectx::CaptureFrame() { |
DxgiDuplicatorController::Result result; |
if (current_screen_id_ == kFullDesktopScreenId) { |
- result = DxgiDuplicatorController::Instance()->Duplicate( |
- frames_.current_frame()); |
+ result = controller_->Duplicate(frames_.current_frame()); |
} else { |
- result = DxgiDuplicatorController::Instance()->DuplicateMonitor( |
+ result = controller_->DuplicateMonitor( |
frames_.current_frame(), current_screen_id_); |
} |
@@ -106,7 +104,7 @@ void ScreenCapturerWinDirectx::CaptureFrame() { |
} |
bool ScreenCapturerWinDirectx::GetSourceList(SourceList* sources) { |
- int screen_count = DxgiDuplicatorController::Instance()->ScreenCount(); |
+ int screen_count = controller_->ScreenCount(); |
for (int i = 0; i < screen_count; i++) { |
sources->push_back({i}); |
} |
@@ -123,7 +121,7 @@ bool ScreenCapturerWinDirectx::SelectSource(SourceId id) { |
return true; |
} |
- int screen_count = DxgiDuplicatorController::Instance()->ScreenCount(); |
+ int screen_count = controller_->ScreenCount(); |
if (id >= 0 && id < screen_count) { |
current_screen_id_ = id; |
return true; |