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

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

Issue 825843002: Add JPEG decoder for VAAPI JPEG decode acceleration (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mjpeg-vaapi-jpeg-parser
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.h
diff --git a/content/common/gpu/media/vaapi_wrapper.h b/content/common/gpu/media/vaapi_wrapper.h
index fe53552336badfe6bf46a3d3b624506820bf352f..d21f3f1ee5ec52ece294ce53594c01e4f7252846 100644
--- a/content/common/gpu/media/vaapi_wrapper.h
+++ b/content/common/gpu/media/vaapi_wrapper.h
@@ -45,10 +45,20 @@ 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.
static scoped_ptr<VaapiWrapper> Create(
CodecMode mode,
+ VAProfile profile,
+ const base::Closure& report_error_to_uma_cb);
+
+ // Create VaapiWrapper for VideoCodecProfile. It maps VideoCodecProfile
+ // |profile| to VAProfile.
+ // |report_error_to_uma_cb| will be called independently from reporting
+ // errors to clients via method return values.
+ static scoped_ptr<VaapiWrapper> CreateForVideoCodec(
+ CodecMode mode,
media::VideoCodecProfile profile,
const base::Closure& report_error_to_uma_cb);
@@ -118,16 +128,29 @@ class CONTENT_EXPORT VaapiWrapper {
// Returns true if the VAAPI version is less than the specified version.
bool VAAPIVersionLessThan(int major, int minor);
- // Get a VAImage from a VASurface and map it into memory. The VAImage should
- // be released using the ReturnVaImage function. Returns true when successful.
- // This is intended for testing only.
- bool GetVaImageForTesting(VASurfaceID va_surface_id,
- VAImage* image,
- void** mem);
+ // Get a VAImage from a VASurface and map it into memory. The size and format
+ // are derived from the surface. Use GetVaImage() instead if |format| or
+ // |size| are different from surface internal representation. The VAImage
+ // should be released using the ReturnVaImage function. Returns true when
+ // successful.
+ bool GetDerivedVaImage(VASurfaceID va_surface_id, VAImage* image, void** mem);
+
+ // Get a VAImage from a VASurface |va_surface_id| and map it into memory with
+ // given |format| and |size|. The output is |image| and the mapped memory is
+ // |mem|. If |format| doesn't equal to the internal format, the underlying
+ // implementation will do format conversion if supported. |size| should be
+ // smaller than or equal to the surface. If |size| is smaller, the image will
+ // be cropped. The VAImage should be released using the ReturnVaImage
+ // function. Returns true when successful.
+ bool GetVaImage(VASurfaceID va_surface_id,
+ VAImageFormat* format,
+ const gfx::Size& size,
+ VAImage* image,
+ void** mem);
// Release the VAImage (and the associated memory mapping) obtained from
- // GetVaImage(). This is intended for testing only.
- void ReturnVaImageForTesting(VAImage* image);
+ // GetVaImage() or GetDerivedVaImage().
+ void ReturnVaImage(VAImage* image);
// Upload contents of |frame| into |va_surface_id| for encode.
bool UploadVideoFrameToSurface(const scoped_refptr<media::VideoFrame>& frame,
@@ -162,9 +185,7 @@ class CONTENT_EXPORT VaapiWrapper {
private:
VaapiWrapper();
- bool Initialize(CodecMode mode,
- media::VideoCodecProfile profile,
- const base::Closure& report_error__to_uma_cb);
+ bool Initialize(CodecMode mode, VAProfile va_profile);
void Deinitialize();
bool VaInitialize(const base::Closure& report_error_to_uma_cb);
bool GetSupportedVaProfiles(std::vector<VAProfile>* profiles);
« no previous file with comments | « content/common/gpu/media/vaapi_video_encode_accelerator.cc ('k') | content/common/gpu/media/vaapi_wrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698