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