VA-API
Classes | Macros | Typedefs | Enumerations | Functions
Core API

Classes

struct  VAMotionVector
 Generic motion vector data structure. More...
 
struct  VAConfigAttrib
 
union  VAConfigAttribValEncJPEG
 Attribute value for VAConfigAttribEncJPEG. More...
 
union  VAConfigAttribValEncROI
 Attribute value for VAConfigAttribEncROI. More...
 
union  VAConfigAttribValEncRateControlExt
 Attribute value for VAConfigAttribEncRateControlExt. More...
 
struct  VAGenericValue
 Generic value. More...
 
struct  VASurfaceAttrib
 Surface attribute. More...
 
struct  VASurfaceAttribExternalBuffers
 VASurfaceAttribExternalBuffers structure for the VASurfaceAttribExternalBufferDescriptor attribute. More...
 
struct  VAProcessingRateParameterEnc
 
struct  VAProcessingRateParameterDec
 
struct  VAEncPackedHeaderParameterBuffer
 Packed header parameter. More...
 
struct  VAEncMiscParameterBuffer
 
struct  VAEncMiscParameterTemporalLayerStructure
 Temporal layer Structure. More...
 
struct  VAEncMiscParameterRateControl
 Rate control parameters. More...
 
struct  VAEncMiscParameterMaxSliceSize
 
struct  VAEncMiscParameterBufferMaxFrameSize
 Defines a maximum frame size (in bits). More...
 
struct  VAEncMiscParameterBufferQualityLevel
 Encoding quality level. More...
 
struct  VAEncMiscParameterQuantization
 Quantization settings for encoding. More...
 
struct  VAEncMiscParameterSkipFrame
 Encoding skip frame. More...
 
struct  VAEncROI
 Encoding region-of-interest (ROI). More...
 
struct  VAEncMiscParameterParallelRateControl
 Attribute value for VAConfigAttribEncParallelRateControl. More...
 
struct  VAEncMiscParameterEncQuality
 
struct  VAEncMiscParameterCustomRoundingControl
 Custom Encoder Rounding Offset Control. Application may use this structure to set customized rounding offset parameters for quantization. Valid when VAConfigAttribCustomRoundingControl equals 1. More...
 
struct  VAHuffmanTableBufferJPEGBaseline
 Huffman table for JPEG decoding. More...
 
struct  VAIQMatrixBufferMPEG2
 
struct  VASliceParameterBufferMPEG2
 
struct  VAMacroblockParameterBufferMPEG2
 
struct  VAPictureParameterBufferMPEG4
 
struct  VAIQMatrixBufferMPEG4
 
struct  VASliceParameterBufferMPEG4
 
struct  VAPictureParameterBufferVC1
 
struct  VASliceParameterBufferVC1
 
struct  VAPictureParameterBufferH264
 
struct  VAIQMatrixBufferH264
 
struct  VASliceParameterBufferH264
 
struct  VAEncSliceParameterBuffer
 Encode Slice Parameter Buffer. More...
 
struct  VACodedBufferSegment
 Coded buffer segment. More...
 
struct  VABufferInfo
 VA buffer information. More...
 
struct  VASurfaceDecodeMBErrors
 

Macros

#define VA_STATUS_SUCCESS   0x00000000
 
#define VA_STATUS_ERROR_INVALID_VALUE   0x00000019
 An invalid/unsupported value was supplied. More...
 
#define VA_STATUS_ERROR_UNSUPPORTED_FILTER   0x00000020
 An unsupported filter was supplied.
 
#define VA_STATUS_ERROR_INVALID_FILTER_CHAIN   0x00000021
 An invalid filter chain was supplied.
 
#define VA_STATUS_ERROR_HW_BUSY   0x00000022
 Indicate HW busy (e.g. run multiple encoding simultaneously).
 
#define VA_STATUS_ERROR_UNSUPPORTED_MEMORY_TYPE   0x00000024
 An unsupported memory type was supplied.
 
#define VA_FRAME_PICTURE   0x00000000
 
#define VA_ENABLE_BLEND   0x00000004 /* video area blend with the constant color */
 
#define VA_CLEAR_DRAWABLE   0x00000008
 
#define VA_SRC_COLOR_MASK   0x000000f0
 
#define VA_FILTER_SCALING_DEFAULT   0x00000000
 
#define VA_PADDING_LOW   4
 
#define VA_RT_FORMAT_YUV420   0x00000001
 
#define VA_RT_FORMAT_YUV420_10BPP   0x00000100
 
#define VA_RT_FORMAT_RGB16   0x00010000
 
#define VA_RT_FORMAT_RGB32_10BPP   0x00200000
 
#define VA_ATTRIB_NOT_SUPPORTED   0x80000000
 
#define VA_SLICE_DATA_FLAG_ALL   0x00 /* whole slice is in the buffer */
 
#define VA_CODED_BUF_STATUS_PICTURE_AVE_QP_MASK   0xff
 
#define VA_CODED_BUF_STATUS_FRAME_SIZE_OVERFLOW   0x1000
 The frame has exceeded the maximum requested size. More...
 
#define VA_CODED_BUF_STATUS_BAD_BITSTREAM   0x8000
 the bitstream is bad or corrupt.
 
#define VA_CODED_BUF_STATUS_NUMBER_PASSES_MASK   0xf000000
 The coded buffer segment status contains frame encoding passes number. More...
 
#define VA_CODED_BUF_STATUS_SINGLE_NALU   0x10000000
 The coded buffer segment contains a single NAL unit. More...
 
#define VA_FOURCC(ch0, ch1, ch2, ch3)
 
#define VA_FOURCC_YV16   0x36315659
 
#define VA_FOURCC_P010   0x30313050
 
#define VA_FOURCC_I010   0x30313049
 
#define VA_SUBPICTURE_CHROMA_KEYING   0x0001
 
#define VA_ROTATION_NONE   0x00000000
 

Typedefs

typedef void * VADisplay
 
typedef void(* VAMessageCallback) (void *user_context, const char *message)
 
typedef void * VANativeDisplay
 
typedef unsigned int VAGenericID
 
typedef VAGenericID VAContextID
 
typedef void(* VAGenericFunc) (void)
 Generic function type.
 
typedef VAGenericID VABufferID
 
typedef VAGenericID VASubpictureID
 

Enumerations

Functions

const char * vaErrorStr (VAStatus error_status)
 
VAMessageCallback vaSetErrorCallback (VADisplay dpy, VAMessageCallback callback, void *user_context)
 
VAMessageCallback vaSetInfoCallback (VADisplay dpy, VAMessageCallback callback, void *user_context)
 
VAStatus vaSetDriverName (VADisplay dpy, char *driver_name)
 
VAStatus vaInitialize (VADisplay dpy, int *major_version, int *minor_version)
 
VAStatus vaTerminate (VADisplay dpy)
 
const char * vaQueryVendorString (VADisplay dpy)
 
VAPrivFunc vaGetLibFunc (VADisplay dpy, const char *func)
 
int vaMaxNumProfiles (VADisplay dpy)
 
int vaMaxNumEntrypoints (VADisplay dpy)
 
int vaMaxNumConfigAttributes (VADisplay dpy)
 
VAStatus vaQueryConfigProfiles (VADisplay dpy, VAProfile *profile_list, int *num_profiles)
 
VAStatus vaQueryConfigEntrypoints (VADisplay dpy, VAProfile profile, VAEntrypoint *entrypoint_list, int *num_entrypoints)
 
VAStatus vaGetConfigAttributes (VADisplay dpy, VAProfile profile, VAEntrypoint entrypoint, VAConfigAttrib *attrib_list, int num_attribs)
 
VAStatus vaCreateConfig (VADisplay dpy, VAProfile profile, VAEntrypoint entrypoint, VAConfigAttrib *attrib_list, int num_attribs, VAConfigID *config_id)
 
VAStatus vaDestroyConfig (VADisplay dpy, VAConfigID config_id)
 
VAStatus vaQueryConfigAttributes (VADisplay dpy, VAConfigID config_id, VAProfile *profile, VAEntrypoint *entrypoint, VAConfigAttrib *attrib_list, int *num_attribs)
 
VAStatus vaQuerySurfaceAttributes (VADisplay dpy, VAConfigID config, VASurfaceAttrib *attrib_list, unsigned int *num_attribs)
 Queries surface attributes for the supplied config. More...
 
VAStatus vaCreateSurfaces (VADisplay dpy, unsigned int format, unsigned int width, unsigned int height, VASurfaceID *surfaces, unsigned int num_surfaces, VASurfaceAttrib *attrib_list, unsigned int num_attribs)
 Creates an array of surfaces. More...
 
VAStatus vaDestroySurfaces (VADisplay dpy, VASurfaceID *surfaces, int num_surfaces)
 
VAStatus vaCreateContext (VADisplay dpy, VAConfigID config_id, int picture_width, int picture_height, int flag, VASurfaceID *render_targets, int num_render_targets, VAContextID *context)
 
VAStatus vaDestroyContext (VADisplay dpy, VAContextID context)
 
VAStatus vaCreateMFContext (VADisplay dpy, VAMFContextID *mf_context)
 
VAStatus vaMFAddContext (VADisplay dpy, VAMFContextID mf_context, VAContextID context)
 
