*
* VA-API is split into several modules:
* - \ref api_core
- * - \ref api_enc_core
* - \ref api_enc_h264
* - \ref api_vpp
*/
* @{
*/
-/*
+/**
Overview
The VA API is intended to provide an interface between a video decode/encode/display
typedef void* VADisplay; /* window system dependent */
-typedef int VAStatus; /* Return status type from functions */
-/* Values for the return status */
+typedef int VAStatus; /** Return status type from functions */
+/** Values for the return status */
#define VA_STATUS_SUCCESS 0x00000000
#define VA_STATUS_ERROR_OPERATION_FAILED 0x00000001
#define VA_STATUS_ERROR_ALLOCATION_FAILED 0x00000002
#define VA_STATUS_ERROR_HW_BUSY 0x00000022
#define VA_STATUS_ERROR_UNKNOWN 0xFFFFFFFF
-/* De-interlacing flags for vaPutSurface() */
+/** De-interlacing flags for vaPutSurface() */
#define VA_FRAME_PICTURE 0x00000000
#define VA_TOP_FIELD 0x00000001
#define VA_BOTTOM_FIELD 0x00000002
-/*
+/**
* Enabled the positioning/cropping/blending feature:
* 1, specify the video playback position in the isurface
* 2, specify the cropping info for video playback
*/
#define VA_ENABLE_BLEND 0x00000004 /* video area blend with the constant color */
-/*
+/**
* Clears the drawable with background color.
* for hardware overlay based implementation this flag
* can be used to turn off the overlay
*/
#define VA_CLEAR_DRAWABLE 0x00000008
-/* Color space conversion flags for vaPutSurface() */
+/** Color space conversion flags for vaPutSurface() */
#define VA_SRC_BT601 0x00000010
#define VA_SRC_BT709 0x00000020
#define VA_SRC_SMPTE_240 0x00000040
-/* Scaling flags for vaPutSurface() */
+/** Scaling flags for vaPutSurface() */
#define VA_FILTER_SCALING_DEFAULT 0x00000000
#define VA_FILTER_SCALING_FAST 0x00000100
#define VA_FILTER_SCALING_HQ 0x00000200
#define VA_FILTER_SCALING_NL_ANAMORPHIC 0x00000300
#define VA_FILTER_SCALING_MASK 0x00000f00
-/*
+/**
* Returns a short english description of error_status
*/
const char *vaErrorStr(VAStatus error_status);
-/*
+/**
* Initialization:
* A display must be obtained by calling vaGetDisplay() before calling
* vaInitialize() and other functions. This connects the API to the
int vaDisplayIsValid(VADisplay dpy);
-/*
+/**
* Initialize the library
*/
VAStatus vaInitialize (
int *minor_version /* out */
);
-/*
+/**
* After this call, all library internal resources will be cleaned up
*/
VAStatus vaTerminate (
VADisplay dpy
);
-/*
+/**
* vaQueryVendorString returns a pointer to a zero-terminated string
* describing some aspects of the VA implemenation on a specific
* hardware accelerator. The format of the returned string is vendor
typedef int (*VAPrivFunc)();
-/*
+/**
* Return a function pointer given a function name in the library.
* This allows private interfaces into the library
*/
const char *func
);
-/* Currently defined profiles */
+/** Currently defined profiles */
typedef enum
{
/** \brief Profile ID used for video processing. */
VAProfileVP8Version0_3 = 14
} VAProfile;
-/*
+/**
* Currently defined entrypoints
*/
typedef enum
VAEntrypointVideoProc = 10, /**< Video pre/post-processing. */
} VAEntrypoint;
-/* Currently defined configuration attribute types */
+/** Currently defined configuration attribute types */
typedef enum
{
VAConfigAttribRTFormat = 0,
VAConfigAttribTypeMax
} VAConfigAttribType;
-/*
+/**
* Configuration attributes
* If there is more than one value for an attribute, a default
* value will be assigned to the attribute if the client does not
unsigned int value; /* OR'd flags (bits) for this attribute */
} VAConfigAttrib;
-/* attribute value for VAConfigAttribRTFormat */
+/** attribute value for VAConfigAttribRTFormat */
#define VA_RT_FORMAT_YUV420 0x00000001
#define VA_RT_FORMAT_YUV422 0x00000002
#define VA_RT_FORMAT_YUV444 0x00000004
#define VA_ENC_SLICE_STRUCTURE_ARBITRARY_MACROBLOCKS 0x00000002
/**@}*/
-/*
+/**
* if an attribute is not applicable for a given
* profile/entrypoint pair, then set the value to the following
*/
#define VA_ATTRIB_NOT_SUPPORTED 0x80000000
-/* Get maximum number of profiles supported by the implementation */
+/** Get maximum number of profiles supported by the implementation */
int vaMaxNumProfiles (
VADisplay dpy
);
-/* Get maximum number of entrypoints supported by the implementation */
+/** Get maximum number of entrypoints supported by the implementation */
int vaMaxNumEntrypoints (
VADisplay dpy
);
-/* Get maximum number of attributs supported by the implementation */
+/** Get maximum number of attributs supported by the implementation */
int vaMaxNumConfigAttributes (
VADisplay dpy
);
-/*
+/**
* Query supported profiles
* The caller must provide a "profile_list" array that can hold at
* least vaMaxNumProfile() entries. The actual number of profiles
int *num_profiles /* out */
);
-/*
+/**
* Query supported entrypoints for a given profile
* The caller must provide an "entrypoint_list" array that can hold at
* least vaMaxNumEntrypoints() entries. The actual number of entrypoints
int *num_entrypoints /* out */
);
-/*
+/**
* Get attributes for a given profile/entrypoint pair
* The caller must provide an "attrib_list" with all attributes to be
* retrieved. Upon return, the attributes in "attrib_list" have been
int num_attribs
);
-/* Generic ID type, can be re-typed for specific implementation */
+/** Generic ID type, can be re-typed for specific implementation */
typedef unsigned int VAGenericID;
typedef VAGenericID VAConfigID;
-/*
+/**
* Create a configuration for the decode pipeline
* it passes in the attribute list that specifies the attributes it cares
* about, with the rest taking default values.
VAConfigID *config_id /* out */
);
-/*
+/**
* Free resources associdated with a given config
*/
VAStatus vaDestroyConfig (
VAConfigID config_id
);
-/*
+/**
* Query all attributes for a given configuration
* The profile of the configuration is returned in "profile"
* The entrypoint of the configuration is returned in "entrypoint"
);
-/*
+/**
* Contexts and Surfaces
*
* Context represents a "virtual" video decode pipeline. Surfaces are render
unsigned int num_attribs
);
-/*
+/**
* vaDestroySurfaces - Destroy resources associated with surfaces.
* Surfaces can only be destroyed after the context associated has been
* destroyed.
);
#define VA_PROGRESSIVE 0x1
-/*
+/**
* vaCreateContext - Create a context
* dpy: display
* config_id: configuration for the context
VAContextID *context /* out */
);
-/*
+/**
* vaDestroyContext - Destroy a context
* dpy: display
* context: context to be destroyed
VAContextID context
);
-/*
+/**
* Buffers
* Buffers are used to pass various types of data from the
* client to the server. The server maintains a data store
unsigned char has_emulation_bytes;
} VAEncPackedHeaderParameterBuffer;
-/*
+/**
* For application, e.g. set a new bitrate
* VABufferID buf_id;
* VAEncMiscParameterBuffer *misc_param;
unsigned int framerate;
} VAEncMiscParameterFrameRate;
-/*
+/**
* Allow a maximum slice size to be specified (in bits).
* The encoder will attempt to make sure that individual slices do not exceed this size
* Or to signal applicate if the slice size exceed this size, see "status" of VACodedBufferSegment
unsigned int max_frame_size;
} VAEncMiscParameterBufferMaxFrameSize;
-/*
+/**
* There will be cases where the bitstream buffer will not have enough room to hold
* the data for the entire slice, and the following flags will be used in the slice
* parameter to signal to the server for the possible cases.
} picture_coding_extension;
} VAPictureParameterBufferMPEG2;
-/* MPEG-2 Inverse Quantization Matrix Buffer */
+/** MPEG-2 Inverse Quantization Matrix Buffer */
typedef struct _VAIQMatrixBufferMPEG2
{
int load_intra_quantiser_matrix;
unsigned char chroma_non_intra_quantiser_matrix[64];
} VAIQMatrixBufferMPEG2;
-/* MPEG-2 Slice Parameter Buffer */
+/** MPEG-2 Slice Parameter Buffer */
typedef struct _VASliceParameterBufferMPEG2
{
unsigned int slice_data_size;/* number of bytes in the slice data buffer for this slice */
int intra_slice_flag;
} VASliceParameterBufferMPEG2;
-/* MPEG-2 Macroblock Parameter Buffer */
+/** MPEG-2 Macroblock Parameter Buffer */
typedef struct _VAMacroblockParameterBufferMPEG2
{
unsigned short macroblock_address;
#define VA_MB_TYPE_MOTION_PATTERN 0x08
#define VA_MB_TYPE_MOTION_INTRA 0x10
-/*
+/**
* MPEG-2 Residual Data Buffer
* For each macroblock, there wil be 64 shorts (16-bit) in the
* residual data buffer
short TRD;
} VAPictureParameterBufferMPEG4;
-/* MPEG-4 Inverse Quantization Matrix Buffer */
+/** MPEG-4 Inverse Quantization Matrix Buffer */
typedef struct _VAIQMatrixBufferMPEG4
{
int load_intra_quant_mat;
unsigned char non_intra_quant_mat[64];
} VAIQMatrixBufferMPEG4;
-/* MPEG-4 Slice Parameter Buffer */
+/** MPEG-4 Slice Parameter Buffer */
typedef struct _VASliceParameterBufferMPEG4
{
unsigned int slice_data_size;/* number of bytes in the slice data buffer for this slice */
int quant_scale;
} VASliceParameterBufferMPEG4;
-/*
+/**
VC-1 data structures
*/
VAMvModeIntensityCompensation = 4
} VAMvModeVC1;
-/* VC-1 Picture Parameter Buffer */
+/** VC-1 Picture Parameter Buffer */
/*
* For each picture, and before any slice data, a picture parameter
* buffer must be send. Multiple picture parameter buffers may be
} transform_fields;
} VAPictureParameterBufferVC1;
-/* VC-1 Bitplane Buffer
+/** VC-1 Bitplane Buffer
There will be at most three bitplanes coded in any picture header. To send
the bitplane data more efficiently, each byte is divided in two nibbles, with
each nibble carrying three bitplanes for one macroblock. The following table
#define VA_PICTURE_H264_SHORT_TERM_REFERENCE 0x00000008
#define VA_PICTURE_H264_LONG_TERM_REFERENCE 0x00000010
-/* H.264 Picture Parameter Buffer */
+/** H.264 Picture Parameter Buffer */
/*
* For each picture, and before any slice data, a single
* picture parameter buffer must be send.
unsigned short frame_num;
} VAPictureParameterBufferH264;
-/* H.264 Inverse Quantization Matrix Buffer */
+/** H.264 Inverse Quantization Matrix Buffer */
typedef struct _VAIQMatrixBufferH264
{
unsigned char ScalingList4x4[6][16];
unsigned char ScalingList8x8[2][64];
} VAIQMatrixBufferH264;
-/*
+/**
* H.264 Slice Group Map Buffer
* When VAPictureParameterBufferH264::num_slice_group_minus1 is not equal to 0,
* A slice group map buffer should be sent for each picture if required. The buffer
* in raster scan order
*/
-/* H.264 Slice Parameter Buffer */
+/** H.264 Slice Parameter Buffer */
typedef struct _VASliceParameterBufferH264
{
unsigned int slice_data_size;/* number of bytes in the slice data buffer for this slice */
-/* Buffer functions */
+/** Buffer functions */
-/*
+/**
* Creates a buffer for "num_elements" elements of "size" bytes and
* initalize with "data".
* if "data" is null, then the contents of the buffer data store
VABufferID *buf_id /* out */
);
-/*
+/**
* Convey to the server how many valid elements are in the buffer.
* e.g. if multiple slice parameters are being held in a single buffer,
* this will communicate to the server the number of slice parameters
);
-/*
+/**
* device independent data structure for codedbuffer
*/
void *next;
} VACodedBufferSegment;
-/*
+/**
* Map data store of the buffer into the client's address space
* vaCreateBuffer() needs to be called with "data" set to NULL before
* calling vaMapBuffer()
void **pbuf /* out */
);
-/*
+/**
* After client making changes to a mapped data store, it needs to
* "Unmap" it to let the server know that the data is ready to be
* consumed by the server
VABufferID buf_id /* in */
);
-/*
+/**
* After this call, the buffer is deleted and this buffer_id is no longer valid
* Only call this if the buffer is not going to be passed to vaRenderBuffer
*/
The Begin/Render/End sequence sends the decode buffers to the server
*/
-/*
+/**
* Get ready to decode a picture to a target surface
*/
VAStatus vaBeginPicture (
VASurfaceID render_target
);
-/*
+/**
* Send decode buffers to the server.
* Buffers are automatically destroyed afterwards
*/
int num_buffers
);
-/*
+/**
* Make the end of rendering for a picture.
* The server should start processing all pending operations for this
* surface. This call is non-blocking. The client can start another
*/
-/*
+/**
* This function blocks until all pending operations on the render target
* have been completed. Upon return it is safe to use the render target for a
* different picture.
VASurfaceSkipped = 8 /* Indicate a skipped frame during encode */
} VASurfaceStatus;
-/*
+/**
* Find out any pending ops on the render target
*/
VAStatus vaQuerySurfaceStatus (
VADecodeMBError = 1,
} VADecodeErrorType;
-/*
+/**
* Client calls vaQuerySurfaceError with VA_STATUS_ERROR_DECODING_ERROR, server side returns
* an array of structure VASurfaceDecodeMBErrors, and the array is terminated by setting status=-1
*/
VADecodeErrorType decode_error_type;
} VASurfaceDecodeMBErrors;
-/*
+/**
* After the application gets VA_STATUS_ERROR_DECODING_ERROR after calling vaSyncSurface(),
* it can call vaQuerySurfaceError to find out further details on the particular error.
* VA_STATUS_ERROR_DECODING_ERROR should be passed in as "error_status",
void **error_info
);
-/*
+/**
* Images and Subpictures
* VAImage is used to either get the surface data to client memory, or
* to copy image data in client memory to a surface.
char component_order[4];
} VAImage;
-/* Get maximum number of image formats supported by the implementation */
+/** Get maximum number of image formats supported by the implementation */
int vaMaxNumImageFormats (
VADisplay dpy
);
-/*
+/**
* Query supported image formats
* The caller must provide a "format_list" array that can hold at
* least vaMaxNumImageFormats() entries. The actual number of formats
int *num_formats /* out */
);
-/*
+/**
* Create a VAImage structure
* The width and height fields returned in the VAImage structure may get
* enlarged for some YUV formats. Upon return from this function,
VAImage *image /* out */
);
-/*
+/**
* Should call DestroyImage before destroying the surface it is bound to
*/
VAStatus vaDestroyImage (
unsigned char *palette
);
-/*
+/**
* Retrive surface data into a VAImage
* Image must be in a format supported by the implementation
*/
VAImageID image
);
-/*
+/**
* Copy data from a VAImage to a surface
* Image must be in a format supported by the implementation
* Returns a VA_STATUS_ERROR_SURFACE_BUSY if the surface
unsigned int dest_height
);
-/*
+/**
* Derive an VAImage from an existing surface.
* This interface will derive a VAImage and corresponding image buffer from
* an existing VA Surface. The image buffer can then be mapped/unmapped for
VAImage *image /* out */
);
-/*
+/**
* Subpictures
* Subpicture is a special type of image that can be blended
* with a surface during vaPutSurface(). Subpicture can be used to render
typedef VAGenericID VASubpictureID;
-/* Get maximum number of subpicture formats supported by the implementation */
+/** Get maximum number of subpicture formats supported by the implementation */
int vaMaxNumSubpictureFormats (
VADisplay dpy
);
-/* flags for subpictures */
+/** flags for subpictures */
#define VA_SUBPICTURE_CHROMA_KEYING 0x0001
#define VA_SUBPICTURE_GLOBAL_ALPHA 0x0002
#define VA_SUBPICTURE_DESTINATION_IS_SCREEN_COORD 0x0004
-/*
+/**
* Query supported subpicture formats
* The caller must provide a "format_list" array that can hold at
* least vaMaxNumSubpictureFormats() entries. The flags arrary holds the flag
unsigned int *num_formats /* out */
);
-/*
+/**
* Subpictures are created with an image associated.
*/
VAStatus vaCreateSubpicture (
VASubpictureID *subpicture /* out */
);
-/*
+/**
* Destroy the subpicture before destroying the image it is assocated to
*/
VAStatus vaDestroySubpicture (
VASubpictureID subpicture
);
-/*
+/**
* Bind an image to the subpicture. This image will now be associated with
* the subpicture instead of the one at creation.
*/
VAImageID image
);
-/*
+/**
* If chromakey is enabled, then the area where the source value falls within
* the chromakey [min, max] range is transparent
* The chromakey component format is the following:
unsigned int chromakey_mask
);
-/*
+/**
* Global alpha value is between 0 and 1. A value of 1 means fully opaque and
* a value of 0 means fully transparent. If per-pixel alpha is also specified then
* the overall alpha is per-pixel alpha multiplied by the global alpha
float global_alpha
);
-/*
+/**
* vaAssociateSubpicture associates the subpicture with target_surfaces.
* It defines the region mapping between the subpicture and the target
* surfaces through source and destination rectangles (with the same width and height).
unsigned int flags
);
-/*
+/**
* vaDeassociateSubpicture removes the association of the subpicture with target_surfaces.
*/
VAStatus vaDeassociateSubpicture (
unsigned short height;
} VARectangle;
-/*
+/**
* Display attributes
* Display attributes are used to control things such as contrast, hue, saturation,
* brightness etc. in the rendering process. The application can query what
VADISPLAYATTRIB_BLE_NONE,
} VADisplayAttribBLEMode;
-/* attribute value for VADisplayAttribRotation */
+/** attribute value for VADisplayAttribRotation */
#define VA_ROTATION_NONE 0x00000000
#define VA_ROTATION_90 0x00000001
#define VA_ROTATION_180 0x00000002
#define VA_ROTATION_270 0x00000003
-/* attribute value for VADisplayAttribOutOfLoopDeblock */
+/** attribute value for VADisplayAttribOutOfLoopDeblock */
#define VA_OOL_DEBLOCKING_FALSE 0x00000000
#define VA_OOL_DEBLOCKING_TRUE 0x00000001
-/* Render mode */
+/** Render mode */
#define VA_RENDER_MODE_UNDEFINED 0
#define VA_RENDER_MODE_LOCAL_OVERLAY 1
#define VA_RENDER_MODE_LOCAL_GPU 2
#define VA_RENDER_MODE_EXTERNAL_OVERLAY 4
#define VA_RENDER_MODE_EXTERNAL_GPU 8
-/* Render device */
+/** Render device */
#define VA_RENDER_DEVICE_UNDEFINED 0
#define VA_RENDER_DEVICE_LOCAL 1
#define VA_RENDER_DEVICE_EXTERNAL 2
-/* Currently defined display attribute types */
+/** Currently defined display attribute types */
typedef enum
{
VADisplayAttribBrightness = 0,
unsigned int flags;
} VADisplayAttribute;
-/* Get maximum number of display attributs supported by the implementation */
+/** Get maximum number of display attributs supported by the implementation */
int vaMaxNumDisplayAttributes (
VADisplay dpy
);
-/*
+/**
* Query display attributes
* The caller must provide a "attr_list" array that can hold at
* least vaMaxNumDisplayAttributes() entries. The actual number of attributes
int *num_attributes /* out */
);
-/*
+/**
* Get display attributes
* This function returns the current attribute values in "attr_list".
* Only attributes returned with VA_DISPLAY_ATTRIB_GETTABLE set in the "flags" field
int num_attributes
);
-/*
+/**
* Set display attributes
* Only attributes returned with VA_DISPLAY_ATTRIB_SETTABLE set in the "flags" field
* from vaQueryDisplayAttributes() can be set. If the attribute is not settable or