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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 } | 102 } |
103 } | 103 } |
104 | 104 |
105 std::unique_ptr<DesktopFrame> result = frames_.current_frame()->Share(); | 105 std::unique_ptr<DesktopFrame> result = frames_.current_frame()->Share(); |
106 result->set_capture_time_ms( | 106 result->set_capture_time_ms( |
107 (rtc::TimeNanos() - capture_start_time_nanos) / | 107 (rtc::TimeNanos() - capture_start_time_nanos) / |
108 rtc::kNumNanosecsPerMillisec); | 108 rtc::kNumNanosecsPerMillisec); |
109 callback_->OnCaptureResult(Result::SUCCESS, std::move(result)); | 109 callback_->OnCaptureResult(Result::SUCCESS, std::move(result)); |
110 } | 110 } |
111 | 111 |
112 bool ScreenCapturerWinDirectx::GetScreenList(ScreenList* screens) { | 112 bool ScreenCapturerWinDirectx::GetSourceList(SourceList* sources) { |
113 int screen_count = DxgiDuplicatorController::Instance()->ScreenCount(); | 113 int screen_count = DxgiDuplicatorController::Instance()->ScreenCount(); |
114 for (int i = 0; i < screen_count; i++) { | 114 for (int i = 0; i < screen_count; i++) { |
115 screens->push_back(Screen{i}); | 115 sources->push_back({i}); |
116 } | 116 } |
117 return true; | 117 return true; |
118 } | 118 } |
119 | 119 |
120 bool ScreenCapturerWinDirectx::SelectScreen(ScreenId id) { | 120 bool ScreenCapturerWinDirectx::SelectSource(SourceId id) { |
121 if (id == current_screen_id_) { | 121 if (id == current_screen_id_) { |
122 return true; | 122 return true; |
123 } | 123 } |
124 | 124 |
125 // Changing target screen may or may not impact frame size. So resetting | 125 // Changing target screen may or may not impact frame size. So resetting |
126 // frames only when a Duplicate() function call returns false. | 126 // frames only when a Duplicate() function call returns false. |
127 if (id == kFullDesktopScreenId) { | 127 if (id == kFullDesktopScreenId) { |
128 current_screen_id_ = id; | 128 current_screen_id_ = id; |
129 return true; | 129 return true; |
130 } | 130 } |
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 |