Index: webrtc/modules/desktop_capture/win/dxgi_adapter_duplicator.cc |
diff --git a/webrtc/modules/desktop_capture/win/dxgi_adapter_duplicator.cc b/webrtc/modules/desktop_capture/win/dxgi_adapter_duplicator.cc |
index a73f9e39f7988818d24643ebf7f357f3c44d0938..6ae17f214d5d2a2f0881f51eb019b2bce4dae275 100644 |
--- a/webrtc/modules/desktop_capture/win/dxgi_adapter_duplicator.cc |
+++ b/webrtc/modules/desktop_capture/win/dxgi_adapter_duplicator.cc |
@@ -52,12 +52,18 @@ bool DxgiAdapterDuplicator::DoInitialize() { |
break; |
} |
+ if (error.Error() == DXGI_ERROR_NOT_CURRENTLY_AVAILABLE) { |
+ LOG(LS_WARNING) << "IDXGIAdapter::EnumOutputs returns " |
+ "NOT_CURRENTLY_AVAILABLE. Is it running on session 0?"; |
Sergey Ulanov
2017/06/26 23:41:41
Rephrase the second sentence as a statement instea
Hzj_jie
2017/06/27 04:37:33
Done.
|
+ break; |
+ } |
+ |
if (error.Error() != S_OK || !output) { |
LOG(LS_WARNING) << "IDXGIAdapter::EnumOutputs returns an unexpected " |
"result " |
<< error.ErrorMessage() << " with error code" |
<< error.Error(); |
- return false; |
+ continue; |
} |
DXGI_OUTPUT_DESC desc; |
@@ -70,12 +76,17 @@ bool DxgiAdapterDuplicator::DoInitialize() { |
LOG(LS_WARNING) << "Failed to convert IDXGIOutput to IDXGIOutput1, " |
"this usually means the system does not support " |
"DirectX 11"; |
- return false; |
+ continue; |
} |
- duplicators_.emplace_back(device_, output1, desc); |
- if (!duplicators_.back().Initialize()) { |
- return false; |
+ DxgiOutputDuplicator duplicator(device_, output1, desc); |
+ if (!duplicator.Initialize()) { |
+ LOG(LS_WARNING) << "Failed to initialize DxgiOutputDuplicator on " |
+ "output " |
+ << i; |
+ continue; |
} |
+ |
+ duplicators_.push_back(std::move(duplicator)); |
desktop_rect_.UnionWith(duplicators_.back().desktop_rect()); |
} |
} else { |
@@ -83,7 +94,12 @@ bool DxgiAdapterDuplicator::DoInitialize() { |
<< ", ignore."; |
} |
} |
- return true; |
+ |
+ if (duplicators_.empty()) { |
+ LOG(LS_WARNING) << "Cannot initialize any DxgiOutputDuplicator instance."; |
+ } |
+ |
+ return !duplicators_.empty(); |
} |
void DxgiAdapterDuplicator::Setup(Context* context) { |