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

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

Issue 825163004: Add Vaapi support on Ozone/Freon (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: 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_wrapper.h
diff --git a/content/common/gpu/media/vaapi_wrapper.h b/content/common/gpu/media/vaapi_wrapper.h
index 242684e0315b6594f47692a121af7d63cd93aba3..7c1bf56ad3b7e12c386e19b9b08f1905902f0849 100644
--- a/content/common/gpu/media/vaapi_wrapper.h
+++ b/content/common/gpu/media/vaapi_wrapper.h
@@ -20,6 +20,7 @@
#include "media/base/video_decoder_config.h"
#include "media/base/video_frame.h"
#include "third_party/libva/va/va.h"
+#include "third_party/libva/va/va_vpp.h"
#include "ui/gfx/size.h"
#if defined(USE_X11)
#include "third_party/libva/va/va_x11.h"
@@ -71,6 +72,16 @@ class CONTENT_EXPORT VaapiWrapper {
// Free all memory allocated in CreateSurfaces.
void DestroySurfaces();
+ // Create a VASurface of |va_format|, |size| and using
+ // |num_va_attribs| attributes from |va_attribs|. The ownership of
+ // the surface is transfered to the caller. It differs from surfaces
Pawel Osciak 2014/12/26 00:38:56 s/transfered/transferred/
llandwerlin-old 2014/12/26 02:50:02 Done.
+ // created using CreateSurfaces() where VaapiWrapper is the owner of
Pawel Osciak 2014/12/26 00:38:56 s/()/(),/
llandwerlin-old 2014/12/26 02:50:02 Done.
+ // the surfaces.
+ scoped_refptr<VASurface> CreateUnownedSurface(unsigned int va_format,
Pawel Osciak 2014/12/26 00:38:56 Should we also be passing va_format to CreateSurfa
llandwerlin-old 2014/12/26 02:50:02 Surfaces used by the decoder/encoder are assumed t
+ const gfx::Size& size,
+ VASurfaceAttrib* va_attribs,
Pawel Osciak 2014/12/26 00:38:56 Could we instead pass a vector, remove num_va_attr
llandwerlin-old 2014/12/26 02:50:02 Done.
+ size_t num_va_attribs);
+
// Submit parameters or slice data of |va_buffer_type|, copying them from
// |buffer| of size |size|, into HW codec. The data in |buffer| is no
// longer needed and can be freed after this method returns.
@@ -141,6 +152,14 @@ class CONTENT_EXPORT VaapiWrapper {
// Destroy all previously-allocated (and not yet destroyed) coded buffers.
void DestroyCodedBuffers();
+ // Blits a VASurface |va_surface_id_src| into another VASurface
+ // |va_surface_id_dest| applying pixel format conversion and scaling
+ // if needed.
+ bool BlitSurface(VASurfaceID va_surface_id_src,
+ const gfx::Size& src_size,
+ VASurfaceID va_surface_id_dest,
+ const gfx::Size& dest_size);
+
private:
VaapiWrapper();
@@ -155,6 +174,16 @@ class CONTENT_EXPORT VaapiWrapper {
VAEntrypoint entrypoint,
const std::vector<VAConfigAttrib>& required_attribs);
+ // Destroys a |va_surface| created using CreateUnownedSurface.
+ void DestroyUnownedSurface(VASurfaceID va_surface);
Pawel Osciak 2014/12/26 00:38:56 s/va_surface/va_surface_id/
llandwerlin-old 2014/12/26 02:50:02 Done.
+
+ // Initialize the video post processing context with the |size| of
+ // the input pictures to be processed.
+ bool InitializeVpp_Locked();
+
+ // Deinitialize the video post processing context.
+ void DeinitializeVpp();
+
// Execute pending job in hardware and destroy pending buffers. Return false
// if vaapi driver refuses to accept parameter or slice buffers submitted
// by client, or if execution fails in hardware.
@@ -199,6 +228,11 @@ class CONTENT_EXPORT VaapiWrapper {
// return values from public methods.
base::Closure report_error_to_uma_cb_;
+ // VPP context
Pawel Osciak 2014/12/26 00:38:56 Please describe what VPP is and what it is used fo
llandwerlin-old 2014/12/26 02:50:02 Done.
+ VAConfigID va_vpp_config_id_;
+ VAContextID va_vpp_context_id_;
+ VABufferID va_vpp_buffer_id_;
+
DISALLOW_COPY_AND_ASSIGN(VaapiWrapper);
};

Powered by Google App Engine
This is Rietveld 408576698