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

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

Issue 795633005: Add VDA supported profile to GPUInfo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address patch set 6 review comments Created 6 years 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 EnumerateVideoDecodeAcceleratorSupportedResolution(
wuchengli 2014/12/23 03:37:20 According to the style guide, the input parameter
henryhsu 2014/12/23 05:52:06 Done.
21 gpu::GPUInfo::Enumerator* enumerator,
22 const gpu::VideoDecodeAcceleratorSupportedResolution& resolution) {
23 enumerator->AddInt(
24 "videoDecodeAcceleratorSupportedResolutionMinWidth",
25 resolution.min.width());
26 enumerator->AddInt(
27 "videoDecodeAcceleratorSupportedResolutionMinHeight",
28 resolution.min.height());
29 enumerator->AddInt(
30 "videoDecodeAcceleratorSupportedResolutionMaxWidth",
31 resolution.max.width());
32 enumerator->AddInt(
33 "videoDecodeAcceleratorSupportedResolutionMaxHeight",
34 resolution.max.height());
35 }
36
20 void EnumerateVideoEncodeAcceleratorSupportedProfile( 37 void EnumerateVideoEncodeAcceleratorSupportedProfile(
21 gpu::GPUInfo::Enumerator* enumerator, 38 gpu::GPUInfo::Enumerator* enumerator,
22 const gpu::VideoEncodeAcceleratorSupportedProfile profile) { 39 const gpu::VideoEncodeAcceleratorSupportedProfile& profile) {
23 enumerator->BeginVideoEncodeAcceleratorSupportedProfile(); 40 enumerator->BeginVideoEncodeAcceleratorSupportedProfile();
24 enumerator->AddInt("profile", profile.profile); 41 enumerator->AddInt("profile", profile.profile);
25 enumerator->AddInt("maxResolutionWidth", profile.max_resolution.width()); 42 enumerator->AddInt("maxResolutionWidth", profile.max_resolution.width());
26 enumerator->AddInt("maxResolutionHeight", profile.max_resolution.height()); 43 enumerator->AddInt("maxResolutionHeight", profile.max_resolution.height());
27 enumerator->AddInt("maxFramerateNumerator", profile.max_framerate_numerator); 44 enumerator->AddInt("maxFramerateNumerator", profile.max_framerate_numerator);
28 enumerator->AddInt("maxFramerateDenominator", 45 enumerator->AddInt("maxFramerateDenominator",
29 profile.max_framerate_denominator); 46 profile.max_framerate_denominator);
30 enumerator->EndVideoEncodeAcceleratorSupportedProfile(); 47 enumerator->EndVideoEncodeAcceleratorSupportedProfile();
31 } 48 }
32 49
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 bool software_rendering; 111 bool software_rendering;
95 bool direct_rendering; 112 bool direct_rendering;
96 bool sandboxed; 113 bool sandboxed;
97 int process_crash_count; 114 int process_crash_count;
98 CollectInfoResult basic_info_state; 115 CollectInfoResult basic_info_state;
99 CollectInfoResult context_info_state; 116 CollectInfoResult context_info_state;
100 #if defined(OS_WIN) 117 #if defined(OS_WIN)
101 CollectInfoResult dx_diagnostics_info_state; 118 CollectInfoResult dx_diagnostics_info_state;
102 DxDiagNode dx_diagnostics; 119 DxDiagNode dx_diagnostics;
103 #endif 120 #endif
121 VideoDecodeAcceleratorSupportedResolution
122 video_decode_accelerator_supported_resolution;
104 std::vector<VideoEncodeAcceleratorSupportedProfile> 123 std::vector<VideoEncodeAcceleratorSupportedProfile>
105 video_encode_accelerator_supported_profiles; 124 video_encode_accelerator_supported_profiles;
106 }; 125 };
107 126
108 // If this assert fails then most likely something below needs to be updated. 127 // 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 128 // 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. 129 // GPUInfo which fits within the current padding then it will not be caught.
111 COMPILE_ASSERT( 130 COMPILE_ASSERT(
112 sizeof(GPUInfo) == sizeof(GPUInfoKnownFields), 131 sizeof(GPUInfo) == sizeof(GPUInfoKnownFields),
113 Fields_Have_Changed_In_GPUInfo_So_Update_Below); 132 Fields_Have_Changed_In_GPUInfo_So_Update_Below);
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 enumerator->AddBool("softwareRendering", software_rendering); 170 enumerator->AddBool("softwareRendering", software_rendering);
152 enumerator->AddBool("directRendering", direct_rendering); 171 enumerator->AddBool("directRendering", direct_rendering);
153 enumerator->AddBool("sandboxed", sandboxed); 172 enumerator->AddBool("sandboxed", sandboxed);
154 enumerator->AddInt("processCrashCount", process_crash_count); 173 enumerator->AddInt("processCrashCount", process_crash_count);
155 enumerator->AddInt("basicInfoState", basic_info_state); 174 enumerator->AddInt("basicInfoState", basic_info_state);
156 enumerator->AddInt("contextInfoState", context_info_state); 175 enumerator->AddInt("contextInfoState", context_info_state);
157 #if defined(OS_WIN) 176 #if defined(OS_WIN)
158 enumerator->AddInt("DxDiagnosticsInfoState", dx_diagnostics_info_state); 177 enumerator->AddInt("DxDiagnosticsInfoState", dx_diagnostics_info_state);
159 #endif 178 #endif
160 // TODO(kbr): add dx_diagnostics on Windows. 179 // TODO(kbr): add dx_diagnostics on Windows.
180 EnumerateVideoDecodeAcceleratorSupportedResolution(
181 enumerator, video_decode_accelerator_supported_resolution);
161 for (size_t ii = 0; ii < video_encode_accelerator_supported_profiles.size(); 182 for (size_t ii = 0; ii < video_encode_accelerator_supported_profiles.size();
162 ++ii) { 183 ++ii) {
163 EnumerateVideoEncodeAcceleratorSupportedProfile( 184 EnumerateVideoEncodeAcceleratorSupportedProfile(
164 enumerator, video_encode_accelerator_supported_profiles[ii]); 185 enumerator, video_encode_accelerator_supported_profiles[ii]);
165 } 186 }
166 enumerator->EndAuxAttributes(); 187 enumerator->EndAuxAttributes();
167 } 188 }
168 189
169 } // namespace gpu 190 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698