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

Unified Diff: content/common/gpu/media/vaapi_wrapper.cc

Issue 795633005: Add VDA supported profile to GPUInfo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix nit Created 5 years, 9 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
Index: content/common/gpu/media/vaapi_wrapper.cc
diff --git a/content/common/gpu/media/vaapi_wrapper.cc b/content/common/gpu/media/vaapi_wrapper.cc
index c267af50bd4cd9ae4cedb77c6cd575d752d88539..9721d30e2deaa9a6965d1dd412fa38b6f9ebe10c 100644
--- a/content/common/gpu/media/vaapi_wrapper.cc
+++ b/content/common/gpu/media/vaapi_wrapper.cc
@@ -196,6 +196,35 @@ VaapiWrapper::GetSupportedEncodeProfiles() {
return profiles;
}
+// static
+std::vector<media::VideoDecodeAccelerator::SupportedProfile>
+VaapiWrapper::GetSupportedDecodeProfiles() {
+ std::vector<media::VideoDecodeAccelerator::SupportedProfile> profiles;
+ const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess();
+ if (cmd_line->HasSwitch(switches::kDisableAcceleratedVideoDecode))
Pawel Osciak 2015/03/26 08:36:40 Can we do this in the caller? Otherwise this flag
henryhsu_tw 2015/03/26 09:38:34 Done.
+ return profiles;
+
+ std::vector<ProfileInfo> decode_profile_infos =
+ profile_infos_.Get().GetSupportedProfileInfosForCodecMode(kDecode);
+
+ for (size_t i = 0; i < arraysize(kProfileMap); ++i) {
+ VAProfile va_profile = ProfileToVAProfile(kProfileMap[i].profile, kDecode);
+ if (va_profile == VAProfileNone)
+ continue;
+ for (const auto& profile_info : decode_profile_infos) {
+ if (profile_info.va_profile == va_profile) {
+ media::VideoDecodeAccelerator::SupportedProfile profile;
+ profile.profile = kProfileMap[i].profile;
+ profile.max_resolution = profile_info.max_resolution;
+ profile.min_resolution.SetSize(16, 16);
+ profiles.push_back(profile);
+ break;
+ }
+ }
+ }
+ return profiles;
+}
+
void VaapiWrapper::TryToSetVADisplayAttributeToLocalGPU() {
base::AutoLock auto_lock(va_lock_);
VADisplayAttribute item = {VADisplayAttribRenderMode,

Powered by Google App Engine
This is Rietveld 408576698