From 35237ddff6cd278989a3c81e81de0a5bfa8fb12f Mon Sep 17 00:00:00 2001 From: Jonathan Bian Date: Thu, 6 Sep 2012 16:07:31 -0700 Subject: Added new surface attributes to enable VA surface creation from external buffers. --- va/va.h | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++- va/va_android.h | 3 +++ va/va_drmcommon.h | 5 +++++ 3 files changed, 58 insertions(+), 1 deletion(-) (limited to 'va') diff --git a/va/va.h b/va/va.h index f7b95a3..1ab55de 100644 --- a/va/va.h +++ b/va/va.h @@ -645,7 +645,7 @@ typedef enum { * zero and drops the \c VA_SURFACE_ATTRIB_SETTABLE flag. */ VASurfaceAttribPixelFormat, - /** \brief Minimal width in pixels (int, read/write). */ + /** \brief Minimal width in pixels (int, read-only). */ VASurfaceAttribMinWidth, /** \brief Maximal width in pixels (int, read-only). */ VASurfaceAttribMaxWidth, @@ -653,6 +653,10 @@ typedef enum { VASurfaceAttribMinHeight, /** \brief Maximal height in pixels (int, read-only). */ VASurfaceAttribMaxHeight, + /** \brief Surface memory type in fourcc (int, read/write). */ + VASurfaceAttribMemoryType, + /** \brief External buffer descriptor (pointer, write). */ + VASurfaceAttribExternalBufferDescriptor, /** \brief Number of surface attributes. */ VASurfaceAttribCount } VASurfaceAttribType; @@ -667,6 +671,51 @@ typedef struct _VASurfaceAttrib { VAGenericValue value; } VASurfaceAttrib; +/** @name VASurfaceAttribMemoryType values in fourcc */ +/**@{*/ +/** \brief VA memory type (default) is supported. VAVA in fourcc */ +#define VA_SURFACE_ATTRIB_MEM_TYPE_VA 0x41564156 +/** \brief V4L2 buffer memory type is supported. V4L2 in fourcc */ +#define VA_SURFACE_ATTRIB_MEM_TYPE_V4L2 0x324C3456 +/** \brief User pointer memory type is supported. UPTR in fourcc */ +#define VA_SURFACE_ATTRIB_MEM_TYPE_USER_PTR 0x52545055 +/**@}*/ + +/** + * \brief VASurfaceAttribExternalBuffers structure for + * the VASurfaceAttribExternalBufferDescriptor attribute. + */ +typedef struct _VASurfaceAttribExternalBuffers { + /** \brief pixel format in fourcc. */ + unsigned int pixel_format; + /** \brief width in pixels. */ + unsigned int width; + /** \brief height in pixels. */ + unsigned int height; + /** \brief total size of the buffer in bytes. */ + unsigned int data_size; + /** \brief number of planes for planar layout */ + unsigned int num_planes; + /** \brief pitch for each plane in bytes */ + unsigned int pitches[4]; + /** \brief offset for each plane in bytes */ + unsigned int offsets[4]; + /** \brief buffer handles or user pointers */ + unsigned long *buffers; + /** \brief number of elements in the "buffers" array */ + unsigned int num_buffers; + /** \brief flags. See "Surface external buffer descriptor flags". */ + unsigned int flags; + /** \brief reserved for passing private data */ + void *private_data; +} VASurfaceAttribExternalBuffers; + +/** @name VASurfaceAttribExternalBuffers flags */ +/**@{*/ +/** \brief Enable memory tiling */ +#define VA_SURFACE_EXTBUF_DESC_ENABLE_TILING 0x00000001 +/**@}*/ + /** * \brief Get surface attributes for the supplied config. * diff --git a/va/va_android.h b/va/va_android.h index ca73b84..a9a8e52 100644 --- a/va/va_android.h +++ b/va/va_android.h @@ -26,6 +26,9 @@ #include +/** \brief Android Gralloc buffer memory type "AGRA" in fourcc */ +#define VA_SURFACE_ATTRIB_MEM_TYPE_ANDROID_GRALLOC 0x41524741 + #ifdef __cplusplus extern "C" { #endif diff --git a/va/va_drmcommon.h b/va/va_drmcommon.h index bb00fd4..47dd371 100644 --- a/va/va_drmcommon.h +++ b/va/va_drmcommon.h @@ -68,4 +68,9 @@ struct drm_state { int auth_type; }; +/** \brief Kernel DRM buffer memory type "KDRM" in fourcc */ +#define VA_SURFACE_ATTRIB_MEM_TYPE_KERNEL_DRM 0x4D52444B +/** \brief DRM PRIME memory type "DPRI" in fourcc */ +#define VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME 0x49525044 + #endif /* VA_DRM_COMMON_H */ -- cgit v1.2.3