VAStatus vaMFReleaseContext (VADisplay dpy, VAMFContextID mf_context, VAContextID context)
 
VAStatus vaQueryProcessingRate (VADisplay dpy, VAConfigID config, VAProcessingRateParameter *proc_buf, unsigned int *processing_rate)
 Queries processing rate for the supplied config. More...
 
VAStatus vaCreateBuffer (VADisplay dpy, VAContextID context, VABufferType type, unsigned int size, unsigned int num_elements, void *data, VABufferID *buf_id)
 
VAStatus vaCreateBuffer2 (VADisplay dpy, VAContextID context, VABufferType type, unsigned int width, unsigned int height, unsigned int *unit_size, unsigned int *pitch, VABufferID *buf_id)
 
VAStatus vaBufferSetNumElements (VADisplay dpy, VABufferID buf_id, unsigned int num_elements)
 
VAStatus vaMapBuffer (VADisplay dpy, VABufferID buf_id, void **pbuf)
 
VAStatus vaUnmapBuffer (VADisplay dpy, VABufferID buf_id)
 
VAStatus vaDestroyBuffer (VADisplay dpy, VABufferID buffer_id)
 
VAStatus vaAcquireBufferHandle (VADisplay dpy, VABufferID buf_id, VABufferInfo *buf_info)
 Acquires buffer handle for external API usage. More...
 
VAStatus vaReleaseBufferHandle (VADisplay dpy, VABufferID buf_id)
 Releases buffer after usage from external API. More...
 
VAStatus vaExportSurfaceHandle (VADisplay dpy, VASurfaceID surface_id, uint32_t mem_type, uint32_t flags, void *descriptor)
 Export a handle to a surface for use with an external API. More...
 
VAStatus vaBeginPicture (VADisplay dpy, VAContextID context, VASurfaceID render_target)
 
VAStatus vaRenderPicture (VADisplay dpy, VAContextID context, VABufferID *buffers, int num_buffers)
 
VAStatus vaEndPicture (VADisplay dpy, VAContextID context)
 
VAStatus vaMFSubmit (VADisplay dpy, VAMFContextID mf_context, VAContextID *contexts, int num_contexts)
 
VAStatus vaSyncSurface (VADisplay dpy, VASurfaceID render_target)
 
VAStatus vaQuerySurfaceStatus (VADisplay dpy, VASurfaceID render_target, VASurfaceStatus *status)
 
VAStatus vaQuerySurfaceError (VADisplay dpy, VASurfaceID surface, VAStatus error_status, void **error_info)
 
int vaMaxNumImageFormats (VADisplay dpy)
 
VAStatus vaQueryImageFormats (VADisplay dpy, VAImageFormat *format_list, int *num_formats)
 
VAStatus vaCreateImage (VADisplay dpy, VAImageFormat *format, int width, int height, VAImage *image)
 
VAStatus vaDestroyImage (VADisplay dpy, VAImageID image)
 
VAStatus vaGetImage (VADisplay dpy, VASurfaceID surface, int x, int y, unsigned int width, unsigned int height, VAImageID image)
 
VAStatus vaPutImage (VADisplay dpy, VASurfaceID surface, VAImageID image, int src_x, int src_y, unsigned int src_width, unsigned int src_height, int dest_x, int dest_y, unsigned int dest_width, unsigned int dest_height)
 
VAStatus vaDeriveImage (VADisplay dpy, VASurfaceID surface, VAImage *image)
 
int vaMaxNumSubpictureFormats (VADisplay dpy)
 
VAStatus vaQuerySubpictureFormats (VADisplay dpy, VAImageFormat *format_list, unsigned int *flags, unsigned int *num_formats)
 
VAStatus vaCreateSubpicture (VADisplay dpy, VAImageID image, VASubpictureID *subpicture)
 
VAStatus vaDestroySubpicture (VADisplay dpy, VASubpictureID subpicture)
 
VAStatus vaSetSubpictureImage (VADisplay dpy, VASubpictureID subpicture, VAImageID image)
 
VAStatus vaSetSubpictureChromakey (VADisplay dpy, VASubpictureID subpicture, unsigned int chromakey_min, unsigned int chromakey_max, unsigned int chromakey_mask)
 
VAStatus vaSetSubpictureGlobalAlpha (VADisplay dpy, VASubpictureID subpicture, float global_alpha)
 
VAStatus vaAssociateSubpicture (VADisplay dpy, VASubpictureID subpicture, VASurfaceID *target_surfaces, int num_surfaces, int16_t src_x, int16_t src_y, uint16_t src_width, uint16_t src_height, int16_t dest_x, int16_t dest_y, uint16_t dest_width, uint16_t dest_height, uint32_t flags)
 
VAStatus vaDeassociateSubpicture (VADisplay dpy, VASubpictureID subpicture, VASurfaceID *target_surfaces, int num_surfaces)
 

Attribute values for VAConfigAttribRateControl

#define VA_RC_NONE   0x00000001
 Driver does not support any form of rate control.
 
#define VA_RC_CBR   0x00000002
 Constant bitrate.
 
#define VA_RC_VBR   0x00000004
 Variable bitrate.
 
#define VA_RC_VCM   0x00000008
 Video conference mode.
 
#define VA_RC_CQP   0x00000010
 Constant QP.
 
#define VA_RC_VBR_CONSTRAINED   0x00000020
 Variable bitrate with peak rate higher than average bitrate.
 
#define VA_RC_ICQ   0x00000040
 Intelligent Constant Quality. Provided an initial ICQ_quality_factor, adjusts QP at a frame and MB level based on motion to improve subjective quality.
 
#define VA_RC_MB   0x00000080
 Macroblock based rate control. Per MB control is decided internally in the encoder. It may be combined with other RC modes, except CQP.
 
#define VA_RC_CFS   0x00000100
 Constant Frame Size, it is used for small tolerent.
 
#define VA_RC_PARALLEL   0x00000200
 Parallel BRC, for hierachical B. More...
 

Attribute values for VAConfigAttribDecSliceMode

#define VA_DEC_SLICE_MODE_NORMAL   0x00000001
 Driver supports normal mode for slice decoding.
 
#define VA_DEC_SLICE_MODE_BASE   0x00000002
 Driver supports base mode for slice decoding.
 

Attribute values for VAConfigAttribDecProcessing

#define VA_DEC_PROCESSING_NONE   0x00000000
 No decoding + processing in a single decoding call.
 
#define VA_DEC_PROCESSING   0x00000001
 Decode + processing in a single decoding call.
 

Attribute values for VAConfigAttribEncPackedHeaders

#define VA_ENC_PACKED_HEADER_NONE   0x00000000
 Driver does not support any packed headers mode.
 
#define VA_ENC_PACKED_HEADER_SEQUENCE   0x00000001
 Driver supports packed sequence headers. e.g. SPS for H.264. More...
 
#define VA_ENC_PACKED_HEADER_PICTURE   0x00000002
 Driver supports packed picture headers. e.g. PPS for H.264. More...
 
#define VA_ENC_PACKED_HEADER_SLICE   0x00000004
 Driver supports packed slice headers. e.g. slice_header() for H.264. More...
 
#define VA_ENC_PACKED_HEADER_MISC   0x00000008
 Driver supports misc packed headers. e.g. SEI for H.264. More...
 
#define VA_ENC_PACKED_HEADER_RAW_DATA   0x00000010
 Driver supports raw packed header, see VAEncPackedHeaderRawData.
 

Attribute values for VAConfigAttribEncInterlaced

#define VA_ENC_INTERLACED_NONE   0x00000000
 Driver does not support interlaced coding.
 
#define VA_ENC_INTERLACED_FRAME   0x00000001
 Driver supports interlaced frame coding.
 
#define VA_ENC_INTERLACED_FIELD   0x00000002
 Driver supports interlaced field coding.
 
#define VA_ENC_INTERLACED_MBAFF   0x00000004
 Driver supports macroblock adaptive frame field coding.
 
#define VA_ENC_INTERLACED_PAFF   0x00000008
 Driver supports picture adaptive frame field coding.
 

Attribute values for VAConfigAttribEncSliceStructure

#define VA_ENC_SLICE_STRUCTURE_POWER_OF_TWO_ROWS   0x00000001
 Driver supports a power-of-two number of rows per slice.
 
#define VA_ENC_SLICE_STRUCTURE_ARBITRARY_MACROBLOCKS   0x00000002
 Driver supports an arbitrary number of macroblocks per slice.
 
#define VA_ENC_SLICE_STRUCTURE_EQUAL_ROWS   0x00000004
 Dirver support 1 rows per slice.
 
#define VA_ENC_SLICE_STRUCTURE_MAX_SLICE_SIZE   0x00000008
 Dirver support max encoded slice size per slice.
 
#define VA_ENC_SLICE_STRUCTURE_ARBITRARY_ROWS   0x00000010
 Driver supports an arbitrary number of rows per slice.
 

Attribute values for VAConfigAttribEncQuantization

#define VA_ENC_QUANTIZATION_NONE   0x00000000
 Driver does not support special types of quantization.
 
#define VA_ENC_QUANTIZATION_TRELLIS_SUPPORTED   0x00000001
 Driver supports trellis quantization.
 

Attribute values for VAConfigAttribEncIntraRefresh

