| 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 10 matching lines...) Expand all Loading... |
| 21 #include "webrtc/modules/desktop_capture/win/d3d_device.h" | 21 #include "webrtc/modules/desktop_capture/win/d3d_device.h" |
| 22 #include "webrtc/modules/desktop_capture/win/dxgi_output_duplicator.h" | 22 #include "webrtc/modules/desktop_capture/win/dxgi_output_duplicator.h" |
| 23 | 23 |
| 24 namespace webrtc { | 24 namespace webrtc { |
| 25 | 25 |
| 26 // A container of DxgiOutputDuplicators to duplicate monitors attached to a | 26 // A container of DxgiOutputDuplicators to duplicate monitors attached to a |
| 27 // single video card. | 27 // single video card. |
| 28 class DxgiAdapterDuplicator { | 28 class DxgiAdapterDuplicator { |
| 29 public: | 29 public: |
| 30 struct Context { | 30 struct Context { |
| 31 Context(); |
| 32 Context(const Context& other); |
| 33 ~Context(); |
| 34 |
| 31 // Child DxgiOutputDuplicator::Context belongs to this | 35 // Child DxgiOutputDuplicator::Context belongs to this |
| 32 // DxgiAdapterDuplicator::Context. | 36 // DxgiAdapterDuplicator::Context. |
| 33 std::vector<DxgiOutputDuplicator::Context> contexts; | 37 std::vector<DxgiOutputDuplicator::Context> contexts; |
| 34 }; | 38 }; |
| 35 | 39 |
| 36 // Creates an instance of DxgiAdapterDuplicator from a D3dDevice. Only | 40 // Creates an instance of DxgiAdapterDuplicator from a D3dDevice. Only |
| 37 // DxgiDuplicatorController can create an instance. | 41 // DxgiDuplicatorController can create an instance. |
| 38 explicit DxgiAdapterDuplicator(const D3dDevice& device); | 42 explicit DxgiAdapterDuplicator(const D3dDevice& device); |
| 39 | 43 |
| 40 // Move constructor, to make it possible to store instances of | 44 // Move constructor, to make it possible to store instances of |
| 41 // DxgiAdapterDuplicator in std::vector<>. | 45 // DxgiAdapterDuplicator in std::vector<>. |
| 42 DxgiAdapterDuplicator(DxgiAdapterDuplicator&& other); | 46 DxgiAdapterDuplicator(DxgiAdapterDuplicator&& other); |
| 43 | 47 |
| 48 ~DxgiAdapterDuplicator(); |
| 49 |
| 44 // Initializes the DxgiAdapterDuplicator from a D3dDevice. | 50 // Initializes the DxgiAdapterDuplicator from a D3dDevice. |
| 45 bool Initialize(); | 51 bool Initialize(); |
| 46 | 52 |
| 47 // Sequentially calls Duplicate function of all the DxgiOutputDuplicator | 53 // Sequentially calls Duplicate function of all the DxgiOutputDuplicator |
| 48 // instances owned by this instance, and writes into |target|. | 54 // instances owned by this instance, and writes into |target|. |
| 49 bool Duplicate(Context* context, SharedDesktopFrame* target); | 55 bool Duplicate(Context* context, SharedDesktopFrame* target); |
| 50 | 56 |
| 51 // Captures one monitor and writes into |target|. |monitor_id| should be | 57 // Captures one monitor and writes into |target|. |monitor_id| should be |
| 52 // between [0, screen_count()). | 58 // between [0, screen_count()). |
| 53 bool DuplicateMonitor(Context* context, | 59 bool DuplicateMonitor(Context* context, |
| (...skipping 22 matching lines...) Expand all Loading... |
| 76 void Unregister(const Context* const context); | 82 void Unregister(const Context* const context); |
| 77 | 83 |
| 78 const D3dDevice device_; | 84 const D3dDevice device_; |
| 79 std::vector<DxgiOutputDuplicator> duplicators_; | 85 std::vector<DxgiOutputDuplicator> duplicators_; |
| 80 DesktopRect desktop_rect_; | 86 DesktopRect desktop_rect_; |
| 81 }; | 87 }; |
| 82 | 88 |
| 83 } // namespace webrtc | 89 } // namespace webrtc |
| 84 | 90 |
| 85 #endif // WEBRTC_MODULES_DESKTOP_CAPTURE_WIN_DXGI_ADAPTER_DUPLICATOR_H_ | 91 #endif // WEBRTC_MODULES_DESKTOP_CAPTURE_WIN_DXGI_ADAPTER_DUPLICATOR_H_ |
| OLD | NEW |