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

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

Issue 795633005: Add VDA supported profile to GPUInfo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: edit description 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 side-by-side diff with in-line comments
Download patch
Index: content/common/gpu/media/vaapi_video_decode_accelerator.cc
diff --git a/content/common/gpu/media/vaapi_video_decode_accelerator.cc b/content/common/gpu/media/vaapi_video_decode_accelerator.cc
index df1f6443421d197b67aa31ef61634307175a242d..65c1b2754aa3b4b0980df91e55f27738f447ccd3 100644
--- a/content/common/gpu/media/vaapi_video_decode_accelerator.cc
+++ b/content/common/gpu/media/vaapi_video_decode_accelerator.cc
@@ -3,6 +3,8 @@
// found in the LICENSE file.
#include "base/bind.h"
+#include "base/command_line.h"
+#include "base/cpu.h"
#include "base/debug/trace_event.h"
#include "base/logging.h"
#include "base/metrics/histogram.h"
@@ -13,7 +15,9 @@
#include "content/common/gpu/gpu_channel.h"
#include "content/common/gpu/media/vaapi_video_decode_accelerator.h"
#include "media/base/bind_to_current_loop.h"
+#include "media/base/media_switches.h"
#include "media/video/picture.h"
+#include "ui/gfx/x/x11_types.h"
#include "ui/gl/gl_bindings.h"
#include "ui/gl/scoped_binders.h"
@@ -226,6 +230,35 @@ VaapiVideoDecodeAccelerator::TFPPicture*
return it->second.get();
}
+// static
+std::vector<media::VideoDecodeAccelerator::SupportedProfile>
+VaapiVideoDecodeAccelerator::GetSupportedProfiles() {
+ std::vector<SupportedProfile> profiles;
+ std::vector<media::VideoCodecProfile> hw_profiles =
+ VaapiWrapper::GetSupportedProfiles(
+ gfx::GetXDisplay(), base::Bind(&base::DoNothing));
+
+ SupportedProfile profile;
+ profile.min_resolution.SetSize(1, 1);
+
+ // Ivy Bridge+ platforms can support more than 1920x1080.
+ base::CPU cpu;
+ const base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess();
+ bool hw_large_video_support = cmd_line->HasSwitch(
+ switches::kIgnoreResolutionLimitsForAcceleratedVideoDecode) ||
+ ((cpu.vendor_name() == "GenuineIntel") && cpu.model() >= 55);
+ if (hw_large_video_support)
+ profile.max_resolution.SetSize(4096, 2160);
+ else
+ profile.max_resolution.SetSize(1920, 1088);
+
+ for (size_t i = 0; i < hw_profiles.size(); i++) {
+ profile.profile = hw_profiles[i];
+ profiles.push_back(profile);
+ }
+ return profiles;
+}
+
VaapiVideoDecodeAccelerator::VaapiVideoDecodeAccelerator(
Display* x_display,
const base::Callback<bool(void)>& make_context_current)

Powered by Google App Engine
This is Rietveld 408576698