#define VA_ENC_INTRA_REFRESH_NONE   0x00000000
 Driver does not support intra refresh.
 
#define VA_ENC_INTRA_REFRESH_ROLLING_COLUMN   0x00000001
 Driver supports column based rolling intra refresh.
 
#define VA_ENC_INTRA_REFRESH_ROLLING_ROW   0x00000002
 Driver supports row based rolling intra refresh.
 
#define VA_ENC_INTRA_REFRESH_ADAPTIVE   0x00000010
 Driver supports adaptive intra refresh.
 
#define VA_ENC_INTRA_REFRESH_CYCLIC   0x00000020
 Driver supports cyclic intra refresh.
 
#define VA_ENC_INTRA_REFRESH_P_FRAME   0x00010000
 Driver supports intra refresh of P frame.
 
#define VA_ENC_INTRA_REFRESH_B_FRAME   0x00020000
 Driver supports intra refresh of B frame.
 
#define VA_ENC_INTRA_REFRESH_MULTI_REF   0x00040000
 Driver supports intra refresh of multiple reference encoder.
 

Attribute values for VAConfigAttribProcessingRate.

#define VA_PROCESSING_RATE_NONE   0x00000000
 Driver does not support processing rate report.
 
#define VA_PROCESSING_RATE_ENCODE   0x00000001
 Driver supports encode processing rate report.
 
#define VA_PROCESSING_RATE_DECODE   0x00000002
 Driver supports decode processing rate report.
 

Surface attribute flags

#define VA_SURFACE_ATTRIB_NOT_SUPPORTED   0x00000000
 Surface attribute is not supported.
 
#define VA_SURFACE_ATTRIB_GETTABLE   0x00000001
 Surface attribute can be got through vaQuerySurfaceAttributes().
 
#define VA_SURFACE_ATTRIB_SETTABLE   0x00000002
 Surface attribute can be set through vaCreateSurfaces().
 

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.

#define VA_SURFACE_ATTRIB_MEM_TYPE_VA   0x00000001
 VA memory type (default) is supported.
 
#define VA_SURFACE_ATTRIB_MEM_TYPE_V4L2   0x00000002
 V4L2 buffer memory type is supported.
 
#define VA_SURFACE_ATTRIB_MEM_TYPE_USER_PTR   0x00000004
 User pointer memory type is supported.
 

VASurfaceAttribExternalBuffers flags

#define VA_SURFACE_EXTBUF_DESC_ENABLE_TILING   0x00000001
 Enable memory tiling.
 
#define VA_SURFACE_EXTBUF_DESC_CACHED   0x00000002
 Memory is cacheable.
 
#define VA_SURFACE_EXTBUF_DESC_UNCACHED   0x00000004
 Memory is non-cacheable.
 
#define VA_SURFACE_EXTBUF_DESC_WC   0x00000008
 Memory is write-combined.
 
#define VA_SURFACE_EXTBUF_DESC_PROTECTED   0x80000000
 Memory is protected.
 

VASurfaceAttribUsageHint attribute usage hint flags

#define VA_SURFACE_ATTRIB_USAGE_HINT_GENERIC   0x00000000
 Surface usage not indicated.
 
#define VA_SURFACE_ATTRIB_USAGE_HINT_DECODER   0x00000001
 Surface used by video decoder.
 
#define VA_SURFACE_ATTRIB_USAGE_HINT_ENCODER   0x00000002
 Surface used by video encoder.
 
#define VA_SURFACE_ATTRIB_USAGE_HINT_VPP_READ   0x00000004
 Surface read by video post-processing.
 
#define VA_SURFACE_ATTRIB_USAGE_HINT_VPP_WRITE   0x00000008
 Surface written by video post-processing.
 
#define VA_SURFACE_ATTRIB_USAGE_HINT_DISPLAY   0x00000010
 Surface used for display.
 

vaExportSurfaceHandle() flags

#define VA_EXPORT_SURFACE_READ_ONLY   0x0001
 
#define VA_EXPORT_SURFACE_WRITE_ONLY   0x0002
 
#define VA_EXPORT_SURFACE_READ_WRITE   0x0003
 
#define VA_EXPORT_SURFACE_SEPARATE_LAYERS   0x0004
 
#define VA_EXPORT_SURFACE_COMPOSED_LAYERS   0x0008
 

Detailed Description

Macro Definition Documentation

#define VA_ATTRIB_NOT_SUPPORTED   0x80000000

if an attribute is not applicable for a given profile/entrypoint pair, then set the value to the following

#define VA_CLEAR_DRAWABLE   0x00000008

Clears the drawable with background color. for hardware overlay based implementation this flag can be used to turn off the overlay

#define VA_CODED_BUF_STATUS_FRAME_SIZE_OVERFLOW   0x1000

The frame has exceeded the maximum requested size.

This flag indicates that the encoded frame size exceeds the value specified through a misc parameter buffer of type VAEncMiscParameterTypeMaxFrameSize.

#define VA_CODED_BUF_STATUS_NUMBER_PASSES_MASK   0xf000000

The coded buffer segment status contains frame encoding passes number.

This is the mask to get the number of encoding passes from the coded buffer segment status. NUMBER_PASS(bit24~bit27): the number for encoding passes executed for the coded frame.

#define VA_CODED_BUF_STATUS_PICTURE_AVE_QP_MASK   0xff

device independent data structure for codedbuffer

#define VA_CODED_BUF_STATUS_SINGLE_NALU   0x10000000

The coded buffer segment contains a single NAL unit.

This flag indicates that the coded buffer segment contains a single NAL unit. This flag might be useful to the user for processing the coded buffer.

#define VA_ENABLE_BLEND   0x00000004 /* video area blend with the constant color */

Enabled the positioning/cropping/blending feature: 1, specify the video playback position in the isurface 2, specify the cropping info for video playback 3, encoded video will blend with background color

#define VA_ENC_PACKED_HEADER_MISC   0x00000008

Driver supports misc packed headers. e.g. SEI for H.264.

Deprecated:
This is a deprecated packed header flag, All applications can use VA_ENC_PACKED_HEADER_RAW_DATA to pass the corresponding packed header data buffer to the driver
#define VA_ENC_PACKED_HEADER_PICTURE   0x00000002

Driver supports packed picture headers. e.g. PPS for H.264.

Application must provide it to driver once this falg is returned through vaGetConfigAttributes()

#define VA_ENC_PACKED_HEADER_SEQUENCE   0x00000001

Driver supports packed sequence headers. e.g. SPS for H.264.

Application must provide it to driver once this flag is returned through vaGetConfigAttributes()

#define VA_ENC_PACKED_HEADER_SLICE   0x00000004

Driver supports packed slice headers. e.g. slice_header() for H.264.

Application must provide it to driver once this flag is returned through vaGetConfigAttributes()

#define VA_EXPORT_SURFACE_COMPOSED_LAYERS   0x0008

Export surface with composed layers.

For example, NV12 surfaces should be exported as a single NV12 composed object.

#define VA_EXPORT_SURFACE_READ_ONLY   0x0001

Export surface to be read by external API.

#define VA_EXPORT_SURFACE_READ_WRITE   0x0003

Export surface to be both read and written by external API.

#define VA_EXPORT_SURFACE_SEPARATE_LAYERS   0x0004

Export surface with separate layers.

For example, NV12 surfaces should be exported as two separate planes for luma and chroma.

#define VA_EXPORT_SURFACE_WRITE_ONLY   0x0002

Export surface to be written by external API.

#define VA_FILTER_SCALING_DEFAULT   0x00000000

Scaling flags for vaPutSurface()

#define VA_FOURCC (   ch0,
  ch1,
  ch2,
  ch3 
)
Value:
((unsigned long)(unsigned char) (ch0) | ((unsigned long)(unsigned char) (ch1) << 8) | \
((unsigned long)(unsigned char) (ch2) << 16) | ((unsigned long)(unsigned char) (ch3) << 24 ))

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. Both images, subpictures and surfaces follow the same 2D coordinate system where origin is at the upper left corner with positive X to the right and positive Y down

#define VA_FOURCC_I010   0x30313049

10-bit Planar YUV 420 and occupy the lower 10-bit.

#define VA_FOURCC_P010   0x30313050

10-bit and 16-bit Planar YUV 4:2:0.

#define VA_FOURCC_YV16   0x36315659

Planar YUV 4:2:2. 8-bit Y plane, followed by 8-bit 2x1 subsampled V and U planes

#define VA_FRAME_PICTURE   0x00000000

De-interlacing flags for vaPutSurface()

#define VA_PADDING_LOW   4

Padding size in 4-bytes

#define VA_RC_PARALLEL   0x00000200

Parallel BRC, for hierachical B.

For hierachical B, B frames can be refered by other B frames. Currently three layers of hierachy are defined: B0 - regular B, no reference to other B frames. B1 - reference to only I, P and regular B0 frames. B2 - reference to any other frames, including B1. In Hierachical B structure, B frames on the same layer can be processed simultaneously. And BRC would adjust accordingly. This is so called Parallel BRC.

#define VA_ROTATION_NONE   0x00000000

attribute value for VADisplayAttribRotation

#define VA_RT_FORMAT_RGB16   0x00010000

RGB formats

#define VA_RT_FORMAT_RGB32_10BPP   0x00200000

