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

Unified Diff: webrtc/modules/desktop_capture/screen_capturer_win.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 | « no previous file | webrtc/modules/desktop_capture/win/dxgi_duplicator_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/desktop_capture/screen_capturer_win.cc
diff --git a/webrtc/modules/desktop_capture/screen_capturer_win.cc b/webrtc/modules/desktop_capture/screen_capturer_win.cc
index d8aecb15c7e86a6f5c124504f1c72f569baa9b7c..9e74aabca6640c851be4977ba590feb21644f0f0 100644
--- a/webrtc/modules/desktop_capture/screen_capturer_win.cc
+++ b/webrtc/modules/desktop_capture/screen_capturer_win.cc
@@ -24,10 +24,9 @@ namespace webrtc {
namespace {
-std::unique_ptr<DesktopCapturer> CreateScreenCapturerWinDirectx(
- const DesktopCaptureOptions& options) {
+std::unique_ptr<DesktopCapturer> CreateScreenCapturerWinDirectx() {
std::unique_ptr<DesktopCapturer> capturer(
- new ScreenCapturerWinDirectx(options));
+ new ScreenCapturerWinDirectx());
capturer.reset(new BlankDetectorDesktopCapturerWrapper(
std::move(capturer), RgbaColor(0, 0, 0, 0)));
return capturer;
@@ -39,10 +38,14 @@ std::unique_ptr<DesktopCapturer> CreateScreenCapturerWinDirectx(
std::unique_ptr<DesktopCapturer> DesktopCapturer::CreateRawScreenCapturer(
const DesktopCaptureOptions& options) {
std::unique_ptr<DesktopCapturer> capturer(new ScreenCapturerWinGdi(options));
- if (options.allow_directx_capturer() &&
- ScreenCapturerWinDirectx::IsSupported()) {
- capturer.reset(new FallbackDesktopCapturerWrapper(
- CreateScreenCapturerWinDirectx(options), std::move(capturer)));
+ if (options.allow_directx_capturer()) {
+ // |dxgi_duplicator_controller| should be alive in this scope to ensure it
+ // won't unload DxgiDuplicatorController.
+ auto dxgi_duplicator_controller = DxgiDuplicatorController::Instance();
+ if (ScreenCapturerWinDirectx::IsSupported()) {
+ capturer.reset(new FallbackDesktopCapturerWrapper(
+ CreateScreenCapturerWinDirectx(), std::move(capturer)));
+ }
}
if (options.allow_use_magnification_api()) {
« no previous file with comments | « no previous file | webrtc/modules/desktop_capture/win/dxgi_duplicator_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698