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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 bool DoDuplicateAll(Context* context, SharedDesktopFrame* target); | 151 bool DoDuplicateAll(Context* context, SharedDesktopFrame* target); |
152 | 152 |
153 // Captures one monitor. | 153 // Captures one monitor. |
154 bool DoDuplicateOne(Context* context, | 154 bool DoDuplicateOne(Context* context, |
155 int monitor_id, | 155 int monitor_id, |
156 SharedDesktopFrame* target); | 156 SharedDesktopFrame* target); |
157 | 157 |
158 // The minimum GetNumFramesCaptured() returned by |duplicators_|. | 158 // The minimum GetNumFramesCaptured() returned by |duplicators_|. |
159 int64_t GetNumFramesCaptured() const; | 159 int64_t GetNumFramesCaptured() const; |
160 | 160 |
161 // Returns a DesktopSize to cover entire |desktop_rect_|. | 161 // Returns a DesktopSize to cover entire desktop_rect. This may be different |
| 162 // than desktop_rect().size(), since top-left of the screen does not need to |
| 163 // be started from (0, 0). |
162 DesktopSize desktop_size() const; | 164 DesktopSize desktop_size() const; |
163 | 165 |
164 // Returns the size of one screen. |id| should be >= 0. If system does not | 166 // Returns the size of one screen. |id| should be >= 0. If system does not |
165 // support DXGI based capturer, or |id| is greater than the total screen count | 167 // support DXGI based capturer, or |id| is greater than the total screen count |
166 // of all the Duplicators, this function returns an empty DesktopRect. | 168 // of all the Duplicators, this function returns an empty DesktopRect. |
167 DesktopRect ScreenRect(int id) const; | 169 DesktopRect ScreenRect(int id) const; |
168 | 170 |
169 int ScreenCountUnlocked() const; | 171 int ScreenCountUnlocked() const; |
170 | 172 |
171 // Returns the desktop size of the selected screen |monitor_id|. Setting | 173 // Returns the desktop size of the selected screen |monitor_id|. Setting |
172 // |monitor_id| < 0 to return the entire screen size. | 174 // |monitor_id| < 0 to return the entire screen size. |
173 DesktopSize SelectedDesktopSize(int monitor_id) const; | 175 DesktopSize SelectedDesktopSize(int monitor_id) const; |
174 | 176 |
175 // Retries DoDuplicateAll() for several times until GetNumFramesCaptured() is | 177 // Retries DoDuplicateAll() for several times until GetNumFramesCaptured() is |
176 // large enough. Returns false if DoDuplicateAll() returns false, or | 178 // large enough. Returns false if DoDuplicateAll() returns false, or |
177 // GetNumFramesCaptured() has never reached the requirement. | 179 // GetNumFramesCaptured() has never reached the requirement. |
178 // According to http://crbug.com/682112, dxgi capturer returns a black frame | 180 // According to http://crbug.com/682112, dxgi capturer returns a black frame |
179 // during first several capture attempts. | 181 // during first several capture attempts. |
180 bool EnsureFrameCaptured(Context* context, SharedDesktopFrame* target); | 182 bool EnsureFrameCaptured(Context* context, SharedDesktopFrame* target); |
181 | 183 |
182 // Moves |desktop_rect_| and all underlying |duplicators_|, putting top left | |
183 // corner of the desktop at (0, 0). This is necessary because DXGI_OUTPUT_DESC | |
184 // may return negative coordinates. Called from DoInitialize() after all | |
185 // DxgiAdapterDuplicator and DxgiOutputDuplicator instances are initialized. | |
186 void TranslateRect(); | |
187 | |
188 // This lock must be locked whenever accessing any of the following objects. | 184 // This lock must be locked whenever accessing any of the following objects. |
189 rtc::CriticalSection lock_; | 185 rtc::CriticalSection lock_; |
190 | 186 |
191 // A self-incremented integer to compare with the one in Context. It ensures | 187 // A self-incremented integer to compare with the one in Context. It ensures |
192 // a Context instance is always initialized after DxgiDuplicatorController. | 188 // a Context instance is always initialized after DxgiDuplicatorController. |
193 int identity_ = 0; | 189 int identity_ = 0; |
194 DesktopRect desktop_rect_; | 190 DesktopRect desktop_rect_; |
195 DesktopVector dpi_; | 191 DesktopVector dpi_; |
196 std::vector<DxgiAdapterDuplicator> duplicators_; | 192 std::vector<DxgiAdapterDuplicator> duplicators_; |
197 D3dInfo d3d_info_; | 193 D3dInfo d3d_info_; |
198 ResolutionChangeDetector resolution_change_detector_; | 194 ResolutionChangeDetector resolution_change_detector_; |
199 }; | 195 }; |
200 | 196 |
201 } // namespace webrtc | 197 } // namespace webrtc |
202 | 198 |
203 #endif // WEBRTC_MODULES_DESKTOP_CAPTURE_WIN_DXGI_DUPLICATOR_CONTROLLER_H_ | 199 #endif // WEBRTC_MODULES_DESKTOP_CAPTURE_WIN_DXGI_DUPLICATOR_CONTROLLER_H_ |
OLD | NEW |