RGB 10-bit packed format with upper 2 bits as alpha channel. The existing pre-defined fourcc codes can be used to signal the position of each component for this RT format.

#define VA_RT_FORMAT_YUV420   0x00000001

attribute value for VAConfigAttribRTFormat

#define VA_RT_FORMAT_YUV420_10BPP   0x00000100

YUV formats with more than 8 bpp

#define VA_SLICE_DATA_FLAG_ALL   0x00 /* whole slice is in the buffer */

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. If a slice parameter buffer and slice data buffer pair is sent to the server with the slice data partially in the slice data buffer (BEGIN and MIDDLE cases below), then a slice parameter and data buffer needs to be sent again to complete this slice.

#define VA_SRC_COLOR_MASK   0x000000f0

Color space conversion flags for vaPutSurface()

#define VA_STATUS_ERROR_INVALID_VALUE   0x00000019

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_SUCCESS   0x00000000

Return status type from functions Values for the return status

#define VA_SUBPICTURE_CHROMA_KEYING   0x0001

flags for subpictures

Typedef Documentation

Buffers Buffers are used to pass various types of data from the client to the server. The server maintains a data store for each buffer created, and the client idenfies a buffer through a unique buffer id assigned by the server.

Contexts and Surfaces

Context represents a "virtual" video decode, encode or video processing pipeline. Surfaces are render targets for a given context. The data in the surfaces are not accessible to the client except if derived image is supported and the internal data format of the surface is implementation specific.

Surfaces are provided as a hint of what surfaces will be used when the context is created through vaCreateContext(). A surface may be used by different contexts at the same time as soon as application can make sure the operations are synchronized between different contexts, e.g. a surface is used as the output of a decode context and the input of a video process context. Surfaces can only be destroyed after all contexts using these surfaces have been destroyed.

Both contexts and surfaces are identified by unique IDs and its implementation specific internals are kept opaque to the clients

typedef void* VADisplay

Overview

The VA API is intended to provide an interface between a video decode/encode/processing application (client) and a hardware accelerator (server), to off-load video decode/encode/processing operations from the host to the hardware accelerator at various entry-points.

The basic operation steps are:

  • Negotiate a mutually acceptable configuration with the server to lock down profile, entrypoints, and other attributes that will not change on a frame-by-frame basis.
  • Create a video decode, encode or processing context which represents a "virtualized" hardware device
  • Get and fill the render buffers with the corresponding data (depending on profiles and entrypoints)
  • Pass the render buffers to the server to handle the current frame

Initialization & Configuration Management

  • Find out supported profiles
  • Find out entrypoints for a given profile
  • Find out configuration attributes for a given profile/entrypoint pair
  • Create a configuration for use by the application
typedef unsigned int VAGenericID

Generic ID type, can be re-typed for specific implementation

typedef void(* VAMessageCallback) (void *user_context, const char *message)

Type of a message callback, used for both error and info log.

typedef void* VANativeDisplay

Initialization: A display must be obtained by calling vaGetDisplay() before calling vaInitialize() and other functions. This connects the API to the native window system. For X Windows, native_dpy would be from XOpenDisplay()

Subpictures Subpicture is a special type of image that can be blended with a surface during vaPutSurface(). Subpicture can be used to render DVD sub-titles or closed captioning text etc.

Enumeration Type Documentation

Enumerator
VAEncQPBufferType 

Encoding QP buffer.

This buffer contains QP per MB for encoding. Currently VAEncQPBufferH264 is defined for H.264 encoding, see #VAEncQPBufferH264 for details

VAProcPipelineParameterBufferType 

Video processing pipeline parameter buffer.

This buffer describes the video processing pipeline. See VAProcPipelineParameterBuffer for details.

VAProcFilterParameterBufferType 

Video filter parameter buffer.

This buffer describes the video filter parameters. All buffers inherit from VAProcFilterParameterBufferBase, thus including a unique filter buffer type.

The default buffer used by most filters is VAProcFilterParameterBuffer. Filters requiring advanced parameters include, but are not limited to, deinterlacing (VAProcFilterParameterBufferDeinterlacing), color balance (VAProcFilterParameterBufferColorBalance), etc.

VAEncFEIMVBufferType 

FEI specific buffer types.

VAStatsStatisticsBufferType 

Statistics output for VAEntrypointStats progressive and top field of interlaced case.

VAStatsStatisticsBottomFieldBufferType 

Statistics output for VAEntrypointStats bottom field of interlaced case.

VAEncMacroblockDisableSkipMapBufferType 

Force MB's to be non skip for encode.it's per-mb control buffer, The width of the MB map Surface is (width of the Picture in MB unit) * 1 byte, multiple of 64 bytes. The height is (height of the picture in MB unit). The picture is either frame or non-interleaved top or bottom field. If the application provides this surface, it will override the "skipCheckDisable" setting in VAEncMiscParameterEncQuality.

VAEncFEICTBCmdBufferType 

HEVC FEI CTB level cmd buffer it is CTB level information for future usage.

VAEncFEICURecordBufferType 

HEVC FEI CU level data buffer it's CTB level information for future usage.

VADecodeStreamoutBufferType 

decode stream out buffer, intermedia data of decode, it may include MV, MB mode etc. it can be used to detect motion and analyze the frame contain

Currently defined configuration attribute types

Enumerator
VAConfigAttribDecSliceMode 

Slice Decoding mode. Read/write.

This attribute determines what mode the driver supports for slice decoding, through vaGetConfigAttributes(); and what mode the user will be providing to the driver, through vaCreateConfig(), if the driver supports those. If this attribute is not set by the user then it is assumed that VA_DEC_SLICE_MODE_NORMAL mode is used.

See VA_DEC_SLICE_MODE_xxx for the list of slice decoding modes.

VAConfigAttribDecJPEG 

JPEG decoding attribute. Read-only.

This attribute exposes a number of capabilities of the underlying JPEG implementation. The attribute value is partitioned into fields as defined in the VAConfigAttribValDecJPEG union.

VAConfigAttribDecProcessing 

Decode processing support. Read/write.

This attribute determines if the driver supports video processing with decoding using the decoding context in a single call, through vaGetConfigAttributes(); and if the user may use this feature, through vaCreateConfig(), if the driver supports the user scenario. The user will essentially create a regular decode VAContext. Therefore, the parameters of vaCreateContext() such as picture_width, picture_height and render_targets are in relation to the decode output parameters (not processing output parameters) as normal. If this attribute is not set by the user then it is assumed that no extra processing is done after decoding for this decode context.

Since essentially the application is creating a decoder config and context, all function calls that take in the config (e.g. vaQuerySurfaceAttributes()) or context are in relation to the decoder, except those video processing function specified in the next paragraph.

Once the decode config and context are created, the user must further query the supported processing filters using vaQueryVideoProcFilters(), vaQueryVideoProcFilterCaps(), vaQueryVideoProcPipelineCaps() by specifying the created decode context. The user must provide processing information and extra processing output surfaces as "additional_outputs" to the driver through VAProcPipelineParameterBufferType. The render_target specified at vaBeginPicture() time refers to the decode output surface. The target surface for the output of processing needs to be a different surface since the decode process requires the original reconstructed buffer. The “surface” member of VAProcPipelineParameterBuffer should be set to the same as “render_target” set in vaBeginPicture(), but the driver may choose to ignore this parameter.

VAConfigAttribEncPackedHeaders 

Packed headers mode. Read/write.

This attribute determines what packed headers the driver supports, through vaGetConfigAttributes(); and what packed headers the user will be providing to the driver, through vaCreateConfig(), if the driver supports those.

See VA_ENC_PACKED_HEADER_xxx for the list of packed headers.

VAConfigAttribEncInterlaced 

Interlaced mode. Read/write.

This attribute determines what kind of interlaced encoding mode the driver supports.

See VA_ENC_INTERLACED_xxx for the list of interlaced modes.

VAConfigAttribEncMaxRefFrames 

Maximum number of reference frames. Read-only.

This attribute determines the maximum number of reference frames supported for encoding.

Note: for H.264 encoding, the value represents the maximum number of reference frames for both the reference picture list 0 (bottom 16 bits) and the reference picture list 1 (top 16 bits).

VAConfigAttribEncMaxSlices 

Maximum number of slices per frame. Read-only.

This attribute determines the maximum number of slices the driver can support to encode a single frame.

VAConfigAttribEncSliceStructure 

Slice structure. Read-only.

This attribute determines slice structures supported by the driver for encoding. This attribute is a hint to the user so that he can choose a suitable surface size and how to arrange the encoding process of multiple slices per frame.

More specifically, for H.264 encoding, this attribute determines the range of accepted values to VAEncSliceParameterBufferH264::macroblock_address and VAEncSliceParameterBufferH264::num_macroblocks.

See VA_ENC_SLICE_STRUCTURE_xxx for the supported slice structure types.

VAConfigAttribEncMacroblockInfo 

Macroblock information. Read-only.

This attribute determines whether the driver supports extra encoding information per-macroblock. e.g. QP.

More specifically, for H.264 encoding, if the driver returns a non-zero value for this attribute, this means the application can create additional VAEncMacroblockParameterBufferH264 buffers referenced through VAEncSliceParameterBufferH264::macroblock_info.

