OSDN Git Service

Added new surface attributes to enable VA surface creation from external buffers.
authorJonathan Bian <jonathan.bian@intel.com>
Thu, 6 Sep 2012 23:07:31 +0000 (16:07 -0700)
committerXiang, Haihao <haihao.xiang@intel.com>
Wed, 5 Jun 2013 01:38:35 +0000 (09:38 +0800)
va/va.h
va/va_android.h
va/va_drmcommon.h

diff --git a/va/va.h b/va/va.h
index f7b95a3..1ab55de 100644 (file)
--- 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.
  *
index ca73b84..a9a8e52 100644 (file)
@@ -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
index bb00fd4..47dd371 100644 (file)
@@ -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 */