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) { |
11 enumerator->BeginGPUDevice(); | 11 enumerator->BeginGPUDevice(); |
12 enumerator->AddInt("vendorId", device.vendor_id); | 12 enumerator->AddInt("vendorId", device.vendor_id); |
13 enumerator->AddInt("deviceId", device.device_id); | 13 enumerator->AddInt("deviceId", device.device_id); |
14 enumerator->AddBool("active", device.active); | 14 enumerator->AddBool("active", device.active); |
15 enumerator->AddString("vendorString", device.vendor_string); | 15 enumerator->AddString("vendorString", device.vendor_string); |
16 enumerator->AddString("deviceString", device.device_string); | 16 enumerator->AddString("deviceString", device.device_string); |
17 enumerator->EndGPUDevice(); | 17 enumerator->EndGPUDevice(); |
18 } | 18 } |
19 | 19 |
20 void EnumerateVideoEncodeAcceleratorSupportedProfile( | 20 void EnumerateVideoEncodeAcceleratorSupportedProfile( |
21 gpu::GPUInfo::Enumerator* enumerator, | 21 gpu::GPUInfo::Enumerator* enumerator, |
22 const media::VideoEncodeAccelerator::SupportedProfile profile) { | 22 const gpu::VideoEncodeAcceleratorSupportedProfile profile) { |
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 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 bool software_rendering; | 94 bool software_rendering; |
95 bool direct_rendering; | 95 bool direct_rendering; |
96 bool sandboxed; | 96 bool sandboxed; |
97 int process_crash_count; | 97 int process_crash_count; |
98 CollectInfoResult basic_info_state; | 98 CollectInfoResult basic_info_state; |
99 CollectInfoResult context_info_state; | 99 CollectInfoResult context_info_state; |
100 #if defined(OS_WIN) | 100 #if defined(OS_WIN) |
101 CollectInfoResult dx_diagnostics_info_state; | 101 CollectInfoResult dx_diagnostics_info_state; |
102 DxDiagNode dx_diagnostics; | 102 DxDiagNode dx_diagnostics; |
103 #endif | 103 #endif |
104 std::vector<media::VideoEncodeAccelerator::SupportedProfile> | 104 std::vector<VideoEncodeAcceleratorSupportedProfile> |
105 video_encode_accelerator_supported_profiles; | 105 video_encode_accelerator_supported_profiles; |
106 }; | 106 }; |
107 | 107 |
108 // If this assert fails then most likely something below needs to be updated. | 108 // 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 | 109 // 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. | 110 // GPUInfo which fits within the current padding then it will not be caught. |
111 COMPILE_ASSERT( | 111 COMPILE_ASSERT( |
112 sizeof(GPUInfo) == sizeof(GPUInfoKnownFields), | 112 sizeof(GPUInfo) == sizeof(GPUInfoKnownFields), |
113 Fields_Have_Changed_In_GPUInfo_So_Update_Below); | 113 Fields_Have_Changed_In_GPUInfo_So_Update_Below); |
114 | 114 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 // TODO(kbr): add dx_diagnostics on Windows. | 160 // TODO(kbr): add dx_diagnostics on Windows. |
161 for (size_t ii = 0; ii < video_encode_accelerator_supported_profiles.size(); | 161 for (size_t ii = 0; ii < video_encode_accelerator_supported_profiles.size(); |
162 ++ii) { | 162 ++ii) { |
163 EnumerateVideoEncodeAcceleratorSupportedProfile( | 163 EnumerateVideoEncodeAcceleratorSupportedProfile( |
164 enumerator, video_encode_accelerator_supported_profiles[ii]); | 164 enumerator, video_encode_accelerator_supported_profiles[ii]); |
165 } | 165 } |
166 enumerator->EndAuxAttributes(); | 166 enumerator->EndAuxAttributes(); |
167 } | 167 } |
168 | 168 |
169 } // namespace gpu | 169 } // namespace gpu |
OLD | NEW |