VAConfigAttribMaxPictureWidth 

Maximum picture width. Read-only.

This attribute determines the maximum picture width the driver supports for a given configuration.

VAConfigAttribMaxPictureHeight 

Maximum picture height. Read-only.

This attribute determines the maximum picture height the driver supports for a given configuration.

VAConfigAttribEncJPEG 

JPEG encoding attribute. Read-only.

This attribute exposes a number of capabilities of the underlying JPEG implementation. The attribute value is partitioned into fields as defined in the VAConfigAttribValEncJPEG union.

VAConfigAttribEncQualityRange 

Encoding quality range attribute. Read-only.

This attribute conveys whether the driver supports different quality level settings for encoding. A value less than or equal to 1 means that the encoder only has a single quality setting, and a value greater than 1 represents the number of quality levels that can be configured. e.g. a value of 2 means there are two distinct quality levels.

VAConfigAttribEncQuantization 

Encoding quantization attribute. Read-only.

This attribute conveys whether the driver supports certain types of quantization methods for encoding (e.g. trellis). See VA_ENC_QUANTIZATION_xxx for the list of quantization methods

VAConfigAttribEncIntraRefresh 

Encoding intra refresh attribute. Read-only.

This attribute conveys whether the driver supports certain types of intra refresh methods for encoding (e.g. adaptive intra refresh or rolling intra refresh). See VA_ENC_INTRA_REFRESH_xxx for intra refresh methods

VAConfigAttribEncSkipFrame 

Encoding skip frame attribute. Read-only.

This attribute conveys whether the driver supports sending skip frame parameters (VAEncMiscParameterTypeSkipFrame) to the encoder's rate control, when the user has externally skipped frames.

VAConfigAttribEncROI 

Encoding region-of-interest (ROI) attribute. Read-only.

This attribute conveys whether the driver supports region-of-interest (ROI) encoding, based on user provided ROI rectangles. The attribute value is partitioned into fields as defined in the VAConfigAttribValEncROI union.

If ROI encoding is supported, the ROI information is passed to the driver using VAEncMiscParameterTypeROI.

VAConfigAttribEncRateControlExt 

Encoding extended rate control attribute. Read-only.

This attribute conveys whether the driver supports any extended rate control features The attribute value is partitioned into fields as defined in the VAConfigAttribValEncRateControlExt union.

VAConfigAttribProcessingRate 

Processing rate reporting attribute. Read-only.

This attribute conveys whether the driver supports reporting of encode/decode processing rate based on certain set of parameters (i.e. levels, I frame internvals) for a given configuration. If this is supported, vaQueryProcessingRate() can be used to get encode or decode processing rate. See VA_PROCESSING_RATE_xxx for encode/decode processing rate

VAConfigAttribEncDirtyRect 

Encoding dirty rectangle. Read-only.

This attribute conveys whether the driver supports dirty rectangle. encoding, based on user provided ROI rectangles which indicate the rectangular areas where the content has changed as compared to the previous picture. The regions of the picture that are not covered by dirty rect rectangles are assumed to have not changed compared to the previous picture. The encoder may do some optimizations based on this information. The attribute value returned indicates the number of regions that are supported. e.g. A value of 0 means dirty rect encoding is not supported. If dirty rect encoding is supported, the ROI information is passed to the driver using VAEncMiscParameterTypeDirtyRect.

VAConfigAttribEncParallelRateControl 

Parallel Rate Control (hierachical B) attribute. Read-only.

This attribute conveys whether the encoder supports parallel rate control. It is a integer value 0 - unsupported, > 0 - maximum layer supported. This is the way when hireachical B frames are encoded, multiple independent B frames on the same layer may be processed at same time. If supported, app may enable it by setting enable_parallel_brc in VAEncMiscParameterRateControl,and the number of B frames per layer per GOP will be passed to driver through VAEncMiscParameterParallelRateControl structure.Currently three layers are defined.

VAConfigAttribEncDynamicScaling 

Dynamic Scaling Attribute. Read-only.

This attribute conveys whether encoder is capable to determine dynamic frame resolutions adaptive to bandwidth utilization and processing power, etc. It is a boolean value 0 - unsupported, 1 - supported. If it is supported,for VP9, suggested frame resolution can be retrieved from VACodedBufferVP9Status.

VAConfigAttribFrameSizeToleranceSupport 

frame size tolerance support it indicates the tolerance of frame size

VAConfigAttribFEIFunctionType 

Encode function type for FEI.

This attribute conveys whether the driver supports different function types for encode. It can be VA_FEI_FUNCTION_ENC, VA_FEI_FUNCTION_PAK, or VA_FEI_FUNCTION_ENC_PAK. Currently it is for FEI entry point only. Default is VA_FEI_FUNCTION_ENC_PAK.

VAConfigAttribFEIMVPredictors 

Maximum number of FEI MV predictors. Read-only.

This attribute determines the maximum number of MV predictors the driver can support to encode a single frame. 0 means no MV predictor is supported. Currently it is for FEI entry point only.

VAConfigAttribStats 

Statistics attribute. Read-only.

This attribute exposes a number of capabilities of the VAEntrypointStats entry point. The attribute value is partitioned into fields as defined in the VAConfigAttribValStats union. Currently it is for VAEntrypointStats only.

VAConfigAttribEncTileSupport 

Tile Support Attribute. Read-only.

This attribute conveys whether encoder is capable to support tiles. If not supported, the tile related parameters sent to encoder, such as tiling structure, should be ignored. 0 - unsupported, 1 - supported.

VAConfigAttribCustomRoundingControl 

whether accept rouding setting from application. Read-only. This attribute is for encode quality, if it is report, application can change the rounding setting by VAEncMiscParameterTypeCustomRoundingControl

VAConfigAttribQPBlockSize 

Encoding QP info block size attribute. Read-only. This attribute conveys the block sizes that underlying driver support for QP info for buffer #VAEncQpBuffer.

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 attributes are supported by the driver, and then set the appropriate attributes before calling vaPutSurface()

Enumerator
VAEncMiscParameterTypeMaxFrameSize 

Buffer type used to express a maximum frame size (in bits).

VAEncMiscParameterTypeHRD 

Buffer type used for HRD parameters.

VAEncMiscParameterTypeRIR 

Buffer type used for Rolling intra refresh.

VAEncMiscParameterTypeQuantization 

Buffer type used for quantization parameters, it's per-sequence parameter.

VAEncMiscParameterTypeSkipFrame 

Buffer type used for sending skip frame parameters to the encoder's rate control, when the user has externally skipped frames.

VAEncMiscParameterTypeROI 

Buffer type used for region-of-interest (ROI) parameters.

VAEncMiscParameterTypeTemporalLayerStructure 

Buffer type used for temporal layer structure.

VAEncMiscParameterTypeDirtyRect 

Buffer type used for dirty region-of-interest (ROI) parameters.

VAEncMiscParameterTypeParallelBRC 

Buffer type used for parallel BRC parameters.

VAEncMiscParameterTypeSubMbPartPel 

Set MB partion mode mask and Half-pel/Quant-pel motion search.

VAEncMiscParameterTypeEncQuality 

set encode quality tuning

VAEncMiscParameterTypeCustomRoundingControl 

Buffer type used for encoder rounding offset parameters.

VAEncMiscParameterTypeFEIFrameControl 

Buffer type used for FEI input frame level parameters.

VAEncMiscParameterTypeExtensionData 

encode extension buffer, ect. MPEG2 Sequence extenstion data

Packed header type.

Enumerator
VAEncPackedHeaderSequence 

Packed sequence header.

VAEncPackedHeaderPicture 

Packed picture header.

VAEncPackedHeaderSlice 

Packed slice header.

VAEncPackedHeaderRawData 

Packed raw header.

Packed raw data header can be used by the client to insert a header into the bitstream data buffer at the point it is passed, the driver will handle the raw packed header based on "has_emulation_bytes" field in the packed header parameter structure.

va_deprecated_enum 

Misc packed header. See codec-specific definitions.

Deprecated:
This is a deprecated packed header type. All applications can use VAEncPackedHeaderRawData to insert a codec-specific packed header

Currently defined entrypoints

Enumerator
VAEntrypointVideoProc 

Video pre/post-processing.

VAEntrypointFEI 

VAEntrypointFEI.

The purpose of FEI (Flexible Encoding Infrastructure) is to allow applications to have more controls and trade off quality for speed with their own IPs. The application can optionally provide input to ENC for extra encode control and get the output from ENC. Application can chose to modify the ENC output/PAK input during encoding, but the performance impact is significant.

On top of the existing buffers for normal encode, there will be one extra input buffer (VAEncMiscParameterFEIFrameControl) and three extra output buffers (VAEncFEIMVBufferType, VAEncFEIMBModeBufferType and VAEncFEIDistortionBufferType) for VAEntrypointFEI entry function. If separate PAK is set, two extra input buffers (VAEncFEIMVBufferType, VAEncFEIMBModeBufferType) are needed for PAK input.

VAEntrypointStats 

VAEntrypointStats.

A pre-processing function for getting some statistics and motion vectors is added, and some extra controls for Encode pipeline are provided. The application can optionally call the statistics function to get motion vectors and statistics like variances, distortions before calling Encode function via this entry point.

