Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(631)

Unified Diff: webrtc/modules/desktop_capture/win/screen_capturer_win_directx.cc

Issue 2933893003: Add reference counter of DxgiDuplicatorController to unload DXGI components (Closed)
Patch Set: Avoid copy-constructor of std::atomic_int Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/modules/desktop_capture/win/screen_capturer_win_directx.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « webrtc/modules/desktop_capture/win/screen_capturer_win_directx.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698