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 "media/video/video_encode_accelerator.h" | 21 #include "ui/gfx/geometry/size.h" |
22 | 22 |
23 namespace gpu { | 23 namespace gpu { |
24 | 24 |
25 // Result for the various Collect*Info* functions below. | 25 // Result for the various Collect*Info* functions below. |
26 // 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 |
27 // something, making the use of the GPU impossible. | 27 // something, making the use of the GPU impossible. |
28 // 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 |
29 // 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 |
30 // model). | 30 // model). |
31 enum CollectInfoResult { | 31 enum CollectInfoResult { |
32 kCollectInfoNone = 0, | 32 kCollectInfoNone = 0, |
33 kCollectInfoSuccess = 1, | 33 kCollectInfoSuccess = 1, |
34 kCollectInfoNonFatalFailure = 2, | 34 kCollectInfoNonFatalFailure = 2, |
35 kCollectInfoFatalFailure = 3 | 35 kCollectInfoFatalFailure = 3 |
36 }; | 36 }; |
37 | 37 |
38 // Specification of an encoding profile supported by a hardware encoder. | |
39 struct GPU_EXPORT VideoEncodeAcceleratorSupportedProfile { | |
40 // This is media::VideoCodecProfile. Use int to avoid the dependency on media. | |
piman
2014/10/21 19:41:53
Can you move the enum here?
| |
41 int profile; | |
42 gfx::Size max_resolution; | |
43 uint32 max_framerate_numerator; | |
44 uint32 max_framerate_denominator; | |
45 }; | |
46 | |
38 struct GPU_EXPORT GPUInfo { | 47 struct GPU_EXPORT GPUInfo { |
39 struct GPU_EXPORT GPUDevice { | 48 struct GPU_EXPORT GPUDevice { |
40 GPUDevice(); | 49 GPUDevice(); |
41 ~GPUDevice(); | 50 ~GPUDevice(); |
42 | 51 |
43 // The DWORD (uint32) representing the graphics card vendor id. | 52 // The DWORD (uint32) representing the graphics card vendor id. |
44 uint32 vendor_id; | 53 uint32 vendor_id; |
45 | 54 |
46 // The DWORD (uint32) representing the graphics card device id. | 55 // The DWORD (uint32) representing the graphics card device id. |
47 // Device ids are unique to vendor, not to one another. | 56 // Device ids are unique to vendor, not to one another. |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
171 // if the collection fails or not. | 180 // if the collection fails or not. |
172 CollectInfoResult basic_info_state; | 181 CollectInfoResult basic_info_state; |
173 CollectInfoResult context_info_state; | 182 CollectInfoResult context_info_state; |
174 #if defined(OS_WIN) | 183 #if defined(OS_WIN) |
175 CollectInfoResult dx_diagnostics_info_state; | 184 CollectInfoResult dx_diagnostics_info_state; |
176 | 185 |
177 // The information returned by the DirectX Diagnostics Tool. | 186 // The information returned by the DirectX Diagnostics Tool. |
178 DxDiagNode dx_diagnostics; | 187 DxDiagNode dx_diagnostics; |
179 #endif | 188 #endif |
180 | 189 |
181 std::vector<media::VideoEncodeAccelerator::SupportedProfile> | 190 std::vector<VideoEncodeAcceleratorSupportedProfile> |
182 video_encode_accelerator_supported_profiles; | 191 video_encode_accelerator_supported_profiles; |
183 // Note: when adding new members, please remember to update EnumerateFields | 192 // Note: when adding new members, please remember to update EnumerateFields |
184 // in gpu_info.cc. | 193 // in gpu_info.cc. |
185 | 194 |
186 // In conjunction with EnumerateFields, this allows the embedder to | 195 // In conjunction with EnumerateFields, this allows the embedder to |
187 // enumerate the values in this structure without having to embed | 196 // enumerate the values in this structure without having to embed |
188 // references to its specific member variables. This simplifies the | 197 // references to its specific member variables. This simplifies the |
189 // addition of new fields to this type. | 198 // addition of new fields to this type. |
190 class Enumerator { | 199 class Enumerator { |
191 public: | 200 public: |
192 // The following methods apply to the "current" object. Initially this | 201 // The following methods apply to the "current" object. Initially this |
193 // is the root object, but calls to BeginGPUDevice/EndGPUDevice and | 202 // is the root object, but calls to BeginGPUDevice/EndGPUDevice and |
194 // BeginAuxAttributes/EndAuxAttributes change the object to which these | 203 // BeginAuxAttributes/EndAuxAttributes change the object to which these |
195 // calls should apply. | 204 // calls should apply. |
196 virtual void AddInt64(const char* name, int64 value) = 0; | 205 virtual void AddInt64(const char* name, int64 value) = 0; |
197 virtual void AddInt(const char* name, int value) = 0; | 206 virtual void AddInt(const char* name, int value) = 0; |
198 virtual void AddString(const char* name, const std::string& value) = 0; | 207 virtual void AddString(const char* name, const std::string& value) = 0; |
199 virtual void AddBool(const char* name, bool value) = 0; | 208 virtual void AddBool(const char* name, bool value) = 0; |
200 virtual void AddTimeDeltaInSecondsF(const char* name, | 209 virtual void AddTimeDeltaInSecondsF(const char* name, |
201 const base::TimeDelta& value) = 0; | 210 const base::TimeDelta& value) = 0; |
202 | 211 |
203 // Markers indicating that a GPUDevice is being described. | 212 // Markers indicating that a GPUDevice is being described. |
204 virtual void BeginGPUDevice() = 0; | 213 virtual void BeginGPUDevice() = 0; |
205 virtual void EndGPUDevice() = 0; | 214 virtual void EndGPUDevice() = 0; |
206 | 215 |
207 // Markers indicating that a VideoEncodeAccelerator::SupportedProfile is | 216 // Markers indicating that a VideoEncodeAcceleratorSupportedProfile is |
208 // being described. | 217 // being described. |
209 virtual void BeginVideoEncodeAcceleratorSupportedProfile() = 0; | 218 virtual void BeginVideoEncodeAcceleratorSupportedProfile() = 0; |
210 virtual void EndVideoEncodeAcceleratorSupportedProfile() = 0; | 219 virtual void EndVideoEncodeAcceleratorSupportedProfile() = 0; |
211 | 220 |
212 // Markers indicating that "auxiliary" attributes of the GPUInfo | 221 // Markers indicating that "auxiliary" attributes of the GPUInfo |
213 // (according to the DevTools protocol) are being described. | 222 // (according to the DevTools protocol) are being described. |
214 virtual void BeginAuxAttributes() = 0; | 223 virtual void BeginAuxAttributes() = 0; |
215 virtual void EndAuxAttributes() = 0; | 224 virtual void EndAuxAttributes() = 0; |
216 | 225 |
217 protected: | 226 protected: |
218 virtual ~Enumerator() {} | 227 virtual ~Enumerator() {} |
219 }; | 228 }; |
220 | 229 |
221 // Outputs the fields in this structure to the provided enumerator. | 230 // Outputs the fields in this structure to the provided enumerator. |
222 void EnumerateFields(Enumerator* enumerator) const; | 231 void EnumerateFields(Enumerator* enumerator) const; |
223 }; | 232 }; |
224 | 233 |
225 } // namespace gpu | 234 } // namespace gpu |
226 | 235 |
227 #endif // GPU_CONFIG_GPU_INFO_H_ | 236 #endif // GPU_CONFIG_GPU_INFO_H_ |
OLD | NEW |