From 5f762795ebc7ba1d54c104bd3c4cc26a22c96f8a Mon Sep 17 00:00:00 2001 From: Jonathan Bian Date: Sun, 16 Sep 2012 21:26:00 -0700 Subject: [PATCH] Changed values for VASurfaceAttribMemoryType from fourcc to bit fields. --- va/va.h | 21 +++++++++++++-------- va/va_android.h | 4 ++-- va/va_drmcommon.h | 8 ++++---- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/va/va.h b/va/va.h index 78e0e9f..42b77f8 100644 --- a/va/va.h +++ b/va/va.h @@ -655,7 +655,7 @@ typedef enum { VASurfaceAttribMinHeight, /** \brief Maximal height in pixels (int, read-only). */ VASurfaceAttribMaxHeight, - /** \brief Surface memory type in fourcc (int, read/write). */ + /** \brief Surface memory type expressed in bit fields (int, read/write). */ VASurfaceAttribMemoryType, /** \brief External buffer descriptor (pointer, write). */ VASurfaceAttribExternalBufferDescriptor, @@ -673,14 +673,19 @@ typedef struct _VASurfaceAttrib { VAGenericValue value; } VASurfaceAttrib; -/** @name VASurfaceAttribMemoryType values in fourcc */ +/** + * @name VASurfaceAttribMemoryType values in bit fields. + * Bit 0:7 are reserved for generic types, Bit 31:28 are reserved for + * Linux DRM, Bit 23:20 are reserved for Android. DRM and Android specific + * types are defined in DRM and Android header files. + */ /**@{*/ -/** \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 VA memory type (default) is supported. */ +#define VA_SURFACE_ATTRIB_MEM_TYPE_VA 0x00000001 +/** \brief V4L2 buffer memory type is supported. */ +#define VA_SURFACE_ATTRIB_MEM_TYPE_V4L2 0x00000002 +/** \brief User pointer memory type is supported. */ +#define VA_SURFACE_ATTRIB_MEM_TYPE_USER_PTR 0x00000004 /**@}*/ /** diff --git a/va/va_android.h b/va/va_android.h index a9a8e52..a5d0e2f 100644 --- a/va/va_android.h +++ b/va/va_android.h @@ -26,8 +26,8 @@ #include -/** \brief Android Gralloc buffer memory type "AGRA" in fourcc */ -#define VA_SURFACE_ATTRIB_MEM_TYPE_ANDROID_GRALLOC 0x41524741 +/** \brief Android Gralloc buffer memory type. */ +#define VA_SURFACE_ATTRIB_MEM_TYPE_ANDROID_GRALLOC 0x00100000 #ifdef __cplusplus extern "C" { diff --git a/va/va_drmcommon.h b/va/va_drmcommon.h index 47dd371..76820a3 100644 --- a/va/va_drmcommon.h +++ b/va/va_drmcommon.h @@ -68,9 +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 +/** \brief Kernel DRM buffer memory type. */ +#define VA_SURFACE_ATTRIB_MEM_TYPE_KERNEL_DRM 0x10000000 +/** \brief DRM PRIME memory type. */ +#define VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME 0x20000000 #endif /* VA_DRM_COMMON_H */ -- 2.7.4