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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 | 47 |
48 DesktopSize ScreenCapturerWinDirectx::SelectedDesktopSize() const { | 48 DesktopSize ScreenCapturerWinDirectx::SelectedDesktopSize() const { |
49 if (current_screen_id == kFullDesktopScreenId) { | 49 if (current_screen_id == kFullDesktopScreenId) { |
50 return DxgiDuplicatorController::Instance()->desktop_size(); | 50 return DxgiDuplicatorController::Instance()->desktop_size(); |
51 } | 51 } |
52 return DxgiDuplicatorController::Instance() | 52 return DxgiDuplicatorController::Instance() |
53 ->ScreenRect(current_screen_id) | 53 ->ScreenRect(current_screen_id) |
54 .size(); | 54 .size(); |
55 } | 55 } |
56 | 56 |
57 void ScreenCapturerWinDirectx::Capture(const DesktopRegion& region) { | 57 void ScreenCapturerWinDirectx::CaptureFrame() { |
58 RTC_DCHECK(callback_); | 58 RTC_DCHECK(callback_); |
59 | 59 |
60 int64_t capture_start_time_nanos = rtc::TimeNanos(); | 60 int64_t capture_start_time_nanos = rtc::TimeNanos(); |
61 | 61 |
62 frames_.MoveToNextFrame(); | 62 frames_.MoveToNextFrame(); |
63 if (!frames_.current_frame()) { | 63 if (!frames_.current_frame()) { |
64 std::unique_ptr<DesktopFrame> new_frame; | 64 std::unique_ptr<DesktopFrame> new_frame; |
65 if (shared_memory_factory_) { | 65 if (shared_memory_factory_) { |
66 new_frame = SharedMemoryDesktopFrame::Create( | 66 new_frame = SharedMemoryDesktopFrame::Create( |
67 SelectedDesktopSize(), shared_memory_factory_.get()); | 67 SelectedDesktopSize(), shared_memory_factory_.get()); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 | 131 |
132 int screen_count = DxgiDuplicatorController::Instance()->ScreenCount(); | 132 int screen_count = DxgiDuplicatorController::Instance()->ScreenCount(); |
133 if (id >= 0 && id < screen_count) { | 133 if (id >= 0 && id < screen_count) { |
134 current_screen_id = id; | 134 current_screen_id = id; |
135 return true; | 135 return true; |
136 } | 136 } |
137 return false; | 137 return false; |
138 } | 138 } |
139 | 139 |
140 } // namespace webrtc | 140 } // namespace webrtc |
OLD | NEW |