Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(169)

Side by Side Diff: webrtc/modules/desktop_capture/win/dxgi_duplicator_controller.h

Issue 2468083002: Remove the requirement of D3D_FEATURE_LEVEL_11_0, but export the D3D_FEATURE_LEVEL through APIs (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
11 #ifndef WEBRTC_MODULES_DESKTOP_CAPTURE_WIN_DXGI_DUPLICATOR_CONTROLLER_H_ 11 #ifndef WEBRTC_MODULES_DESKTOP_CAPTURE_WIN_DXGI_DUPLICATOR_CONTROLLER_H_
12 #define WEBRTC_MODULES_DESKTOP_CAPTURE_WIN_DXGI_DUPLICATOR_CONTROLLER_H_ 12 #define WEBRTC_MODULES_DESKTOP_CAPTURE_WIN_DXGI_DUPLICATOR_CONTROLLER_H_
13 13
14 #include <D3DCommon.h>
15
14 #include <memory> 16 #include <memory>
15 #include <vector> 17 #include <vector>
16 18
17 #include "webrtc/base/criticalsection.h" 19 #include "webrtc/base/criticalsection.h"
18 #include "webrtc/modules/desktop_capture/desktop_geometry.h" 20 #include "webrtc/modules/desktop_capture/desktop_geometry.h"
19 #include "webrtc/modules/desktop_capture/desktop_region.h" 21 #include "webrtc/modules/desktop_capture/desktop_region.h"
20 #include "webrtc/modules/desktop_capture/shared_desktop_frame.h" 22 #include "webrtc/modules/desktop_capture/shared_desktop_frame.h"
21 #include "webrtc/modules/desktop_capture/win/d3d_device.h" 23 #include "webrtc/modules/desktop_capture/win/d3d_device.h"
22 #include "webrtc/modules/desktop_capture/win/dxgi_adapter_duplicator.h" 24 #include "webrtc/modules/desktop_capture/win/dxgi_adapter_duplicator.h"
23 25
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 // Returns the singleton instance of DxgiDuplicatorController. 62 // Returns the singleton instance of DxgiDuplicatorController.
61 static DxgiDuplicatorController* Instance(); 63 static DxgiDuplicatorController* Instance();
62 64
63 // Destructs current instance. We need to make sure COM components and their 65 // Destructs current instance. We need to make sure COM components and their
64 // containers are destructed in correct order. 66 // containers are destructed in correct order.
65 ~DxgiDuplicatorController(); 67 ~DxgiDuplicatorController();
66 68
67 // Detects whether the system supports DXGI based capturer. 69 // Detects whether the system supports DXGI based capturer.
68 bool IsSupported(); 70 bool IsSupported();
69 71
72 // Returns minimum and maximum D3D_FEATURE_LEVEL current system supports.
73 bool SupportedFeatureLevels(D3D_FEATURE_LEVEL* min_feature_level,
74 D3D_FEATURE_LEVEL* max_feature_level);
75
70 // Captures current screen and writes into target. Since we are using double 76 // Captures current screen and writes into target. Since we are using double
71 // buffering, |last_frame|.updated_region() is used to represent the not 77 // buffering, |last_frame|.updated_region() is used to represent the not
72 // updated regions in current |target| frame, which should also be copied this 78 // updated regions in current |target| frame, which should also be copied this
73 // time. 79 // time.
74 // TODO(zijiehe): Windows cannot guarantee the frames returned by each 80 // TODO(zijiehe): Windows cannot guarantee the frames returned by each
75 // IDXGIOutputDuplication are synchronized. But we are using a totally 81 // IDXGIOutputDuplication are synchronized. But we are using a totally
76 // different threading model than the way Windows suggested, it's hard to 82 // different threading model than the way Windows suggested, it's hard to
77 // synchronize them manually. We should find a way to do it. 83 // synchronize them manually. We should find a way to do it.
78 bool Duplicate(Context* context, SharedDesktopFrame* target); 84 bool Duplicate(Context* context, SharedDesktopFrame* target);
79 85
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 152
147 // This lock must be locked whenever accessing any of the following objects. 153 // This lock must be locked whenever accessing any of the following objects.
148 rtc::CriticalSection lock_; 154 rtc::CriticalSection lock_;
149 155
150 // A self-incremented integer to compare with the one in Context, to 156 // A self-incremented integer to compare with the one in Context, to
151 // ensure a Context has been initialized after DxgiDuplicatorController. 157 // ensure a Context has been initialized after DxgiDuplicatorController.
152 int identity_ = 0; 158 int identity_ = 0;
153 DesktopRect desktop_rect_; 159 DesktopRect desktop_rect_;
154 DesktopVector dpi_; 160 DesktopVector dpi_;
155 std::vector<DxgiAdapterDuplicator> duplicators_; 161 std::vector<DxgiAdapterDuplicator> duplicators_;
162 D3D_FEATURE_LEVEL min_feature_level_;
163 D3D_FEATURE_LEVEL max_feature_level_;
156 }; 164 };
157 165
158 } // namespace webrtc 166 } // namespace webrtc
159 167
160 #endif // WEBRTC_MODULES_DESKTOP_CAPTURE_WIN_DXGI_DUPLICATOR_CONTROLLER_H_ 168 #endif // WEBRTC_MODULES_DESKTOP_CAPTURE_WIN_DXGI_DUPLICATOR_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698