Chromium Code Reviews| Index: remoting/host/host_attributes.cc |
| diff --git a/remoting/host/host_attributes.cc b/remoting/host/host_attributes.cc |
| index 307d04e289fd66c4df9a4ed1219155dcf2904287..6f929867c2c6747aab5d04b1eb111741634092fd 100644 |
| --- a/remoting/host/host_attributes.cc |
| +++ b/remoting/host/host_attributes.cc |
| @@ -67,7 +67,7 @@ inline constexpr bool IsNonOfficialBuild() { |
| #if defined(OS_WIN) |
| inline bool MinD3DFeatureLevelGreatThan10() { |
| webrtc::DxgiDuplicatorController::D3dInfo info; |
| - if (webrtc::DxgiDuplicatorController::Instance()->RetrieveD3dInfo(&info)) { |
| + if (webrtc::ScreenCapturerWinDirectx::RetrieveD3dInfo(&info)) { |
|
Sergey Ulanov
2017/06/26 23:55:23
Where is the change that made RetrieveD3dInfo() st
Hzj_jie
2017/06/27 04:37:28
No, it's always static (https://cs.chromium.org/ch
|
| return info.min_feature_level >= D3D_FEATURE_LEVEL_10_0; |
| } |
| return false; |
| @@ -75,7 +75,7 @@ inline bool MinD3DFeatureLevelGreatThan10() { |
| inline bool MinD3DFeatureLevelGreatThan11() { |
| webrtc::DxgiDuplicatorController::D3dInfo info; |
| - if (webrtc::DxgiDuplicatorController::Instance()->RetrieveD3dInfo(&info)) { |
| + if (webrtc::ScreenCapturerWinDirectx::RetrieveD3dInfo(&info)) { |
| return info.min_feature_level >= D3D_FEATURE_LEVEL_11_0; |
| } |
| return false; |
| @@ -83,7 +83,7 @@ inline bool MinD3DFeatureLevelGreatThan11() { |
| inline bool MinD3DFeatureLevelGreatThan12() { |
| webrtc::DxgiDuplicatorController::D3dInfo info; |
| - if (webrtc::DxgiDuplicatorController::Instance()->RetrieveD3dInfo(&info)) { |
| + if (webrtc::ScreenCapturerWinDirectx::RetrieveD3dInfo(&info)) { |
| return info.min_feature_level >= D3D_FEATURE_LEVEL_12_0; |
| } |
| return false; |
| @@ -119,6 +119,11 @@ static constexpr Attribute kAttributes[] = { |
| static_assert(std::is_pod<Attribute>::value, "Attribute should be POD."); |
| std::string GetHostAttributes() { |
| +#if defined(OS_WIN) |
| + // Ensure the following ScreenCapturerWinDirectx contructions won't |
| + // initialize and unload DxgiDuplicatorController. |
|
Sergey Ulanov
2017/06/26 23:55:23
This doesn't look like the best solution. GetHostA
Hzj_jie
2017/06/27 04:37:28
Done.
|
| + auto controller = webrtc::DxgiDuplicatorController::Instance(); |
| +#endif |
| std::string result; |
| // By using ranged for-loop, MSVC throws error C3316: |
| // 'const remoting::StaticAttribute [0]': |
| @@ -133,6 +138,10 @@ std::string GetHostAttributes() { |
| result.append(attribute.name); |
| } |
| } |
| +#if defined(OS_WIN) |
| + // Avoid the warning of unused variable. |
| + controller = nullptr; |
| +#endif |
| return result; |
| } |