Checking whether Statistics is supported can be performed with vaQueryConfigEntrypoints(). If Statistics entry point is supported, then the list of returned entry-points will include VAEntrypointStats. Supported pixel format, maximum resolution and statistics specific attributes can be obtained via normal attribute query. One input buffer (VAStatsStatisticsParameterBufferType) and one or two output buffers (VAStatsStatisticsBufferType, VAStatsStatisticsBottomFieldBufferType (for interlace only) and VAStatsMVBufferType) are needed for this entry point.

Generic value types.

Enumerator
VAGenericValueTypeInteger 

32-bit signed integer.

VAGenericValueTypeFloat 

32-bit floating-point value.

VAGenericValueTypePointer 

Generic pointer type

VAGenericValueTypeFunc 

Pointer to function

VC-1 data structures

enum VAProfile

Currently defined profiles

Enumerator
VAProfileNone 

Profile ID used for video processing.

va_deprecated_enum 

Misc packed header. See codec-specific definitions.

Deprecated:
This is a deprecated packed header type. All applications can use VAEncPackedHeaderRawData to insert a codec-specific packed header

Surface attribute types.

Enumerator
VASurfaceAttribPixelFormat 

Pixel format (fourcc).

The value is meaningful as input to vaQuerySurfaceAttributes(). If zero, the driver returns the optimal pixel format for the specified config. Otherwise, if non-zero, the value represents a pixel format (FOURCC) that is kept as is on output, if the driver supports it. Otherwise, the driver sets the value to zero and drops the VA_SURFACE_ATTRIB_SETTABLE flag.

VASurfaceAttribMinWidth 

Minimal width in pixels (int, read-only).

VASurfaceAttribMaxWidth 

Maximal width in pixels (int, read-only).

VASurfaceAttribMinHeight 

Minimal height in pixels (int, read-only).

VASurfaceAttribMaxHeight 

Maximal height in pixels (int, read-only).

VASurfaceAttribMemoryType 

Surface memory type expressed in bit fields (int, read/write).

VASurfaceAttribExternalBufferDescriptor 

External buffer descriptor (pointer, write).

VASurfaceAttribUsageHint 

Surface usage hint, gives the driver a hint of intended usage to optimize allocation (e.g. tiling) (int, read/write).

VASurfaceAttribCount 

Number of surface attributes.

Function Documentation

VAStatus vaAcquireBufferHandle ( VADisplay  dpy,
VABufferID  buf_id,
VABufferInfo buf_info 
)

Acquires buffer handle for external API usage.

Locks the VA buffer object buf_id for external API usage like EGL or OpenCL (OCL). This function is a synchronization point. This means that any pending operation is guaranteed to be completed prior to returning from the function.

If the referenced VA buffer object is the backing store of a VA surface, then this function acts as if vaSyncSurface() on the parent surface was called first.

The VABufferInfo argument shall be zero'ed on input. On successful output, the data structure is filled in with all the necessary buffer level implementation details like handle, type, memory type and memory size.

Note: the external API implementation, or the application, can express the memory types it is interested in by filling in the mem_type field accordingly. On successful output, the memory type that fits best the request and that was used is updated in the VABufferInfo data structure. If none of the supplied memory types is supported, then a VA_STATUS_ERROR_UNSUPPORTED_MEMORY_TYPE error is returned.

The VABufferInfo data is valid until vaReleaseBufferHandle() is called. Besides, no additional operation is allowed on any of the buffer parent object until vaReleaseBufferHandle() is called. e.g. decoding into a VA surface backed with the supplied VA buffer object buf_id would fail with a VA_STATUS_ERROR_SURFACE_BUSY error.

Possible errors:

  • VA_STATUS_ERROR_UNIMPLEMENTED: the VA driver implementation does not support this interface
  • VA_STATUS_ERROR_INVALID_DISPLAY: an invalid display was supplied
  • VA_STATUS_ERROR_INVALID_BUFFER: an invalid buffer was supplied
  • VA_STATUS_ERROR_UNSUPPORTED_BUFFERTYPE: the implementation does not support exporting buffers of the specified type
  • VA_STATUS_ERROR_UNSUPPORTED_MEMORY_TYPE: none of the requested memory types in VABufferInfo::mem_type was supported
Parameters
[in]dpythe VA display
[in]buf_idthe VA buffer
[in,out]buf_infothe associated VA buffer information
Returns
VA_STATUS_SUCCESS if successful
VAStatus vaAssociateSubpicture ( VADisplay  dpy,
VASubpictureID  subpicture,
VASurfaceID *  target_surfaces,
int  num_surfaces,
int16_t  src_x,
int16_t  src_y,
uint16_t  src_width,
uint16_t  src_height,
int16_t  dest_x,
int16_t  dest_y,
uint16_t  dest_width,
uint16_t  dest_height,
uint32_t  flags 
)

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). Both will be displayed at the next call to vaPutSurface. Additional associations before the call to vaPutSurface simply overrides the association.

VAStatus vaBeginPicture ( VADisplay  dpy,
VAContextID  context,
VASurfaceID  render_target 
)

Render (Video Decode/Encode/Processing) Pictures

A picture represents either a frame or a field.

The Begin/Render/End sequence sends the video decode/encode/processing buffers to the server Get ready for a video pipeline

  • decode a picture to a target surface
  • encode a picture from a target surface
  • process a picture to a target surface
VAStatus vaBufferSetNumElements ( VADisplay  dpy,
VABufferID  buf_id,
unsigned int  num_elements 
)

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 that are valid in the buffer.

VAStatus vaCreateBuffer ( VADisplay  dpy,
VAContextID  context,
VABufferType  type,
unsigned int  size,
unsigned int  num_elements,
void *  data,
VABufferID buf_id 
)

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 are undefined. Basically there are two ways to get buffer data to the server side. One is to call vaCreateBuffer() with a non-null "data", which results the data being copied to the data store on the server side. A different method that eliminates this copy is to pass null as "data" when calling vaCreateBuffer(), and then use vaMapBuffer() to map the data store from the server side to the client address space for access. The user must call vaDestroyBuffer() to destroy a buffer. Note: image buffers are created by the library, not the client. Please see vaCreateImage on how image buffers are managed.

VAStatus vaCreateBuffer2 ( VADisplay  dpy,
VAContextID  context,
VABufferType  type,
unsigned int  width,
unsigned int  height,
unsigned int *  unit_size,
unsigned int *  pitch,
VABufferID buf_id 
)

Create a buffer for given width & height get unit_size, pitch, buf_id for 2D buffer for permb qp buffer, it will return unit_size for one MB or LCU and the pitch for alignments can call vaMapBuffer with this Buffer ID to get virtual address. e.g. AVC 1080P encode, 1920x1088, the size in MB is 120x68,but inside driver, maybe it should align with 256, and one byte present one Qp.so, call the function. then get unit_size = 1, pitch = 256. call vaMapBuffer to get the virtual address (pBuf). then read write the memory like 2D. the size is 256x68, application can only use 120x68 pBuf + 256 is the start of next line. different driver implementation maybe return different unit_size and pitch

VAStatus vaCreateConfig ( VADisplay  dpy,
VAProfile  profile,
VAEntrypoint  entrypoint,
VAConfigAttrib attrib_list,
int  num_attribs,
VAConfigID *  config_id 
)

Create a configuration for the video decode/encode/processing pipeline it passes in the attribute list that specifies the attributes it cares about, with the rest taking default values.

VAStatus vaCreateContext ( VADisplay  dpy,
VAConfigID  config_id,
int  picture_width,
int  picture_height,
int  flag,
VASurfaceID *  render_targets,
int  num_render_targets,
VAContextID context 
)

vaCreateContext - Create a context dpy: display config_id: configuration for the context picture_width: coded picture width picture_height: coded picture height flag: any combination of the following: VA_PROGRESSIVE (only progressive frame pictures in the sequence when set) render_targets: a hint for render targets (surfaces) tied to the context num_render_targets: number of render targets in the above array context: created context id upon return

VAStatus vaCreateImage ( VADisplay  dpy,
VAImageFormat *  format,
int  width,
int  height,
VAImage *  image 
)

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, image->buf has been created and proper storage allocated by the library. The client can access the image through the Map/Unmap calls.

VAStatus vaCreateMFContext ( VADisplay  dpy,
VAMFContextID *  mf_context 
)

vaCreateMFContext - Create a multi-frame context interface encapsulating common for all streams memory objects and structures required for single GPU task submission from several VAContextID's. Allocation: This call only creates an instance, doesn't allocate any additional memory. Support identification: Application can identify multi-frame feature support by ability to create multi-frame context. If driver supports multi-frame - call successful, mf_context != NULL and VAStatus = VA_STATUS_SUCCESS, otherwise if multi-frame processing not supported driver returns VA_STATUS_ERROR_UNIMPLEMENTED and mf_context = NULL. return values: VA_STATUS_SUCCESS - operation successful. VA_STATUS_ERROR_UNIMPLEMENTED - no support for multi-frame. dpy: display adapter. mf_context: Multi-Frame context encapsulating all associated context for multi-frame submission.

VAStatus vaCreateSubpicture ( VADisplay  dpy,
VAImageID  image,
VASubpictureID subpicture 
)

Subpictures are created with an image associated.

