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

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

Issue 872623002: VaapiVEA: Get maximum resolution from libva (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 63450b4a58001dba70505640f3b9197e7f75c896..8ef2f315b9774724dd8982715802e6713eb8761f 100644
--- a/content/common/gpu/media/vaapi_wrapper.cc
+++ b/content/common/gpu/media/vaapi_wrapper.cc
@@ -162,6 +162,7 @@ VaapiWrapper::~VaapiWrapper() {
Deinitialize();
}
+// static
scoped_ptr<VaapiWrapper> VaapiWrapper::Create(
CodecMode mode,
media::VideoCodecProfile profile,
@@ -174,6 +175,7 @@ scoped_ptr<VaapiWrapper> VaapiWrapper::Create(
return vaapi_wrapper.Pass();
}
+// static
std::vector<media::VideoCodecProfile> VaapiWrapper::GetSupportedEncodeProfiles(
const base::Closure& report_error_to_uma_cb) {
std::vector<media::VideoCodecProfile> supported_profiles;
@@ -338,6 +340,15 @@ bool VaapiWrapper::AreAttribsSupported(
return true;
}
+bool VaapiWrapper::GetVaCodecMaxResolution(gfx::Size* resolution) {
+ base::AutoLock auto_lock(va_lock_);
+ unsigned int width = 0, height = 0;
+ VAStatus va_res = vaGetCodecResolution(va_display_, &width, &height);
+ VA_SUCCESS_OR_RETURN(va_res, "vaGetCodecResolution failed", false);
+ resolution->SetSize(width, height);
+ return true;
+}
+
bool VaapiWrapper::Initialize(CodecMode mode,
media::VideoCodecProfile profile,
const base::Closure& report_error_to_uma_cb) {

Powered by Google App Engine
This is Rietveld 408576698