Index: webrtc/modules/desktop_capture/win/dxgi_duplicator_controller.h |
diff --git a/webrtc/modules/desktop_capture/win/dxgi_duplicator_controller.h b/webrtc/modules/desktop_capture/win/dxgi_duplicator_controller.h |
index d13961d0da09fee6c53d39c5968ba636fc23160d..7470db9eeb99a05b18ca210109e34448491ca903 100644 |
--- a/webrtc/modules/desktop_capture/win/dxgi_duplicator_controller.h |
+++ b/webrtc/modules/desktop_capture/win/dxgi_duplicator_controller.h |
@@ -19,6 +19,7 @@ |
#include "webrtc/base/criticalsection.h" |
#include "webrtc/modules/desktop_capture/desktop_geometry.h" |
#include "webrtc/modules/desktop_capture/desktop_region.h" |
+#include "webrtc/modules/desktop_capture/resolution_change_detector.h" |
#include "webrtc/modules/desktop_capture/shared_desktop_frame.h" |
#include "webrtc/modules/desktop_capture/win/d3d_device.h" |
#include "webrtc/modules/desktop_capture/win/dxgi_adapter_duplicator.h" |
@@ -47,6 +48,9 @@ class DxgiDuplicatorController { |
// destructing. |
~Context(); |
+ // Reset current Context, so it will be reinitialized next time. |
+ void Reset(); |
+ |
private: |
friend class DxgiDuplicatorController; |
@@ -87,6 +91,11 @@ class DxgiDuplicatorController { |
// Detects whether the system supports DXGI based capturer. |
bool IsSupported(); |
+ // Calls Deinitialize() function with lock. Consumers can call this function |
+ // to force the DxgiDuplicatorController to be reinitialized to avoid an |
+ // expected failure in next Duplicate() call. |
+ void Reset(); |
+ |
// Returns a copy of D3dInfo composed by last Initialize() function call. |
bool RetrieveD3dInfo(D3dInfo* info); |
@@ -167,6 +176,10 @@ class DxgiDuplicatorController { |
int monitor_id, |
SharedDesktopFrame* target); |
+ bool DoDuplicateUnlocked(Context* context, |
+ int monitor_id, |
+ SharedDesktopFrame* target); |
+ |
// This lock must be locked whenever accessing any of the following objects. |
rtc::CriticalSection lock_; |
@@ -177,6 +190,7 @@ class DxgiDuplicatorController { |
DesktopVector dpi_; |
std::vector<DxgiAdapterDuplicator> duplicators_; |
D3dInfo d3d_info_; |
+ ResolutionChangeDetector resolution_change_detector_; |
}; |
} // namespace webrtc |