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

Side by Side Diff: webrtc/modules/desktop_capture/win/dxgi_adapter_duplicator.cc

Issue 2345163002: Several minor improvements of DirectX capturer (Closed)
Patch Set: Resolve review comments Created 4 years, 3 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 55
56 if (error.Error() != S_OK || !output) { 56 if (error.Error() != S_OK || !output) {
57 LOG(LS_WARNING) << "IDXGIAdapter::EnumOutputs returns an unexpected " 57 LOG(LS_WARNING) << "IDXGIAdapter::EnumOutputs returns an unexpected "
58 "result " 58 "result "
59 << error.ErrorMessage() << " with error code" 59 << error.ErrorMessage() << " with error code"
60 << error.Error(); 60 << error.Error();
61 return false; 61 return false;
62 } 62 }
63 63
64 DXGI_OUTPUT_DESC desc; 64 DXGI_OUTPUT_DESC desc;
65 error = _com_error(output->GetDesc(&desc)); 65 error = output->GetDesc(&desc);
66 if (error.Error() == S_OK) { 66 if (error.Error() == S_OK) {
67 if (desc.AttachedToDesktop && IsValidRect(desc.DesktopCoordinates)) { 67 if (desc.AttachedToDesktop && IsValidRect(desc.DesktopCoordinates)) {
68 ComPtr<IDXGIOutput1> output1; 68 ComPtr<IDXGIOutput1> output1;
69 error = _com_error(output.As(&output1)); 69 error = output.As(&output1);
70 if (error.Error() != S_OK || !output1) { 70 if (error.Error() != S_OK || !output1) {
71 LOG(LS_WARNING) << "Failed to convert IDXGIOutput to IDXGIOutput1, " 71 LOG(LS_WARNING) << "Failed to convert IDXGIOutput to IDXGIOutput1, "
72 "this usually means the system does not support " 72 "this usually means the system does not support "
73 "DirectX 11"; 73 "DirectX 11";
74 return false; 74 return false;
75 } 75 }
76 duplicators_.emplace_back(device_, output1, desc); 76 duplicators_.emplace_back(device_, output1, desc);
77 if (!duplicators_.back().Initialize()) { 77 if (!duplicators_.back().Initialize()) {
78 return false; 78 return false;
79 } 79 }
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 return duplicators_[monitor_id].Duplicate(&context->contexts[monitor_id], 134 return duplicators_[monitor_id].Duplicate(&context->contexts[monitor_id],
135 DesktopVector(), target); 135 DesktopVector(), target);
136 } 136 }
137 137
138 DesktopRect DxgiAdapterDuplicator::ScreenRect(int id) const { 138 DesktopRect DxgiAdapterDuplicator::ScreenRect(int id) const {
139 RTC_DCHECK(id >= 0 && id < static_cast<int>(duplicators_.size())); 139 RTC_DCHECK(id >= 0 && id < static_cast<int>(duplicators_.size()));
140 return duplicators_[id].desktop_rect(); 140 return duplicators_[id].desktop_rect();
141 } 141 }
142 142
143 } // namespace webrtc 143 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/desktop_capture/win/d3d_device.cc ('k') | webrtc/modules/desktop_capture/win/dxgi_output_duplicator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698