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

Unified 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: fix compile error Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/config/gpu_info.h ('k') | gpu/config/gpu_info_collector.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/config/gpu_info.cc
diff --git a/gpu/config/gpu_info.cc b/gpu/config/gpu_info.cc
index 3653a106b90cf39ed92d3343a397b04eb15f2a58..85d26fb584ad4bd2ca795dfff2ae864309ee5ffd 100644
--- a/gpu/config/gpu_info.cc
+++ b/gpu/config/gpu_info.cc
@@ -6,8 +6,8 @@
namespace {
-void EnumerateGPUDevice(gpu::GPUInfo::Enumerator* enumerator,
- const gpu::GPUInfo::GPUDevice& device) {
+void EnumerateGPUDevice(const gpu::GPUInfo::GPUDevice& device,
+ gpu::GPUInfo::Enumerator* enumerator) {
enumerator->BeginGPUDevice();
enumerator->AddInt("vendorId", device.vendor_id);
enumerator->AddInt("deviceId", device.device_id);
@@ -17,9 +17,21 @@ void EnumerateGPUDevice(gpu::GPUInfo::Enumerator* enumerator,
enumerator->EndGPUDevice();
}
+void EnumerateVideoDecodeAcceleratorSupportedProfile(
+ const gpu::VideoDecodeAcceleratorSupportedProfile& profile,
+ gpu::GPUInfo::Enumerator* enumerator) {
+ enumerator->BeginVideoDecodeAcceleratorSupportedProfile();
+ enumerator->AddInt("profile", profile.profile);
+ enumerator->AddInt("maxResolutionWidth", profile.max_resolution.width());
+ enumerator->AddInt("maxResolutionHeight", profile.max_resolution.height());
+ enumerator->AddInt("minResolutionWidth", profile.min_resolution.width());
+ enumerator->AddInt("minResolutionHeight", profile.min_resolution.height());
+ enumerator->EndVideoDecodeAcceleratorSupportedProfile();
+}
+
void EnumerateVideoEncodeAcceleratorSupportedProfile(
- gpu::GPUInfo::Enumerator* enumerator,
- const gpu::VideoEncodeAcceleratorSupportedProfile profile) {
+ const gpu::VideoEncodeAcceleratorSupportedProfile& profile,
+ gpu::GPUInfo::Enumerator* enumerator) {
enumerator->BeginVideoEncodeAcceleratorSupportedProfile();
enumerator->AddInt("profile", profile.profile);
enumerator->AddInt("maxResolutionWidth", profile.max_resolution.width());
@@ -101,7 +113,9 @@ void GPUInfo::EnumerateFields(Enumerator* enumerator) const {
CollectInfoResult dx_diagnostics_info_state;
DxDiagNode dx_diagnostics;
#endif
- std::vector<VideoEncodeAcceleratorSupportedProfile>
+ VideoDecodeAcceleratorSupportedProfiles
+ video_decode_accelerator_supported_profiles;
+ VideoEncodeAcceleratorSupportedProfiles
video_encode_accelerator_supported_profiles;
};
@@ -115,10 +129,9 @@ void GPUInfo::EnumerateFields(Enumerator* enumerator) const {
// Required fields (according to DevTools protocol) first.
enumerator->AddString("machineModelName", machine_model_name);
enumerator->AddString("machineModelVersion", machine_model_version);
- EnumerateGPUDevice(enumerator, gpu);
- for (size_t ii = 0; ii < secondary_gpus.size(); ++ii) {
- EnumerateGPUDevice(enumerator, secondary_gpus[ii]);
- }
+ EnumerateGPUDevice(gpu, enumerator);
+ for (const auto& secondary_gpu: secondary_gpus)
+ EnumerateGPUDevice(secondary_gpu, enumerator);
enumerator->BeginAuxAttributes();
enumerator->AddTimeDeltaInSecondsF("initializationTime",
@@ -159,11 +172,10 @@ void GPUInfo::EnumerateFields(Enumerator* enumerator) const {
enumerator->AddInt("DxDiagnosticsInfoState", dx_diagnostics_info_state);
#endif
// TODO(kbr): add dx_diagnostics on Windows.
- for (size_t ii = 0; ii < video_encode_accelerator_supported_profiles.size();
- ++ii) {
- EnumerateVideoEncodeAcceleratorSupportedProfile(
- enumerator, video_encode_accelerator_supported_profiles[ii]);
- }
+ for (const auto& profile : video_decode_accelerator_supported_profiles)
+ EnumerateVideoDecodeAcceleratorSupportedProfile(profile, enumerator);
+ for (const auto& profile : video_encode_accelerator_supported_profiles)
+ EnumerateVideoEncodeAcceleratorSupportedProfile(profile, enumerator);
enumerator->EndAuxAttributes();
}
« no previous file with comments | « gpu/config/gpu_info.h ('k') | gpu/config/gpu_info_collector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698