Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(108)

Side by Side Diff: gpu/config/gpu_info.cc

Issue 568413002: Add VEA supported profiles to GPUInfo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use GPUInfo Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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(
21 gpu::GPUInfo::Enumerator* enumerator,
22 const media::VideoEncodeAccelerator::SupportedProfile profile) {
23 enumerator->BeginVideoEncodeAcceleratorSupportedProfile();
24 enumerator->AddInt("profile", profile.profile);
25 enumerator->AddInt("maxResolutionWidth", profile.max_resolution.width());
26 enumerator->AddInt("maxResolutionHeight", profile.max_resolution.height());
27 enumerator->AddInt("maxFramerateNumerator", profile.max_framerate_numerator);
28 enumerator->AddInt("maxFramerateDenominator",
29 profile.max_framerate_denominator);
30 enumerator->EndVideoEncodeAcceleratorSupportedProfile();
31 }
32
20 } // namespace 33 } // namespace
21 34
22 namespace gpu { 35 namespace gpu {
23 36
24 GPUInfo::GPUDevice::GPUDevice() 37 GPUInfo::GPUDevice::GPUDevice()
25 : vendor_id(0), 38 : vendor_id(0),
26 device_id(0), 39 device_id(0),
27 active(false) { 40 active(false) {
28 } 41 }
29 42
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 bool software_rendering; 94 bool software_rendering;
82 bool direct_rendering; 95 bool direct_rendering;
83 bool sandboxed; 96 bool sandboxed;
84 int process_crash_count; 97 int process_crash_count;
85 CollectInfoResult basic_info_state; 98 CollectInfoResult basic_info_state;
86 CollectInfoResult context_info_state; 99 CollectInfoResult context_info_state;
87 #if defined(OS_WIN) 100 #if defined(OS_WIN)
88 CollectInfoResult dx_diagnostics_info_state; 101 CollectInfoResult dx_diagnostics_info_state;
89 DxDiagNode dx_diagnostics; 102 DxDiagNode dx_diagnostics;
90 #endif 103 #endif
104 std::vector<media::VideoEncodeAccelerator::SupportedProfile>
105 video_encode_accelerator_supported_profiles;
91 }; 106 };
92 107
93 // 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.
94 // 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
95 // 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.
96 COMPILE_ASSERT( 111 COMPILE_ASSERT(
97 sizeof(GPUInfo) == sizeof(GPUInfoKnownFields), 112 sizeof(GPUInfo) == sizeof(GPUInfoKnownFields),
98 Fields_Have_Changed_In_GPUInfo_So_Update_Below); 113 Fields_Have_Changed_In_GPUInfo_So_Update_Below);
99 114
100 // Required fields (according to DevTools protocol) first. 115 // Required fields (according to DevTools protocol) first.
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 enumerator->AddBool("softwareRendering", software_rendering); 151 enumerator->AddBool("softwareRendering", software_rendering);
137 enumerator->AddBool("directRendering", direct_rendering); 152 enumerator->AddBool("directRendering", direct_rendering);
138 enumerator->AddBool("sandboxed", sandboxed); 153 enumerator->AddBool("sandboxed", sandboxed);
139 enumerator->AddInt("processCrashCount", process_crash_count); 154 enumerator->AddInt("processCrashCount", process_crash_count);
140 enumerator->AddInt("basicInfoState", basic_info_state); 155 enumerator->AddInt("basicInfoState", basic_info_state);
141 enumerator->AddInt("contextInfoState", context_info_state); 156 enumerator->AddInt("contextInfoState", context_info_state);
142 #if defined(OS_WIN) 157 #if defined(OS_WIN)
143 enumerator->AddInt("DxDiagnosticsInfoState", dx_diagnostics_info_state); 158 enumerator->AddInt("DxDiagnosticsInfoState", dx_diagnostics_info_state);
144 #endif 159 #endif
145 // 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();
162 ++ii) {
163 EnumerateVideoEncodeAcceleratorSupportedProfile(
164 enumerator, video_encode_accelerator_supported_profiles[ii]);
165 }
146 enumerator->EndAuxAttributes(); 166 enumerator->EndAuxAttributes();
147 } 167 }
148 168
149 } // namespace gpu 169 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698