VAStatus vaCreateSurfaces ( VADisplay  dpy,
unsigned int  format,
unsigned int  width,
unsigned int  height,
VASurfaceID *  surfaces,
unsigned int  num_surfaces,
VASurfaceAttrib attrib_list,
unsigned int  num_attribs 
)

Creates an array of surfaces.

Creates an array of surfaces. The optional list of attributes shall be constructed based on what the underlying hardware could expose through vaQuerySurfaceAttributes().

Parameters
[in]dpythe VA display
[in]formatthe desired surface format. See VA_RT_FORMAT_*
[in]widththe surface width
[in]heightthe surface height
[out]surfacesthe array of newly created surfaces
[in]num_surfacesthe number of surfaces to create
[in]attrib_listthe list of (optional) attributes, or NULL
[in]num_attribsthe number of attributes supplied in attrib_list, or zero
VAStatus vaDeassociateSubpicture ( VADisplay  dpy,
VASubpictureID  subpicture,
VASurfaceID *  target_surfaces,
int  num_surfaces 
)

vaDeassociateSubpicture removes the association of the subpicture with target_surfaces.

VAStatus vaDeriveImage ( VADisplay  dpy,
VASurfaceID  surface,
VAImage *  image 
)

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 direct CPU access. This operation is only possible on implementations with direct rendering capabilities and internal surface formats that can be represented with a VAImage. When the operation is not possible this interface will return VA_STATUS_ERROR_OPERATION_FAILED. Clients should then fall back to using vaCreateImage + vaPutImage to accomplish the same task in an indirect manner.

Implementations should only return success when the resulting image buffer would be useable with vaMap/Unmap.

When directly accessing a surface special care must be taken to insure proper synchronization with the graphics hardware. Clients should call vaQuerySurfaceStatus to insure that a surface is not the target of concurrent rendering or currently being displayed by an overlay.

Additionally nothing about the contents of a surface should be assumed following a vaPutSurface. Implementations are free to modify the surface for scaling or subpicture blending within a call to vaPutImage.

Calls to vaPutImage or vaGetImage using the same surface from which the image has been derived will return VA_STATUS_ERROR_SURFACE_BUSY. vaPutImage or vaGetImage with other surfaces is supported.

An image created with vaDeriveImage should be freed with vaDestroyImage. The image and image buffer structures will be destroyed; however, the underlying surface will remain unchanged until freed with vaDestroySurfaces.

VAStatus vaDestroyBuffer ( VADisplay  dpy,
VABufferID  buffer_id 
)

After this call, the buffer is deleted and this buffer_id is no longer valid

A buffer can be re-used and sent to the server by another Begin/Render/End sequence if vaDestroyBuffer() is not called with this buffer.

Note re-using a shared buffer (e.g. a slice data buffer) between the host and the hardware accelerator can result in performance dropping.

VAStatus vaDestroyConfig ( VADisplay  dpy,
VAConfigID  config_id 
)

Free resources associdated with a given config

VAStatus vaDestroyContext ( VADisplay  dpy,
VAContextID  context 
)

vaDestroyContext - Destroy a context dpy: display context: context to be destroyed

VAStatus vaDestroyImage ( VADisplay  dpy,
VAImageID  image 
)

Should call DestroyImage before destroying the surface it is bound to

VAStatus vaDestroySubpicture ( VADisplay  dpy,
VASubpictureID  subpicture 
)

Destroy the subpicture before destroying the image it is assocated to

VAStatus vaDestroySurfaces ( VADisplay  dpy,
VASurfaceID *  surfaces,
int  num_surfaces 
)

vaDestroySurfaces - Destroy resources associated with surfaces. Surfaces can only be destroyed after all contexts using these surfaces have been destroyed. dpy: display surfaces: array of surfaces to destroy num_surfaces: number of surfaces in the array to be destroyed.

VAStatus vaEndPicture ( VADisplay  dpy,
VAContextID  context 
)

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 Begin/Render/End sequence on a different render target. if VAContextID used in this function previously successfully passed vaMFAddContext call, real processing will be started during vaMFSubmit

const char* vaErrorStr ( VAStatus  error_status)

Returns a short english description of error_status

VAStatus vaExportSurfaceHandle ( VADisplay  dpy,
VASurfaceID  surface_id,
uint32_t  mem_type,
uint32_t  flags,
void *  descriptor 
)

Export a handle to a surface for use with an external API.

The exported handles are owned by the caller, and the caller is responsible for freeing them when no longer needed (e.g. by closing DRM PRIME file descriptors).

This does not perform any synchronisation. If the contents of the surface will be read, vaSyncSurface() must be called before doing so. If the contents of the surface are written, then all operations must be completed externally before using the surface again by via VA-API functions.

Parameters
[in]dpyVA display.
[in]surface_idSurface to export.
[in]mem_typeMemory type to export to.
[in]flagsCombination of flags to apply (VA_EXPORT_SURFACE_*).
[out]descriptorPointer to the descriptor structure to fill with the handle details. The type of this structure depends on the value of mem_type.
Returns
Status code:
  • VA_STATUS_SUCCESS: Success.
  • VA_STATUS_ERROR_INVALID_DISPLAY: The display is not valid.
  • VA_STATUS_ERROR_UNIMPLEMENTED: The driver does not implement this interface.
  • VA_STATUS_ERROR_INVALID_SURFACE: The surface is not valid, or the surface is not exportable in the specified way.
  • VA_STATUS_ERROR_UNSUPPORTED_MEMORY_TYPE: The driver does not support exporting surfaces to the specified memory type.
VAStatus vaGetConfigAttributes ( VADisplay  dpy,
VAProfile  profile,
VAEntrypoint  entrypoint,
VAConfigAttrib attrib_list,
int  num_attribs 
)

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 updated with their value. Unknown attributes or attributes that are not supported for the given profile/entrypoint pair will have their value set to VA_ATTRIB_NOT_SUPPORTED

VAStatus vaGetImage ( VADisplay  dpy,
VASurfaceID  surface,
int  x,
int  y,
unsigned int  width,
unsigned int  height,
VAImageID  image 
)

Retrive surface data into a VAImage Image must be in a format supported by the implementation

VAPrivFunc vaGetLibFunc ( VADisplay  dpy,
const char *  func 
)

Return a function pointer given a function name in the library. This allows private interfaces into the library

VAStatus vaInitialize ( VADisplay  dpy,
int *  major_version,
int *  minor_version 
)

Initialize the library

VAStatus vaMapBuffer ( VADisplay  dpy,
VABufferID  buf_id,
void **  pbuf 
)

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()

if buffer type is VAEncCodedBufferType, pbuf points to link-list of VACodedBufferSegment, and the list is terminated if "next" is NULL

int vaMaxNumConfigAttributes ( VADisplay  dpy)

Get maximum number of attributs supported by the implementation

int vaMaxNumEntrypoints ( VADisplay  dpy)

Get maximum number of entrypoints supported by the implementation

int vaMaxNumImageFormats ( VADisplay  dpy)

Get maximum number of image formats supported by the implementation

int vaMaxNumProfiles ( VADisplay  dpy)

Get maximum number of profiles supported by the implementation

int vaMaxNumSubpictureFormats ( VADisplay  dpy)

Get maximum number of subpicture formats supported by the implementation

VAStatus vaMFAddContext ( VADisplay  dpy,
VAMFContextID  mf_context,
VAContextID  context 
)

vaMFAddContext - Provide ability to associate each context used for Multi-Frame submission and common Multi-Frame context. Try to add context to understand if it is supported. Allocation: this call allocates and/or reallocates all memory objects common for all contexts associated with particular Multi-Frame context. All memory required for each context(pixel buffers, internal driver buffers required for processing) allocated during standard vaCreateContext call for each context. Runtime dependency - if current implementation doesn't allow to run different entry points/profile, first context added will set entry point/profile for whole Multi-Frame context, all other entry points and profiles can be rejected to be added. Return values: VA_STATUS_SUCCESS - operation successful, context was added. VA_STATUS_ERROR_OPERATION_FAILED - something unexpected happened - application have to close current mf_context and associated contexts and start working with new ones. VA_STATUS_ERROR_INVALID_CONTEXT - ContextID is invalid, means: 1 - mf_context is not valid context or 2 - driver can't suport different VAEntrypoint or VAProfile simultaneosly and current context contradicts with previously added, application can continue with current mf_context and other contexts passed this call, rejected context can continue work in stand-alone mode or other mf_context. VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT - particular context being added was created with with unsupported VAEntrypoint. Application can continue with current mf_context and other contexts passed this call, rejected context can continue work in stand-alone mode. VA_STATUS_ERROR_UNSUPPORTED_PROFILE - Current context with Particular VAEntrypoint is supported but VAProfile is not supported. Application can continue with current mf_context and other contexts passed this call, rejected context can continue work in stand-alone mode. dpy: display adapter. context: context being associated with Multi-Frame context. mf_context: - multi-frame context used to associate contexts for multi-frame submission.

VAStatus vaMFReleaseContext ( VADisplay  dpy,
VAMFContextID  mf_context,
VAContextID  context 
)

