From 728abf95157a24f7104d7e62f2ec374828e1dc07 Mon Sep 17 00:00:00 2001 From: Gwenole Beauchesne Date: Tue, 15 Nov 2011 17:33:41 +0000 Subject: [PATCH] API: add a generic value type. Signed-off-by: Gwenole Beauchesne --- va/va.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/va/va.h b/va/va.h index 113c13f..0b699a1 100644 --- a/va/va.h +++ b/va/va.h @@ -147,6 +147,14 @@ typedef int VAStatus; /* Return status type from functions */ #define VA_STATUS_ERROR_INVALID_IMAGE_FORMAT 0x00000016 #define VA_STATUS_ERROR_DECODING_ERROR 0x00000017 #define VA_STATUS_ERROR_ENCODING_ERROR 0x00000018 +/** + * \brief An invalid/unsupported value was supplied. + * + * This is a catch-all error code for invalid or unsupported values. + * e.g. value exceeding the valid range, invalid type in the context + * of generic attribute values. + */ +#define VA_STATUS_ERROR_INVALID_VALUE 0x00000019 #define VA_STATUS_ERROR_UNKNOWN 0xFFFFFFFF /* De-interlacing flags for vaPutSurface() */ @@ -433,6 +441,34 @@ typedef VAGenericID VASurfaceID; #define VA_INVALID_ID 0xffffffff #define VA_INVALID_SURFACE VA_INVALID_ID +/** \brief Generic value types. */ +typedef enum { + VAGenericValueTypeInteger = 1, /**< 32-bit signed integer. */ + VAGenericValueTypeFloat, /**< 32-bit floating-point value. */ + VAGenericValueTypePointer, /**< Generic pointer type */ + VAGenericValueTypeFunc /**< Pointer to function */ +} VAGenericValueType; + +/** \brief Generic function type. */ +typedef void (*VAGenericFunc)(void); + +/** \brief Generic value. */ +typedef struct _VAGenericValue { + /** \brief Value type. See #VAGenericValueType. */ + VAGenericValueType type; + /** \brief Value holder. */ + union { + /** \brief 32-bit signed integer. */ + int i; + /** \brief 32-bit float. */ + float f; + /** \brief Generic pointer. */ + void *p; + /** \brief Pointer to function. */ + VAGenericFunc fn; + } value; +} VAGenericValue; + /* * vaCreateSurfaces - Create an array of surfaces used for decode and display * dpy: display -- 2.7.4