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 #ifndef GPU_CONFIG_GPU_INFO_H_ | 5 #ifndef GPU_CONFIG_GPU_INFO_H_ |
6 #define GPU_CONFIG_GPU_INFO_H_ | 6 #define GPU_CONFIG_GPU_INFO_H_ |
7 | 7 |
8 // Provides access to the GPU information for the system | 8 // Provides access to the GPU information for the system |
9 // on which chrome is currently running. | 9 // on which chrome is currently running. |
10 | 10 |
11 #include <string> | 11 #include <string> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
16 #include "base/version.h" | 16 #include "base/version.h" |
17 #include "build/build_config.h" | 17 #include "build/build_config.h" |
18 #include "gpu/config/dx_diag_node.h" | 18 #include "gpu/config/dx_diag_node.h" |
19 #include "gpu/config/gpu_performance_stats.h" | 19 #include "gpu/config/gpu_performance_stats.h" |
20 #include "gpu/gpu_export.h" | 20 #include "gpu/gpu_export.h" |
| 21 #include "ui/gfx/geometry/size.h" |
21 | 22 |
22 namespace gpu { | 23 namespace gpu { |
23 | 24 |
24 // Result for the various Collect*Info* functions below. | 25 // Result for the various Collect*Info* functions below. |
25 // Fatal failures are for cases where we can't create a context at all or | 26 // Fatal failures are for cases where we can't create a context at all or |
26 // something, making the use of the GPU impossible. | 27 // something, making the use of the GPU impossible. |
27 // Non-fatal failures are for cases where we could gather most info, but maybe | 28 // Non-fatal failures are for cases where we could gather most info, but maybe |
28 // some is missing (e.g. unable to parse a version string or to detect the exact | 29 // some is missing (e.g. unable to parse a version string or to detect the exact |
29 // model). | 30 // model). |
30 enum CollectInfoResult { | 31 enum CollectInfoResult { |
31 kCollectInfoNone = 0, | 32 kCollectInfoNone = 0, |
32 kCollectInfoSuccess = 1, | 33 kCollectInfoSuccess = 1, |
33 kCollectInfoNonFatalFailure = 2, | 34 kCollectInfoNonFatalFailure = 2, |
34 kCollectInfoFatalFailure = 3 | 35 kCollectInfoFatalFailure = 3 |
35 }; | 36 }; |
36 | 37 |
| 38 // Video profile. This *must* match media::VideoCodecProfile. |
| 39 enum VideoCodecProfile { |
| 40 VIDEO_CODEC_PROFILE_UNKNOWN = -1, |
| 41 VIDEO_CODEC_PROFILE_MIN = VIDEO_CODEC_PROFILE_UNKNOWN, |
| 42 H264PROFILE_BASELINE = 0, |
| 43 H264PROFILE_MAIN = 1, |
| 44 H264PROFILE_EXTENDED = 2, |
| 45 H264PROFILE_HIGH = 3, |
| 46 H264PROFILE_HIGH10PROFILE = 4, |
| 47 H264PROFILE_HIGH422PROFILE = 5, |
| 48 H264PROFILE_HIGH444PREDICTIVEPROFILE = 6, |
| 49 H264PROFILE_SCALABLEBASELINE = 7, |
| 50 H264PROFILE_SCALABLEHIGH = 8, |
| 51 H264PROFILE_STEREOHIGH = 9, |
| 52 H264PROFILE_MULTIVIEWHIGH = 10, |
| 53 VP8PROFILE_ANY = 11, |
| 54 VP9PROFILE_ANY = 12, |
| 55 VIDEO_CODEC_PROFILE_MAX = VP9PROFILE_ANY, |
| 56 }; |
| 57 |
| 58 // Specification of an encoding profile supported by a hardware encoder. |
| 59 struct GPU_EXPORT VideoEncodeAcceleratorSupportedProfile { |
| 60 VideoCodecProfile profile; |
| 61 gfx::Size max_resolution; |
| 62 uint32 max_framerate_numerator; |
| 63 uint32 max_framerate_denominator; |
| 64 }; |
| 65 |
37 struct GPU_EXPORT GPUInfo { | 66 struct GPU_EXPORT GPUInfo { |
38 struct GPU_EXPORT GPUDevice { | 67 struct GPU_EXPORT GPUDevice { |
39 GPUDevice(); | 68 GPUDevice(); |
40 ~GPUDevice(); | 69 ~GPUDevice(); |
41 | 70 |
42 // The DWORD (uint32) representing the graphics card vendor id. | 71 // The DWORD (uint32) representing the graphics card vendor id. |
43 uint32 vendor_id; | 72 uint32 vendor_id; |
44 | 73 |
45 // The DWORD (uint32) representing the graphics card device id. | 74 // The DWORD (uint32) representing the graphics card device id. |
46 // Device ids are unique to vendor, not to one another. | 75 // Device ids are unique to vendor, not to one another. |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 // if the collection fails or not. | 199 // if the collection fails or not. |
171 CollectInfoResult basic_info_state; | 200 CollectInfoResult basic_info_state; |
172 CollectInfoResult context_info_state; | 201 CollectInfoResult context_info_state; |
173 #if defined(OS_WIN) | 202 #if defined(OS_WIN) |
174 CollectInfoResult dx_diagnostics_info_state; | 203 CollectInfoResult dx_diagnostics_info_state; |
175 | 204 |
176 // The information returned by the DirectX Diagnostics Tool. | 205 // The information returned by the DirectX Diagnostics Tool. |
177 DxDiagNode dx_diagnostics; | 206 DxDiagNode dx_diagnostics; |
178 #endif | 207 #endif |
179 | 208 |
| 209 std::vector<VideoEncodeAcceleratorSupportedProfile> |
| 210 video_encode_accelerator_supported_profiles; |
180 // Note: when adding new members, please remember to update EnumerateFields | 211 // Note: when adding new members, please remember to update EnumerateFields |
181 // in gpu_info.cc. | 212 // in gpu_info.cc. |
182 | 213 |
183 // In conjunction with EnumerateFields, this allows the embedder to | 214 // In conjunction with EnumerateFields, this allows the embedder to |
184 // enumerate the values in this structure without having to embed | 215 // enumerate the values in this structure without having to embed |
185 // references to its specific member variables. This simplifies the | 216 // references to its specific member variables. This simplifies the |
186 // addition of new fields to this type. | 217 // addition of new fields to this type. |
187 class Enumerator { | 218 class Enumerator { |
188 public: | 219 public: |
189 // The following methods apply to the "current" object. Initially this | 220 // The following methods apply to the "current" object. Initially this |
190 // is the root object, but calls to BeginGPUDevice/EndGPUDevice and | 221 // is the root object, but calls to BeginGPUDevice/EndGPUDevice and |
191 // BeginAuxAttributes/EndAuxAttributes change the object to which these | 222 // BeginAuxAttributes/EndAuxAttributes change the object to which these |
192 // calls should apply. | 223 // calls should apply. |
193 virtual void AddInt64(const char* name, int64 value) = 0; | 224 virtual void AddInt64(const char* name, int64 value) = 0; |
194 virtual void AddInt(const char* name, int value) = 0; | 225 virtual void AddInt(const char* name, int value) = 0; |
195 virtual void AddString(const char* name, const std::string& value) = 0; | 226 virtual void AddString(const char* name, const std::string& value) = 0; |
196 virtual void AddBool(const char* name, bool value) = 0; | 227 virtual void AddBool(const char* name, bool value) = 0; |
197 virtual void AddTimeDeltaInSecondsF(const char* name, | 228 virtual void AddTimeDeltaInSecondsF(const char* name, |
198 const base::TimeDelta& value) = 0; | 229 const base::TimeDelta& value) = 0; |
199 | 230 |
200 // Markers indicating that a GPUDevice is being described. | 231 // Markers indicating that a GPUDevice is being described. |
201 virtual void BeginGPUDevice() = 0; | 232 virtual void BeginGPUDevice() = 0; |
202 virtual void EndGPUDevice() = 0; | 233 virtual void EndGPUDevice() = 0; |
203 | 234 |
204 // Markers indicating that a VideoEncodeAccelerator::SupportedProfile is | 235 // Markers indicating that a VideoEncodeAcceleratorSupportedProfile is |
205 // being described. | 236 // being described. |
206 virtual void BeginVideoEncodeAcceleratorSupportedProfile() = 0; | 237 virtual void BeginVideoEncodeAcceleratorSupportedProfile() = 0; |
207 virtual void EndVideoEncodeAcceleratorSupportedProfile() = 0; | 238 virtual void EndVideoEncodeAcceleratorSupportedProfile() = 0; |
208 | 239 |
209 // Markers indicating that "auxiliary" attributes of the GPUInfo | 240 // Markers indicating that "auxiliary" attributes of the GPUInfo |
210 // (according to the DevTools protocol) are being described. | 241 // (according to the DevTools protocol) are being described. |
211 virtual void BeginAuxAttributes() = 0; | 242 virtual void BeginAuxAttributes() = 0; |
212 virtual void EndAuxAttributes() = 0; | 243 virtual void EndAuxAttributes() = 0; |
213 | 244 |
214 protected: | 245 protected: |
215 virtual ~Enumerator() {} | 246 virtual ~Enumerator() {} |
216 }; | 247 }; |
217 | 248 |
218 // Outputs the fields in this structure to the provided enumerator. | 249 // Outputs the fields in this structure to the provided enumerator. |
219 void EnumerateFields(Enumerator* enumerator) const; | 250 void EnumerateFields(Enumerator* enumerator) const; |
220 }; | 251 }; |
221 | 252 |
222 } // namespace gpu | 253 } // namespace gpu |
223 | 254 |
224 #endif // GPU_CONFIG_GPU_INFO_H_ | 255 #endif // GPU_CONFIG_GPU_INFO_H_ |
OLD | NEW |