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

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

Issue 2933893003: Add reference counter of DxgiDuplicatorController to unload DXGI components (Closed)
Patch Set: unique_ptr -> scoped_refptr 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
Index: webrtc/modules/desktop_capture/win/screen_capturer_win_directx.h
diff --git a/webrtc/modules/desktop_capture/win/screen_capturer_win_directx.h b/webrtc/modules/desktop_capture/win/screen_capturer_win_directx.h
index 59f457c5b4dcdd15ec6813983d1540f76b62efd5..5389ee101ccd23725c19844974f138af8aa98138 100644
--- a/webrtc/modules/desktop_capture/win/screen_capturer_win_directx.h
+++ b/webrtc/modules/desktop_capture/win/screen_capturer_win_directx.h
@@ -30,9 +30,19 @@ class ScreenCapturerWinDirectx : public DesktopCapturer {
public:
using D3dInfo = DxgiDuplicatorController::D3dInfo;
- // Whether the system supports DirectX based capturing.
+ // Deprecated: use "IsAvailable()" instead.
static bool IsSupported();
+ // Deprecated: use "GetD3dInfo()" instead.
+ static bool RetrieveD3dInfo(D3dInfo* info);
+
+ explicit ScreenCapturerWinDirectx();
+
+ ~ScreenCapturerWinDirectx() override;
+
+ // Whether the system supports DirectX based capturing.
+ bool IsAvailable() const;
+
// Returns a most recent D3dInfo composed by
// DxgiDuplicatorController::Initialize() function. This function implicitly
// calls DxgiDuplicatorController::Initialize() if it has not been
@@ -41,12 +51,9 @@ class ScreenCapturerWinDirectx : public DesktopCapturer {
// The D3dInfo may change based on hardware configuration even without
// restarting the hardware and software. Refer to https://goo.gl/OOCppq. So
// consumers should not cache the result returned by this function.
- static bool RetrieveD3dInfo(D3dInfo* info);
-
- explicit ScreenCapturerWinDirectx(const DesktopCaptureOptions& options);
-
- ~ScreenCapturerWinDirectx() override;
+ bool GetD3dInfo(D3dInfo* info) const;
+ // DesktopCapturer implementation.
void Start(Callback* callback) override;
void SetSharedMemoryFactory(
std::unique_ptr<SharedMemoryFactory> shared_memory_factory) override;
@@ -55,6 +62,7 @@ class ScreenCapturerWinDirectx : public DesktopCapturer {
bool SelectSource(SourceId id) override;
private:
+ const DxgiDuplicatorController::Reference controller_;
ScreenCaptureFrameQueue<DxgiFrame> frames_;
std::unique_ptr<SharedMemoryFactory> shared_memory_factory_;
Callback* callback_ = nullptr;

Powered by Google App Engine
This is Rietveld 408576698