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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 } // namespace | 60 } // namespace |
61 | 61 |
62 DxgiOutputDuplicator::DxgiOutputDuplicator(const D3dDevice& device, | 62 DxgiOutputDuplicator::DxgiOutputDuplicator(const D3dDevice& device, |
63 const ComPtr<IDXGIOutput1>& output, | 63 const ComPtr<IDXGIOutput1>& output, |
64 const DXGI_OUTPUT_DESC& desc) | 64 const DXGI_OUTPUT_DESC& desc) |
65 : device_(device), | 65 : device_(device), |
66 output_(output), | 66 output_(output), |
67 desktop_rect_(RECTToDesktopRect(desc.DesktopCoordinates)) { | 67 desktop_rect_(RECTToDesktopRect(desc.DesktopCoordinates)) { |
68 RTC_DCHECK(output_); | 68 RTC_DCHECK(output_); |
69 RTC_DCHECK(!desktop_rect_.is_empty()); | 69 RTC_DCHECK(!desktop_rect_.is_empty()); |
70 RTC_DCHECK(desktop_rect_.width() > 0 && desktop_rect_.height() > 0); | 70 RTC_DCHECK(desktop_rect_.left() >= 0 && desktop_rect_.top() >= 0); |
71 } | 71 } |
72 | 72 |
73 DxgiOutputDuplicator::DxgiOutputDuplicator(DxgiOutputDuplicator&& other) = | 73 DxgiOutputDuplicator::DxgiOutputDuplicator(DxgiOutputDuplicator&& other) = |
74 default; | 74 default; |
75 | 75 |
76 DxgiOutputDuplicator::~DxgiOutputDuplicator() { | 76 DxgiOutputDuplicator::~DxgiOutputDuplicator() { |
77 if (duplication_) { | 77 if (duplication_) { |
78 duplication_->ReleaseFrame(); | 78 duplication_->ReleaseFrame(); |
79 } | 79 } |
80 texture_.reset(); | 80 texture_.reset(); |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 return desktop_rect_.size(); | 374 return desktop_rect_.size(); |
375 } | 375 } |
376 | 376 |
377 int64_t DxgiOutputDuplicator::num_frames_captured() const { | 377 int64_t DxgiOutputDuplicator::num_frames_captured() const { |
378 #if !defined(NDEBUG) | 378 #if !defined(NDEBUG) |
379 RTC_DCHECK_EQ(!!last_frame_, num_frames_captured_ > 0); | 379 RTC_DCHECK_EQ(!!last_frame_, num_frames_captured_ > 0); |
380 #endif | 380 #endif |
381 return num_frames_captured_; | 381 return num_frames_captured_; |
382 } | 382 } |
383 | 383 |
384 void DxgiOutputDuplicator::TranslateRect(const DesktopVector& position) { | |
385 desktop_rect_.Translate(position); | |
386 RTC_DCHECK(desktop_rect_.left() >= 0 && desktop_rect_.top() >= 0); | |
387 } | |
388 | |
389 } // namespace webrtc | 384 } // namespace webrtc |
OLD | NEW |