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

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

Issue 2712353002: DxgiOutputDuplicator AcquireNextFrame timeout can be 0 (Closed)
Patch Set: Created 3 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 15 matching lines...) Expand all
26 26
27 namespace webrtc { 27 namespace webrtc {
28 28
29 using Microsoft::WRL::ComPtr; 29 using Microsoft::WRL::ComPtr;
30 30
31 namespace { 31 namespace {
32 32
33 // Timeout for AcquireNextFrame() call. 33 // Timeout for AcquireNextFrame() call.
34 // DxgiDuplicatorController leverages external components to do the capture 34 // DxgiDuplicatorController leverages external components to do the capture
35 // scheduling. So here DxgiOutputDuplicator does not need to actively wait for a 35 // scheduling. So here DxgiOutputDuplicator does not need to actively wait for a
36 // new frame. 1 millisecond is the minimium value AcquireNextFrame() accepts. 36 // new frame.
37 const int kAcquireTimeoutMs = 1; 37 const int kAcquireTimeoutMs = 0;
38 38
39 DesktopRect RECTToDesktopRect(const RECT& rect) { 39 DesktopRect RECTToDesktopRect(const RECT& rect) {
40 return DesktopRect::MakeLTRB(rect.left, rect.top, rect.right, rect.bottom); 40 return DesktopRect::MakeLTRB(rect.left, rect.top, rect.right, rect.bottom);
41 } 41 }
42 42
43 Rotation DxgiRotationToRotation(DXGI_MODE_ROTATION rotation) { 43 Rotation DxgiRotationToRotation(DXGI_MODE_ROTATION rotation) {
44 switch (rotation) { 44 switch (rotation) {
45 case DXGI_MODE_ROTATION_IDENTITY: 45 case DXGI_MODE_ROTATION_IDENTITY:
46 case DXGI_MODE_ROTATION_UNSPECIFIED: 46 case DXGI_MODE_ROTATION_UNSPECIFIED:
47 return Rotation::CLOCK_WISE_0; 47 return Rotation::CLOCK_WISE_0;
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 } 343 }
344 344
345 int64_t DxgiOutputDuplicator::num_frames_captured() const { 345 int64_t DxgiOutputDuplicator::num_frames_captured() const {
346 #if !defined(NDEBUG) 346 #if !defined(NDEBUG)
347 RTC_DCHECK_EQ(!!last_frame_, num_frames_captured_ > 0); 347 RTC_DCHECK_EQ(!!last_frame_, num_frames_captured_ > 0);
348 #endif 348 #endif
349 return num_frames_captured_; 349 return num_frames_captured_;
350 } 350 }
351 351
352 } // namespace webrtc 352 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698