| OLD | NEW |
| 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 context->contexts.size() == duplicators_.size()); | 139 context->contexts.size() == duplicators_.size()); |
| 140 return duplicators_[monitor_id].Duplicate(&context->contexts[monitor_id], | 140 return duplicators_[monitor_id].Duplicate(&context->contexts[monitor_id], |
| 141 DesktopVector(), target); | 141 DesktopVector(), target); |
| 142 } | 142 } |
| 143 | 143 |
| 144 DesktopRect DxgiAdapterDuplicator::ScreenRect(int id) const { | 144 DesktopRect DxgiAdapterDuplicator::ScreenRect(int id) const { |
| 145 RTC_DCHECK(id >= 0 && id < static_cast<int>(duplicators_.size())); | 145 RTC_DCHECK(id >= 0 && id < static_cast<int>(duplicators_.size())); |
| 146 return duplicators_[id].desktop_rect(); | 146 return duplicators_[id].desktop_rect(); |
| 147 } | 147 } |
| 148 | 148 |
| 149 const std::string& DxgiAdapterDuplicator::GetDeviceName(int id) const { |
| 150 RTC_DCHECK(id >= 0 && id < static_cast<int>(duplicators_.size())); |
| 151 return duplicators_[id].device_name(); |
| 152 } |
| 153 |
| 149 int DxgiAdapterDuplicator::screen_count() const { | 154 int DxgiAdapterDuplicator::screen_count() const { |
| 150 return static_cast<int>(duplicators_.size()); | 155 return static_cast<int>(duplicators_.size()); |
| 151 } | 156 } |
| 152 | 157 |
| 153 int64_t DxgiAdapterDuplicator::GetNumFramesCaptured() const { | 158 int64_t DxgiAdapterDuplicator::GetNumFramesCaptured() const { |
| 154 int64_t min = INT64_MAX; | 159 int64_t min = INT64_MAX; |
| 155 for (const auto& duplicator : duplicators_) { | 160 for (const auto& duplicator : duplicators_) { |
| 156 min = std::min(min, duplicator.num_frames_captured()); | 161 min = std::min(min, duplicator.num_frames_captured()); |
| 157 } | 162 } |
| 158 | 163 |
| 159 return min; | 164 return min; |
| 160 } | 165 } |
| 161 | 166 |
| 162 void DxgiAdapterDuplicator::TranslateRect(const DesktopVector& position) { | 167 void DxgiAdapterDuplicator::TranslateRect(const DesktopVector& position) { |
| 163 desktop_rect_.Translate(position); | 168 desktop_rect_.Translate(position); |
| 164 RTC_DCHECK(desktop_rect_.left() >= 0 && desktop_rect_.top() >= 0); | 169 RTC_DCHECK(desktop_rect_.left() >= 0 && desktop_rect_.top() >= 0); |
| 165 for (auto& duplicator : duplicators_) { | 170 for (auto& duplicator : duplicators_) { |
| 166 duplicator.TranslateRect(position); | 171 duplicator.TranslateRect(position); |
| 167 } | 172 } |
| 168 } | 173 } |
| 169 | 174 |
| 170 } // namespace webrtc | 175 } // namespace webrtc |
| OLD | NEW |