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

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 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 | « content/common/gpu/media/vaapi_wrapper.h ('k') | content/common/gpu/media/vt_video_decode_accelerator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 01119d093c24e07aecf594f08588b265f27f30b4..78d382e4c0aeb0e72b0dfb2c58e53eb348a5514d 100644
--- a/content/common/gpu/media/vaapi_wrapper.cc
+++ b/content/common/gpu/media/vaapi_wrapper.cc
@@ -167,9 +167,9 @@ scoped_ptr<VaapiWrapper> VaapiWrapper::CreateForVideoCodec(
}
// static
-std::vector<media::VideoEncodeAccelerator::SupportedProfile>
+media::VideoEncodeAccelerator::SupportedProfiles
VaapiWrapper::GetSupportedEncodeProfiles() {
- std::vector<media::VideoEncodeAccelerator::SupportedProfile> profiles;
+ media::VideoEncodeAccelerator::SupportedProfiles profiles;
const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess();
if (cmd_line->HasSwitch(switches::kDisableVaapiAcceleratedVideoEncode))
return profiles;
@@ -196,6 +196,31 @@ VaapiWrapper::GetSupportedEncodeProfiles() {
return profiles;
}
+// static
+media::VideoDecodeAccelerator::SupportedProfiles
+VaapiWrapper::GetSupportedDecodeProfiles() {
+ media::VideoDecodeAccelerator::SupportedProfiles 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,
« no previous file with comments | « content/common/gpu/media/vaapi_wrapper.h ('k') | content/common/gpu/media/vt_video_decode_accelerator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698