summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Bian <jonathan.bian@intel.com>2012-09-06 16:07:31 -0700
committerXiang, Haihao <haihao.xiang@intel.com>2013-06-05 09:38:35 +0800
commit35237ddff6cd278989a3c81e81de0a5bfa8fb12f (patch)
treea51162c1a6a9f2aafeb2a97cc2e8d61ed0dfbf58
parentaf00a1b232948563e97850e1310ca4d74bcdc859 (diff)
downloadlibva-35237ddff6cd278989a3c81e81de0a5bfa8fb12f.tar.gz
Added new surface attributes to enable VA surface creation from external buffers.
-rw-r--r--va/va.h51
-rw-r--r--va/va_android.h3
-rw-r--r--va/va_drmcommon.h5
3 files changed, 58 insertions, 1 deletions
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 <va/va.h>
+/** \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 */