OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "gpu/config/gpu_info.h" | 5 #include "gpu/config/gpu_info.h" |
6 | 6 |
7 namespace { | 7 namespace { |
8 | 8 |
9 void EnumerateGPUDevice(gpu::GPUInfo::Enumerator* enumerator, | 9 void EnumerateGPUDevice(gpu::GPUInfo::Enumerator* enumerator, |
10 const gpu::GPUInfo::GPUDevice& device) { | 10 const gpu::GPUInfo::GPUDevice& device) { |
(...skipping 12 matching lines...) Expand all Loading... |
23 enumerator->BeginVideoEncodeAcceleratorSupportedProfile(); | 23 enumerator->BeginVideoEncodeAcceleratorSupportedProfile(); |
24 enumerator->AddInt("profile", profile.profile); | 24 enumerator->AddInt("profile", profile.profile); |
25 enumerator->AddInt("maxResolutionWidth", profile.max_resolution.width()); | 25 enumerator->AddInt("maxResolutionWidth", profile.max_resolution.width()); |
26 enumerator->AddInt("maxResolutionHeight", profile.max_resolution.height()); | 26 enumerator->AddInt("maxResolutionHeight", profile.max_resolution.height()); |
27 enumerator->AddInt("maxFramerateNumerator", profile.max_framerate_numerator); | 27 enumerator->AddInt("maxFramerateNumerator", profile.max_framerate_numerator); |
28 enumerator->AddInt("maxFramerateDenominator", | 28 enumerator->AddInt("maxFramerateDenominator", |
29 profile.max_framerate_denominator); | 29 profile.max_framerate_denominator); |
30 enumerator->EndVideoEncodeAcceleratorSupportedProfile(); | 30 enumerator->EndVideoEncodeAcceleratorSupportedProfile(); |
31 } | 31 } |
32 | 32 |
| 33 void EnumerateVideoDecodeAcceleratorSupportedProfile( |
| 34 gpu::GPUInfo::Enumerator* enumerator, |
| 35 const gpu::VideoDecodeAcceleratorSupportedProfile profile) { |
| 36 enumerator->BeginVideoDecodeAcceleratorSupportedProfile(); |
| 37 enumerator->AddInt("profile", profile.profile); |
| 38 enumerator->AddInt("minResolutionWidth", profile.min_resolution.width()); |
| 39 enumerator->AddInt("minResolutionHeight", profile.min_resolution.height()); |
| 40 enumerator->AddInt("maxResolutionWidth", profile.max_resolution.width()); |
| 41 enumerator->AddInt("maxResolutionHeight", profile.max_resolution.height()); |
| 42 enumerator->EndVideoDecodeAcceleratorSupportedProfile(); |
| 43 } |
| 44 |
33 } // namespace | 45 } // namespace |
34 | 46 |
35 namespace gpu { | 47 namespace gpu { |
36 | 48 |
37 GPUInfo::GPUDevice::GPUDevice() | 49 GPUInfo::GPUDevice::GPUDevice() |
38 : vendor_id(0), | 50 : vendor_id(0), |
39 device_id(0), | 51 device_id(0), |
40 active(false) { | 52 active(false) { |
41 } | 53 } |
42 | 54 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 bool software_rendering; | 106 bool software_rendering; |
95 bool direct_rendering; | 107 bool direct_rendering; |
96 bool sandboxed; | 108 bool sandboxed; |
97 int process_crash_count; | 109 int process_crash_count; |
98 CollectInfoResult basic_info_state; | 110 CollectInfoResult basic_info_state; |
99 CollectInfoResult context_info_state; | 111 CollectInfoResult context_info_state; |
100 #if defined(OS_WIN) | 112 #if defined(OS_WIN) |
101 CollectInfoResult dx_diagnostics_info_state; | 113 CollectInfoResult dx_diagnostics_info_state; |
102 DxDiagNode dx_diagnostics; | 114 DxDiagNode dx_diagnostics; |
103 #endif | 115 #endif |
| 116 std::vector<VideoDecodeAcceleratorSupportedProfile> |
| 117 video_decode_accelerator_supported_profiles; |
104 std::vector<VideoEncodeAcceleratorSupportedProfile> | 118 std::vector<VideoEncodeAcceleratorSupportedProfile> |
105 video_encode_accelerator_supported_profiles; | 119 video_encode_accelerator_supported_profiles; |
106 }; | 120 }; |
107 | 121 |
108 // If this assert fails then most likely something below needs to be updated. | 122 // If this assert fails then most likely something below needs to be updated. |
109 // Note that this assert is only approximate. If a new field is added to | 123 // Note that this assert is only approximate. If a new field is added to |
110 // GPUInfo which fits within the current padding then it will not be caught. | 124 // GPUInfo which fits within the current padding then it will not be caught. |
111 COMPILE_ASSERT( | 125 COMPILE_ASSERT( |
112 sizeof(GPUInfo) == sizeof(GPUInfoKnownFields), | 126 sizeof(GPUInfo) == sizeof(GPUInfoKnownFields), |
113 Fields_Have_Changed_In_GPUInfo_So_Update_Below); | 127 Fields_Have_Changed_In_GPUInfo_So_Update_Below); |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 enumerator->AddBool("softwareRendering", software_rendering); | 165 enumerator->AddBool("softwareRendering", software_rendering); |
152 enumerator->AddBool("directRendering", direct_rendering); | 166 enumerator->AddBool("directRendering", direct_rendering); |
153 enumerator->AddBool("sandboxed", sandboxed); | 167 enumerator->AddBool("sandboxed", sandboxed); |
154 enumerator->AddInt("processCrashCount", process_crash_count); | 168 enumerator->AddInt("processCrashCount", process_crash_count); |
155 enumerator->AddInt("basicInfoState", basic_info_state); | 169 enumerator->AddInt("basicInfoState", basic_info_state); |
156 enumerator->AddInt("contextInfoState", context_info_state); | 170 enumerator->AddInt("contextInfoState", context_info_state); |
157 #if defined(OS_WIN) | 171 #if defined(OS_WIN) |
158 enumerator->AddInt("DxDiagnosticsInfoState", dx_diagnostics_info_state); | 172 enumerator->AddInt("DxDiagnosticsInfoState", dx_diagnostics_info_state); |
159 #endif | 173 #endif |
160 // TODO(kbr): add dx_diagnostics on Windows. | 174 // TODO(kbr): add dx_diagnostics on Windows. |
| 175 for (size_t ii = 0; ii < video_decode_accelerator_supported_profiles.size(); |
| 176 ++ii) { |
| 177 EnumerateVideoDecodeAcceleratorSupportedProfile( |
| 178 enumerator, video_decode_accelerator_supported_profiles[ii]); |
| 179 } |
161 for (size_t ii = 0; ii < video_encode_accelerator_supported_profiles.size(); | 180 for (size_t ii = 0; ii < video_encode_accelerator_supported_profiles.size(); |
162 ++ii) { | 181 ++ii) { |
163 EnumerateVideoEncodeAcceleratorSupportedProfile( | 182 EnumerateVideoEncodeAcceleratorSupportedProfile( |
164 enumerator, video_encode_accelerator_supported_profiles[ii]); | 183 enumerator, video_encode_accelerator_supported_profiles[ii]); |
165 } | 184 } |
166 enumerator->EndAuxAttributes(); | 185 enumerator->EndAuxAttributes(); |
167 } | 186 } |
168 | 187 |
169 } // namespace gpu | 188 } // namespace gpu |
OLD | NEW |