Chromium Code Reviews| 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..32ff086a602ec003512d89b964b45a6af5644af6 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 according to supported profiles. |
|
wuchengli
2015/01/30 06:38:59
I'm not sure what "according to supported profiles
kcwu
2015/01/30 06:52:35
Done.
|
| + // |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, it will do format |
|
wuchengli
2015/01/30 06:38:59
s/it will do format.../the underlying implementati
kcwu
2015/01/30 06:52:34
Done.
|
| + // conversion if the underlying implementation supported. |size| should be |
| + // smaller or equal to the surface. If |size| is smaller, the image will be |
|
wuchengli
2015/01/30 06:38:59
s/smaller/smaller than/
wuchengli
2015/01/30 06:39:48
To be clear, I'm referring to the first "smaller".
kcwu
2015/01/30 06:52:35
Done.
|
| + // 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, |
| @@ -163,7 +186,7 @@ class CONTENT_EXPORT VaapiWrapper { |
| VaapiWrapper(); |
| bool Initialize(CodecMode mode, |
| - media::VideoCodecProfile profile, |
| + VAProfile va_profile, |
| const base::Closure& report_error__to_uma_cb); |
| void Deinitialize(); |
| bool VaInitialize(const base::Closure& report_error_to_uma_cb); |