vaMFReleaseContext - Removes context from multi-frame and association with multi-frame context. After association removed vaEndPicture will submit tasks, but not vaMFSubmit. Return values: VA_STATUS_SUCCESS - operation successful, context was removed. VA_STATUS_ERROR_OPERATION_FAILED - something unexpected happened. application need to destroy this VAMFContextID and all assotiated VAContextID dpy: display mf_context: VAMFContextID where context is added context: VAContextID to be added

VAStatus vaMFSubmit ( VADisplay  dpy,
VAMFContextID  mf_context,
VAContextID contexts,
int  num_contexts 
)

Make the end of rendering for a pictures in contexts passed with submission. The server should start processing all pending operations for contexts. All contexts passed should be associated through vaMFAddContext and call sequence Begin/Render/End performed. This call is non-blocking. The client can start another Begin/Render/End/vaMFSubmit sequence on a different render targets. Return values: VA_STATUS_SUCCESS - operation successful, context was removed. VA_STATUS_ERROR_INVALID_CONTEXT - mf_context or one of contexts are invalid due to mf_context not created or one of contexts not assotiated with mf_context through vaAddContext. VA_STATUS_ERROR_INVALID_PARAMETER - one of context has not submitted it's frame through vaBeginPicture vaRenderPicture vaEndPicture call sequence. dpy: display mf_context: Multi-Frame context contexts: list of contexts submitting their tasks for multi-frame operation. num_contexts: number of passed contexts.

VAStatus vaPutImage ( VADisplay  dpy,
VASurfaceID  surface,
VAImageID  image,
int  src_x,
int  src_y,
unsigned int  src_width,
unsigned int  src_height,
int  dest_x,
int  dest_y,
unsigned int  dest_width,
unsigned int  dest_height 
)

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 shouldn't be rendered into when this is called

VAStatus vaQueryConfigAttributes ( VADisplay  dpy,
VAConfigID  config_id,
VAProfile profile,
VAEntrypoint entrypoint,
VAConfigAttrib attrib_list,
int *  num_attribs 
)

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" The caller must provide an "attrib_list" array that can hold at least vaMaxNumConfigAttributes() entries. The actual number of attributes returned in "attrib_list" is returned in "num_attribs"

VAStatus vaQueryConfigEntrypoints ( VADisplay  dpy,
VAProfile  profile,
VAEntrypoint entrypoint_list,
int *  num_entrypoints 
)

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 returned in "entrypoint_list" is returned in "num_entrypoints".

VAStatus vaQueryConfigProfiles ( VADisplay  dpy,
VAProfile profile_list,
int *  num_profiles 
)

Query supported profiles The caller must provide a "profile_list" array that can hold at least vaMaxNumProfile() entries. The actual number of profiles returned in "profile_list" is returned in "num_profile".

VAStatus vaQueryImageFormats ( VADisplay  dpy,
VAImageFormat *  format_list,
int *  num_formats 
)

Query supported image formats The caller must provide a "format_list" array that can hold at least vaMaxNumImageFormats() entries. The actual number of formats returned in "format_list" is returned in "num_formats".

VAStatus vaQueryProcessingRate ( VADisplay  dpy,
VAConfigID  config,
VAProcessingRateParameter *  proc_buf,
unsigned int *  processing_rate 
)

Queries processing rate for the supplied config.

This function queries the processing rate based on parameters in proc_buf for the given config. Upon successful return, the processing rate value will be stored in processing_rate. Processing rate is specified as the number of macroblocks/CTU per second.

If NULL is passed to the proc_buf, the default processing rate for the given configuration will be returned.

Parameters
[in]dpythe VA display
[in]configthe config identifying a codec or a video processing pipeline
[in]proc_bufthe buffer that contains the parameters for either the encode or decode processing rate
[out]processing_rateprocessing rate in number of macroblocks per second constrained by parameters specified in proc_buf
VAStatus vaQuerySubpictureFormats ( VADisplay  dpy,
VAImageFormat *  format_list,
unsigned int *  flags,
unsigned int *  num_formats 
)

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 for each format to indicate additional capabilities for that format. The actual number of formats returned in "format_list" is returned in "num_formats". flags: returned value to indicate addtional capabilities VA_SUBPICTURE_CHROMA_KEYING - supports chroma-keying VA_SUBPICTURE_GLOBAL_ALPHA - supports global alpha VA_SUBPICTURE_DESTINATION_IS_SCREEN_COORD - supports unscaled screen relative subpictures for On Screen Display

VAStatus vaQuerySurfaceAttributes ( VADisplay  dpy,
VAConfigID  config,
VASurfaceAttrib attrib_list,
unsigned int *  num_attribs 
)

Queries surface attributes for the supplied config.

This function queries for all supported attributes for the supplied VA . In particular, if the underlying hardware supports the creation of VA surfaces in various formats, then this function will enumerate all pixel formats that are supported.

The attrib_list array is allocated by the user and num_attribs shall be initialized to the number of allocated elements in that array. Upon successful return, the actual number of attributes will be overwritten into num_attribs. Otherwise, VA_STATUS_ERROR_MAX_NUM_EXCEEDED is returned and num_attribs is adjusted to the number of elements that would be returned if enough space was available.

Note: it is perfectly valid to pass NULL to the attrib_list argument when vaQuerySurfaceAttributes() is used to determine the actual number of elements that need to be allocated.

Parameters
[in]dpythe VA display
[in]configthe config identifying a codec or a video processing pipeline
[out]attrib_listthe output array of VASurfaceAttrib elements
[in,out]num_attribsthe number of elements allocated on input, the number of elements actually filled in output
VAStatus vaQuerySurfaceError ( VADisplay  dpy,
VASurfaceID  surface,
VAStatus  error_status,
void **  error_info 
)

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", upon the return, error_info will point to an array of _VASurfaceDecodeMBErrors structure, which is allocated and filled by libVA with detailed information on the missing or error macroblocks. The array is terminated if "status==-1" is detected.

VAStatus vaQuerySurfaceStatus ( VADisplay  dpy,
VASurfaceID  render_target,
VASurfaceStatus *  status 
)

Find out any pending ops on the render target

const char* vaQueryVendorString ( 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 specific and at the discretion of the implementer. e.g. for the Intel GMA500 implementation, an example would be: "Intel GMA500 - 2.0.0.32L.0005"

VAStatus vaReleaseBufferHandle ( VADisplay  dpy,
VABufferID  buf_id 
)

Releases buffer after usage from external API.

Unlocks the VA buffer object buf_id from external API usage like EGL or OpenCL (OCL). This function is a synchronization point. This means that any pending operation is guaranteed to be completed prior to returning from the function.

The VABufferInfo argument shall point to the original data structure that was obtained from vaAcquireBufferHandle(), unaltered. This is necessary so that the VA driver implementation could deallocate any resources that were needed.

In any case, returning from this function invalidates any contents in VABufferInfo. i.e. the underlyng buffer handle is no longer valid. Therefore, VA driver implementations are free to reset this data structure to safe defaults.

Possible errors:

  • VA_STATUS_ERROR_UNIMPLEMENTED: the VA driver implementation does not support this interface
  • VA_STATUS_ERROR_INVALID_DISPLAY: an invalid display was supplied
  • VA_STATUS_ERROR_INVALID_BUFFER: an invalid buffer was supplied
  • VA_STATUS_ERROR_UNSUPPORTED_BUFFERTYPE: the implementation does not support exporting buffers of the specified type
Parameters
[in]dpythe VA display
[in]buf_idthe VA buffer
Returns
VA_STATUS_SUCCESS if successful
VAStatus vaRenderPicture ( VADisplay  dpy,
VAContextID  context,
VABufferID buffers,
int  num_buffers 
)

Send video decode, encode or processing buffers to the server.

VAStatus vaSetDriverName ( VADisplay  dpy,
char *  driver_name 
)

Set the override driver name instead of queried driver driver.

VAMessageCallback vaSetErrorCallback ( VADisplay  dpy,
VAMessageCallback  callback,
void *  user_context 
)

Set the callback for error messages, or NULL for no logging. Returns the previous one, or NULL if it was disabled.

VAMessageCallback vaSetInfoCallback ( VADisplay  dpy,
VAMessageCallback  callback,
void *  user_context 
)

Set the callback for info messages, or NULL for no logging. Returns the previous one, or NULL if it was disabled.

VAStatus vaSetSubpictureChromakey ( VADisplay  dpy,
VASubpictureID  subpicture,
unsigned int  chromakey_min,
unsigned int  chromakey_max,
unsigned int  chromakey_mask 
)

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: For RGB: [0:7] Red [8:15] Blue [16:23] Green For YUV: [0:7] V [8:15] U [16:23] Y The chromakey mask can be used to mask out certain components for chromakey comparision

VAStatus vaSetSubpictureGlobalAlpha ( VADisplay  dpy,
VASubpictureID  subpicture,
float  global_alpha 
)

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

VAStatus vaSetSubpictureImage ( VADisplay  dpy,
VASubpictureID  subpicture,
VAImageID  image 
)

Bind an image to the subpicture. This image will now be associated with the subpicture instead of the one at creation.

VAStatus vaSyncSurface ( VADisplay  dpy,
VASurfaceID  render_target 
)

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.

VAStatus vaTerminate ( VADisplay  dpy)

After this call, all library internal resources will be cleaned up

VAStatus vaUnmapBuffer ( VADisplay  dpy,
VABufferID  buf_id 
)

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