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.h

Issue 872623002: VaapiVEA: Get maximum resolution from libva (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments Created 5 years, 10 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.h
diff --git a/content/common/gpu/media/vaapi_wrapper.h b/content/common/gpu/media/vaapi_wrapper.h
index d21f3f1ee5ec52ece294ce53594c01e4f7252846..307c11fe69d3d79f0b7aba5473ce6738f75334fd 100644
--- a/content/common/gpu/media/vaapi_wrapper.h
+++ b/content/common/gpu/media/vaapi_wrapper.h
@@ -19,6 +19,7 @@
#include "content/common/gpu/media/va_surface.h"
#include "media/base/video_decoder_config.h"
#include "media/base/video_frame.h"
+#include "media/video/video_encode_accelerator.h"
#include "third_party/libva/va/va.h"
#include "third_party/libva/va/va_vpp.h"
#include "ui/gfx/geometry/size.h"
@@ -45,12 +46,18 @@ class CONTENT_EXPORT VaapiWrapper {
kEncode,
};
- // Create VaapiWrapper for VAProfile.
- // |report_error_to_uma_cb| will be called independently from reporting
- // errors to clients via method return values.
+ struct ProfileConfig {
wuchengli 2015/02/13 15:38:55 This name is not good. This is not a VAConfig. Thi
henryhsu 2015/02/13 17:24:28 Done.
+ VAProfile va_profile;
+ VaapiWrapper::CodecMode mode;
wuchengli 2015/02/13 15:38:55 This field is redundant. All |mode| of |supported_
henryhsu 2015/02/13 17:24:28 InitSupportedProfileConfigs returns a vector of Pr
+ gfx::Size max_resolution;
+ };
+
+ // Return an instance of VaapiWrapper and initialize by |profile| and
+ // |mode|. |report_error_to_uma_cb| will be called independently from
+ // reporting errors to clients via method return values.
static scoped_ptr<VaapiWrapper> Create(
CodecMode mode,
- VAProfile profile,
+ VAProfile va_profile,
const base::Closure& report_error_to_uma_cb);
// Create VaapiWrapper for VideoCodecProfile. It maps VideoCodecProfile
@@ -63,8 +70,11 @@ class CONTENT_EXPORT VaapiWrapper {
const base::Closure& report_error_to_uma_cb);
// Return the supported encode profiles.
- static std::vector<media::VideoCodecProfile> GetSupportedEncodeProfiles(
- const base::Closure& report_error_to_uma_cb);
+ static std::vector<media::VideoEncodeAccelerator::SupportedProfile>
+ GetSupportedEncodeProfiles();
+
+ // Initialize all supported profile configs.
+ static std::vector<ProfileConfig> InitSupportedProfileConfigs();
wuchengli 2015/02/13 15:38:55 this should be private.
henryhsu 2015/02/13 17:24:28 Done.
~VaapiWrapper();
@@ -193,6 +203,7 @@ class CONTENT_EXPORT VaapiWrapper {
bool AreAttribsSupported(VAProfile va_profile,
VAEntrypoint entrypoint,
const std::vector<VAConfigAttrib>& required_attribs);
+ bool GetVaCodecMaxResolution(VAConfigID config, gfx::Size* resolution);
// Destroys a |va_surface| created using CreateUnownedSurface.
void DestroyUnownedSurface(VASurfaceID va_surface_id);
@@ -212,6 +223,9 @@ class CONTENT_EXPORT VaapiWrapper {
// Attempt to set render mode to "render to texture.". Failure is non-fatal.
void TryToSetVADisplayAttributeToLocalGPU();
+ // Get all supported profile configs.
+ std::vector<ProfileConfig> GetSupportedProfileConfigs();
+
// Lazily initialize static data after sandbox is enabled. Return false on
// init failure.
static bool PostSandboxInitialization();
@@ -258,6 +272,17 @@ class CONTENT_EXPORT VaapiWrapper {
DISALLOW_COPY_AND_ASSIGN(VaapiWrapper);
};
+class CONTENT_EXPORT LazyProfileConfig {
wuchengli 2015/02/13 15:38:55 This is not used by other classes. Move this to va
henryhsu 2015/02/13 17:24:28 Done.
+ public:
+ LazyProfileConfig();
+ ~LazyProfileConfig();
+ std::vector<VaapiWrapper::ProfileConfig> GetSupportedEncodeProfileConfigs();
+ std::vector<VaapiWrapper::ProfileConfig> GetSupportedDecodeProfileConfigs();
+ private:
+ std::vector<VaapiWrapper::ProfileConfig> supported_encode_profiles_;
+ std::vector<VaapiWrapper::ProfileConfig> supported_decode_profiles_;
+};
+
} // namespace content
#endif // CONTENT_COMMON_GPU_MEDIA_VAAPI_WRAPPER_H_

Powered by Google App Engine
This is Rietveld 408576698