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

Classes

struct  VARectangle
 Structure to describe rectangle. More...
 
struct  VAMotionVector
 Generic motion vector data structure. More...
 
struct  VAConfigAttrib
 
union  VAConfigAttribValMaxFrameSize
 Attribute value for VAConfigAttribMaxFrameSize. More...
 
union  VAConfigAttribValEncJPEG
 Attribute value for VAConfigAttribEncJPEG. More...
 
union  VAConfigAttribValEncROI
 Attribute value for VAConfigAttribEncROI. More...
 
union  VAConfigAttribValEncRateControlExt
 Attribute value for VAConfigAttribEncRateControlExt. More...
 
union  VAConfigAttribValMultipleFrame
 Attribute value for VAConfigAttribMultipleFrame. More...
 
union  VAConfigAttribValContextPriority
 
union  VAConfigAttribValEncPerBlockControl
 
struct  VAGenericValue
 Generic value. More...
 
struct  VASurfaceAttrib
 Surface attribute. More...
 
union  VASurfaceAttribAlignmentStruct
 VASurfaceAttribAlignmentStruct structure for the VASurfaceAttribAlignmentSize attribute. More...
 
struct  VASurfaceAttribExternalBuffers
 VASurfaceAttribExternalBuffers structure for the VASurfaceAttribExternalBufferDescriptor attribute. More...
 
struct  VAContextParameterUpdateBuffer
 update the context parameter this structure is used to update context parameters, such as priority of the context backend driver should keep the parameter unchanged if there no new parameter updated. More...
 
struct  VAEncryptionSegmentInfo
 structure for encrypted segment info. More...
 
struct  VAEncryptionParameters
 Encryption parameters buffer for VAEncryptionParameterBufferType. 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  VAEncMiscParameterFrameRate
 
struct  VAEncMiscParameterMaxSliceSize
 
struct  VAEncMiscParameterHRD
 
struct  VAEncMiscParameterBufferMaxFrameSize
 Defines a maximum frame size (in bits). More...
 
struct  VAEncMiscParameterBufferMultiPassFrameSize
 Maximum frame size (in bytes) settings for multiple pass. 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_STATUS_ERROR_NOT_ENOUGH_BUFFER   0x00000025
 Indicate allocated buffer size is not enough for input or output.
 
#define VA_STATUS_ERROR_TIMEDOUT   0x00000026
 Indicate an operation isn't completed because time-out interval elapsed.
 
#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_FILTER_INTERPOLATION_DEFAULT   0x00000000
 
#define VA_PADDING_LOW   4
 
#define VA_EXEC_SYNC   0x0
 
#define VA_EXEC_ASYNC   0x1
 
#define VA_EXEC_MODE_DEFAULT   0x0
 
#define VA_FEATURE_NOT_SUPPORTED   0
 
#define VA_FEATURE_SUPPORTED   1
 
#define VA_FEATURE_REQUIRED   2
 
#define VA_RT_FORMAT_YUV420   0x00000001
 YUV 4:2:0 8-bit.
 
#define VA_RT_FORMAT_YUV422   0x00000002
 YUV 4:2:2 8-bit.
 
#define VA_RT_FORMAT_YUV444   0x00000004
 YUV 4:4:4 8-bit.
 
#define VA_RT_FORMAT_YUV411   0x00000008
 YUV 4:1:1 8-bit.
 
#define VA_RT_FORMAT_YUV400   0x00000010
 Greyscale 8-bit.
 
#define VA_RT_FORMAT_YUV420_10   0x00000100
 YUV 4:2:0 10-bit.
 
#define VA_RT_FORMAT_YUV422_10   0x00000200
 YUV 4:2:2 10-bit.
 
#define VA_RT_FORMAT_YUV444_10   0x00000400
 YUV 4:4:4 10-bit.
 
#define VA_RT_FORMAT_YUV420_12   0x00001000
 YUV 4:2:0 12-bit.
 
#define VA_RT_FORMAT_YUV422_12   0x00002000
 YUV 4:2:2 12-bit.
 
#define VA_RT_FORMAT_YUV444_12   0x00004000
 YUV 4:4:4 12-bit.
 
#define VA_RT_FORMAT_RGB16   0x00010000
 Packed RGB, 16 bits per pixel.
 
#define VA_RT_FORMAT_RGB32   0x00020000
 Packed RGB, 32 bits per pixel, 8 bits per colour sample.
 
#define VA_RT_FORMAT_RGBP   0x00100000
 Planar RGB, 8 bits per sample.
 
#define VA_RT_FORMAT_RGB32_10   0x00200000
 Packed RGB, 32 bits per pixel, 10 bits per colour sample.
 
#define VA_RT_FORMAT_RGB32_10BPP   VA_RT_FORMAT_RGB32_10
 
#define VA_RT_FORMAT_YUV420_10BPP   VA_RT_FORMAT_YUV420_10
 
#define VA_ATTRIB_NOT_SUPPORTED   0x80000000
 
#define VA_ENCRYPTION_TYPE_FULLSAMPLE_CTR   0x00000001 /* AES CTR fullsample */
 
#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_MAPBUFFER_FLAG_DEFAULT   0
 VA_MAPBUFFER_FLAG_DEFAULT is used when there are no flag specified same as VA_MAPBUFFER_FLAG_READ | VA_MAPBUFFER_FLAG_WRITE. More...
 
#define VA_MAPBUFFER_FLAG_READ   1
 application will read the surface after map
 
#define VA_MAPBUFFER_FLAG_WRITE   2
 application will write the surface after map
 
#define VA_TIMEOUT_INFINITE   0xFFFFFFFFFFFFFFFF
 Indicates an infinite timeout.
 
#define VA_FOURCC(ch0, ch1, ch2, ch3)
 
#define VA_FOURCC_NV12   0x3231564E
 
#define VA_FOURCC_NV21   0x3132564E
 
#define VA_FOURCC_AI44   0x34344149
 
#define VA_FOURCC_RGBA   0x41424752
 
#define VA_FOURCC_RGBX   0x58424752
 
#define VA_FOURCC_BGRA   0x41524742
 
#define VA_FOURCC_BGRX   0x58524742
 
#define VA_FOURCC_ARGB   0x42475241
 
#define VA_FOURCC_XRGB   0x42475258
 
#define VA_FOURCC_ABGR   0x52474241
 
#define VA_FOURCC_XBGR   0x52474258
 
#define VA_FOURCC_UYVY   0x59565955
 
#define VA_FOURCC_YUY2   0x32595559
 
#define VA_FOURCC_AYUV   0x56555941
 
#define VA_FOURCC_NV11   0x3131564e
 
#define VA_FOURCC_YV12   0x32315659
 
#define VA_FOURCC_P208   0x38303250
 
#define VA_FOURCC_I420   0x30323449
 
#define VA_FOURCC_YV24   0x34325659
 
#define VA_FOURCC_YV32   0x32335659
 
#define VA_FOURCC_Y800   0x30303859
 
#define VA_FOURCC_IMC3   0x33434D49
 
#define VA_FOURCC_411P   0x50313134
 
#define VA_FOURCC_411R   0x52313134
 
#define VA_FOURCC_422H   0x48323234
 
#define VA_FOURCC_422V   0x56323234
 
#define VA_FOURCC_444P   0x50343434
 
#define VA_FOURCC_RGBP   0x50424752
 
#define VA_FOURCC_BGRP   0x50524742
 
#define VA_FOURCC_RGB565   0x36314752
 
#define VA_FOURCC_BGR565   0x36314742
 
#define VA_FOURCC_Y210   0x30313259
 
#define VA_FOURCC_Y212   0x32313259
 
#define VA_FOURCC_Y216   0x36313259
 
#define VA_FOURCC_Y410   0x30313459
 
#define VA_FOURCC_Y412   0x32313459
 
#define VA_FOURCC_Y416   0x36313459
 
#define VA_FOURCC_YV16   0x36315659
 
#define VA_FOURCC_P010   0x30313050
 
#define VA_FOURCC_P012   0x32313050
 
#define VA_FOURCC_P016   0x36313050
 
#define VA_FOURCC_I010   0x30313049
 
#define VA_FOURCC_IYUV   0x56555949
 
#define VA_FOURCC_A2R10G10B10   0x30335241 /* VA_FOURCC('A','R','3','0') */
 
#define VA_FOURCC_A2B10G10R10   0x30334241 /* VA_FOURCC('A','B','3','0') */
 
#define VA_FOURCC_X2R10G10B10   0x30335258 /* VA_FOURCC('X','R','3','0') */
 
#define VA_FOURCC_X2B10G10R10   0x30334258 /* VA_FOURCC('X','B','3','0') */
 
#define VA_FOURCC_Y8   0x20203859
 
#define VA_FOURCC_Y16   0x20363159
 
#define VA_FOURCC_VYUY   0x59555956
 
#define VA_FOURCC_YVYU   0x55595659
 
#define VA_FOURCC_ARGB64   0x34475241
 
#define VA_FOURCC_ABGR64   0x34474241
 
#define VA_FOURCC_XYUV   0x56555958
 
#define VA_FOURCC_Q416   0x36313451
 
#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

enum  VAProfile { VAProfileNone = -1 , VAProfileMPEG2Simple = 0 , VAProfileMPEG2Main = 1 , VAProfileMPEG4Simple = 2 , VAProfileMPEG4AdvancedSimple = 3 , VAProfileMPEG4Main = 4 , va_deprecated_enum = 5 , VAProfileH264Main = 6 , VAProfileH264High = 7 , VAProfileVC1Simple = 8 , VAProfileVC1Main = 9 , VAProfileVC1Advanced = 10 , VAProfileH263Baseline = 11 , VAProfileJPEGBaseline = 12 , VAProfileH264ConstrainedBaseline = 13 , VAProfileVP8Version0_3 = 14 , VAProfileH264MultiviewHigh = 15 , VAProfileH264StereoHigh = 16 , VAProfileHEVCMain = 17 , VAProfileHEVCMain10 = 18 , VAProfileVP9Profile0 = 19 , VAProfileVP9Profile1 = 20 , VAProfileVP9Profile2 = 21 , VAProfileVP9Profile3 = 22 , VAProfileHEVCMain12 = 23 , VAProfileHEVCMain422_10 = 24 , VAProfileHEVCMain422_12 = 25 , VAProfileHEVCMain444 = 26 , VAProfileHEVCMain444_10 = 27 , VAProfileHEVCMain444_12 = 28 , VAProfileHEVCSccMain = 29 , VAProfileHEVCSccMain10 = 30 , VAProfileHEVCSccMain444 = 31 , VAProfileAV1Profile0 = 32 , VAProfileAV1Profile1 = 33 , VAProfileHEVCSccMain444_10 = 34 , VAProfileProtected = 35 , VAProfileH264High10 = 36 , VAProfileVVCMain10 = 37 , VAProfileVVCMultilayerMain10 = 38 }
 
enum  VAEntrypoint {
}
 
enum  VAConfigAttribType {
}
 
enum  VAGenericValueType { VAGenericValueTypeInteger = 1 , VAGenericValueTypeFloat , VAGenericValueTypePointer , VAGenericValueTypeFunc }
 Generic value types. More...
 
enum  VASurfaceAttribType {
}
 Surface attribute types. More...
 
enum  VABufferType {
}
 
enum  VAEncMiscParameterType {
}
 
enum  VAEncPackedHeaderType {
  VAEncPackedHeaderSequence = 1 , VAEncPackedHeaderPicture = 2 , VAEncPackedHeaderSlice = 3 , VAEncPackedHeaderRawData = 4 ,
  va_deprecated_enum = 5
}
 Packed header type. More...
 
enum  VAMvModeVC1
 
enum  VADisplayAttribBLEMode
 

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 vaSyncSurface2 (VADisplay dpy, VASurfaceID surface, uint64_t timeout_ns)
 Synchronizes pending operations associated with the supplied surface. More...
 
VAStatus vaQuerySurfaceStatus (VADisplay dpy, VASurfaceID render_target, VASurfaceStatus *status)
 
VAStatus vaQuerySurfaceError (VADisplay dpy, VASurfaceID surface, VAStatus error_status, void **error_info)
 
VAStatus vaSyncBuffer (VADisplay dpy, VABufferID buf_id, uint64_t timeout_ns)
 Synchronizes pending operations associated with the supplied buffer. More...
 
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...
 
#define VA_RC_QVBR   0x00000400
 Quality defined VBR Use Quality factor to determine the good enough QP for each MB such that good enough quality can be obtained without waste of bits for this BRC mode, you must set all legacy VBR parameters and reuse quality_factor in VAEncMiscParameterRateControl.
 
#define VA_RC_AVBR   0x00000800
 Average VBR Average variable bitrate control algorithm focuses on overall encoding quality while meeting the specified target bitrate, within the accuracy range, after a convergence period. bits_per_second in VAEncMiscParameterRateControl is target bitrate for AVBR. Convergence is specified in the unit of frame. window_size in VAEncMiscParameterRateControl is equal to convergence for AVBR. Accuracy is in the range of [1,100], 1 means one percent, and so on. target_percentage in VAEncMiscParameterRateControl is equal to accuracy for AVBR.
 
#define VA_RC_TCBRC   0x00001000
 Transport Controlled BRC Specific bitrate control for real time streaming. TCBRC can instantly react to channel change to remove or significantly reduce the delay. Application (transport) provides channel feedback to driver through TargetFrameSize. When channel condition is very good (almost no constraint on instant frame size), the app should set target frame size as zero. Otherwise, channel capacity divided by fps should be used.
 

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
 Driver support 1 row per slice.
 
#define VA_ENC_SLICE_STRUCTURE_MAX_SLICE_SIZE   0x00000008
 Driver support max encoded slice size per slice.
 
#define VA_ENC_SLICE_STRUCTURE_ARBITRARY_ROWS   0x00000010
 Driver supports an arbitrary number of rows per slice.
 
#define VA_ENC_SLICE_STRUCTURE_EQUAL_MULTI_ROWS   0x00000020
 Driver supports any number of rows per slice but they must be the same for all slices except for the last one, which must be equal or smaller to the previous slices.
 

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 VAConfigAttribPredictionDirection

#define VA_PREDICTION_DIRECTION_PREVIOUS   0x00000001
 Driver support forward reference frame (inter frame for vpx, P frame for H26x MPEG) can work with the VAConfigAttribEncMaxRefFrames. for example: low delay B frame of HEVC. these value can be OR'd together. typical value should be VA_PREDICTION_DIRECTION_PREVIOUS or VA_PREDICTION_DIRECTION_PREVIOUS | VA_PREDICTION_DIRECTION_FUTURE, theoretically, there are no stream only include future reference frame.
 
#define VA_PREDICTION_DIRECTION_FUTURE   0x00000002
 Driver support backward prediction frame/slice.
 
#define VA_PREDICTION_DIRECTION_BI_NOT_EMPTY   0x00000004
 Dirver require both reference list must be not empty for inter frame.
 

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 VAConfigAttribProtectedContentCipherAlgorithm

#define VA_PC_CIPHER_AES   0x00000001
 AES cipher.
 

Attribute values for VAConfigAttribProtectedContentCipherBlockSize

#define VA_PC_BLOCK_SIZE_128   0x00000001
 128 bits block size
 
#define VA_PC_BLOCK_SIZE_192   0x00000002
 192 bits block size
 
#define VA_PC_BLOCK_SIZE_256   0x00000004
 256 bits block size
 

Attribute values for VAConfigAttribProtectedContentCipherMode

#define VA_PC_CIPHER_MODE_ECB   0x00000001
 AES ECB.
 
#define VA_PC_CIPHER_MODE_CBC   0x00000002
 AES CBC.
 
#define VA_PC_CIPHER_MODE_CTR   0x00000004
 AES CTR.
 

Attribute values for VAConfigAttribProtectedContentCipherSampleType

#define VA_PC_SAMPLE_TYPE_FULLSAMPLE   0x00000001
 Full sample.
 
#define VA_PC_SAMPLE_TYPE_SUBSAMPLE   0x00000002
 Sub sample.
 

Attribute values for VAConfigAttribProtectedContentUsage

#define VA_PC_USAGE_DEFAULT   0x00000000
 Default usage.
 
#define VA_PC_USAGE_WIDEVINE   0x00000001
 Widevine.
 

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.

Bits 0:7 are reserved for generic types. Bits 31:28 are reserved for Linux DRM. Bits 23:20 are reserved for Android. Bits 19:16 are reserved for Win32. DRM, Android and Win32 specific types are defined in respective va_*.h 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.
 
#define VA_SURFACE_ATTRIB_USAGE_HINT_EXPORT   0x00000020
 Surface used for export to third-party APIs, e.g. via vaExportSurfaceHandle().
 

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

◆ VA_ATTRIB_NOT_SUPPORTED

#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

◆ VA_CLEAR_DRAWABLE

#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

◆ VA_CODED_BUF_STATUS_FRAME_SIZE_OVERFLOW

#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.

◆ VA_CODED_BUF_STATUS_NUMBER_PASSES_MASK

#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.

◆ VA_CODED_BUF_STATUS_PICTURE_AVE_QP_MASK

#define VA_CODED_BUF_STATUS_PICTURE_AVE_QP_MASK   0xff

device independent data structure for codedbuffer

◆ VA_CODED_BUF_STATUS_SINGLE_NALU

#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.

◆ VA_ENABLE_BLEND

#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

◆ VA_ENC_PACKED_HEADER_MISC

#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

◆ VA_ENC_PACKED_HEADER_PICTURE

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

◆ VA_ENC_PACKED_HEADER_SEQUENCE

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

◆ VA_ENC_PACKED_HEADER_SLICE

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

◆ VA_ENCRYPTION_TYPE_FULLSAMPLE_CTR

#define VA_ENCRYPTION_TYPE_FULLSAMPLE_CTR   0x00000001 /* AES CTR fullsample */

These ENCRYPTION_TYPEs are used for the attribute values for VAConfigAttribEncryption and for encryption_type in VAEncryptionParameters.

When used for VAConfigAttribEncryption, it be used via vaQueryConfigEntrypoints to check which type are supported for specific profile or not.

When used for encryption_type in VAEncryptionParameters, it tells driver the parameters in VAEncryptionParameters are used for which encryption type.

◆ VA_EXEC_ASYNC

#define VA_EXEC_ASYNC   0x1

asynchronization,application should call additonal sync operation to access output

◆ VA_EXEC_MODE_DEFAULT

#define VA_EXEC_MODE_DEFAULT   0x0

operation mode

◆ VA_EXEC_SYNC

#define VA_EXEC_SYNC   0x0

operation options synchronization, block call, output should be ready after execution function return

◆ VA_EXPORT_SURFACE_COMPOSED_LAYERS

#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.

◆ VA_EXPORT_SURFACE_READ_ONLY

#define VA_EXPORT_SURFACE_READ_ONLY   0x0001

Export surface to be read by external API.

◆ VA_EXPORT_SURFACE_READ_WRITE

#define VA_EXPORT_SURFACE_READ_WRITE   0x0003

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

◆ VA_EXPORT_SURFACE_SEPARATE_LAYERS

#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.

◆ VA_EXPORT_SURFACE_WRITE_ONLY

#define VA_EXPORT_SURFACE_WRITE_ONLY   0x0002

Export surface to be written by external API.

◆ VA_FEATURE_NOT_SUPPORTED

#define VA_FEATURE_NOT_SUPPORTED   0

The feature is not supported by the device.

Any corresponding feature flag must not be set.

◆ VA_FEATURE_REQUIRED

#define VA_FEATURE_REQUIRED   2

The feature is required by the device.

The device does not support not enabling this feature, so any corresponding feature flag must be set and any additional configuration needed by the feature must be supplied.

◆ VA_FEATURE_SUPPORTED

#define VA_FEATURE_SUPPORTED   1

The feature is supported by the device.

The user may decide whether or not to use this feature.

Note that support for a feature only indicates that the hardware is able to use it; whether it is actually a positive change to enable it in a given situation will depend on other factors including the input provided by the user.

◆ VA_FILTER_INTERPOLATION_DEFAULT

#define VA_FILTER_INTERPOLATION_DEFAULT   0x00000000

Interpolation method for scaling

◆ VA_FILTER_SCALING_DEFAULT

#define VA_FILTER_SCALING_DEFAULT   0x00000000

Scaling flags for vaPutSurface()

◆ VA_FOURCC

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

Notes about synchronization interfaces: vaSyncSurface:

  1. Allows to synchronize output surface (i.e. from decoding or VP)
  2. Allows to synchronize all bitstreams being encoded from the given input surface (1->N pipelines).

vaSyncSurface2:

  1. The same as vaSyncSurface but allows to specify a timeout

vaSyncBuffer:

  1. Allows to synchronize output buffer (e.g. bitstream from encoding). Comparing to vaSyncSurface this function synchronizes given bitstream only. 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

◆ VA_FOURCC_411P

#define VA_FOURCC_411P   0x50313134

411P: three-plane 8-bit YUV 4:1:1.

The three planes contain Y, U and V respectively.

◆ VA_FOURCC_411R

#define VA_FOURCC_411R   0x52313134

411R: three-plane 8-bit YUV.

The subsampling is the transpose of 4:1:1 - full chroma appears on every fourth line. The three planes contain Y, U and V respectively.

◆ VA_FOURCC_422H

#define VA_FOURCC_422H   0x48323234

422H: three-plane 8-bit YUV 4:2:2.

The three planes contain Y, U and V respectively.

◆ VA_FOURCC_422V

#define VA_FOURCC_422V   0x56323234

422V: three-plane 8-bit YUV 4:4:0.

The three planes contain Y, U and V respectively.

◆ VA_FOURCC_444P

#define VA_FOURCC_444P   0x50343434

444P: three-plane 8-bit YUV 4:4:4.

The three planes contain Y, U and V respectively.

◆ VA_FOURCC_A2B10G10R10

#define VA_FOURCC_A2B10G10R10   0x30334241 /* VA_FOURCC('A','B','3','0') */

10-bit Pixel BGR formats.

◆ VA_FOURCC_A2R10G10B10

#define VA_FOURCC_A2R10G10B10   0x30335241 /* VA_FOURCC('A','R','3','0') */

10-bit Pixel RGB formats.

◆ VA_FOURCC_ABGR

#define VA_FOURCC_ABGR   0x52474241

ABGR: packed 8-bit RGBA.

Four bytes per pixel: alpha, blue, green, red.

◆ VA_FOURCC_ABGR64

#define VA_FOURCC_ABGR64   0x34474241

ABGR64: three-plane 16-bit ABGR 16:16:16:16

The four planes contain: alpha, blue, green, red respectively.

◆ VA_FOURCC_AI44

#define VA_FOURCC_AI44   0x34344149

AI44: packed 4-bit YA.

The bottom half of each byte contains luma, the top half contains alpha.

◆ VA_FOURCC_ARGB

#define VA_FOURCC_ARGB   0x42475241

ARGB: packed 8-bit RGBA.

Four bytes per pixel: alpha, red, green, blue.

◆ VA_FOURCC_ARGB64

#define VA_FOURCC_ARGB64   0x34475241

AGRB64: three-plane 16-bit ARGB 16:16:16:16

The four planes contain: alpha, red, green, blue respectively.

◆ VA_FOURCC_AYUV

#define VA_FOURCC_AYUV   0x56555941

AYUV: packed 8-bit YUVA 4:4:4.

Four bytes per pixel: A, Y, U, V.

◆ VA_FOURCC_BGR565

#define VA_FOURCC_BGR565   0x36314742

BG16: packed 5/6-bit RGB.

Each pixel is a two-byte little-endian value. Blue, green and red are found in bits 15:11, 10:5, 4:0 respectively.

◆ VA_FOURCC_BGRA

#define VA_FOURCC_BGRA   0x41524742

BGRA: packed 8-bit RGBA.

Four bytes per pixel: blue, green, red, alpha.

◆ VA_FOURCC_BGRP

#define VA_FOURCC_BGRP   0x50524742

BGRP: three-plane 8-bit RGB.

The three planes contain blue, green and red respectively.

◆ VA_FOURCC_BGRX

#define VA_FOURCC_BGRX   0x58524742

BGRX: packed 8-bit RGB.

Four bytes per pixel: blue, green, red, unspecified.

◆ VA_FOURCC_I010

#define VA_FOURCC_I010   0x30313049

I010: three-plane 10-bit YUV 4:2:0.

Each sample is a two-byte little-endian value with the top six bits ignored. The three planes contain Y, V and U respectively.

◆ VA_FOURCC_I420

#define VA_FOURCC_I420   0x30323449

I420: three-plane 8-bit YUV 4:2:0.

The three planes contain Y, U and V respectively.

◆ VA_FOURCC_IMC3

#define VA_FOURCC_IMC3   0x33434D49

IMC3: three-plane 8-bit YUV 4:2:0.

Equivalent to YV12, but with the additional constraint that the pitch of all three planes must be the same.

◆ VA_FOURCC_IYUV

#define VA_FOURCC_IYUV   0x56555949

IYUV: three-plane 8-bit YUV 4:2:0.

Deprecated:
Use I420 instead.

◆ VA_FOURCC_NV11

#define VA_FOURCC_NV11   0x3131564e

NV11: two-plane 8-bit YUV 4:1:1.

The first plane contains Y, the second plane contains U and V in pairs of bytes.

◆ VA_FOURCC_NV12

#define VA_FOURCC_NV12   0x3231564E

NV12: two-plane 8-bit YUV 4:2:0. The first plane contains Y, the second plane contains U and V in pairs of bytes.

◆ VA_FOURCC_NV21

#define VA_FOURCC_NV21   0x3132564E

NV21: two-plane 8-bit YUV 4:2:0. Same as NV12, but with U and V swapped.

◆ VA_FOURCC_P010

#define VA_FOURCC_P010   0x30313050

P010: two-plane 10-bit YUV 4:2:0.

Each sample is a two-byte little-endian value with the bottom six bits ignored. The first plane contains Y, the second plane contains U and V in pairs of samples.

◆ VA_FOURCC_P012

#define VA_FOURCC_P012   0x32313050

P012: two-plane 12-bit YUV 4:2:0.

Each sample is a two-byte little-endian value with the bottom four bits ignored. The first plane contains Y, the second plane contains U and V in pairs of samples.

◆ VA_FOURCC_P016

#define VA_FOURCC_P016   0x36313050

P016: two-plane 16-bit YUV 4:2:0.

Each sample is a two-byte little-endian value. The first plane contains Y, the second plane contains U and V in pairs of samples.

◆ VA_FOURCC_P208

#define VA_FOURCC_P208   0x38303250

P208: two-plane 8-bit YUV 4:2:2.

The first plane contains Y, the second plane contains U and V in pairs of bytes.

◆ VA_FOURCC_Q416

#define VA_FOURCC_Q416   0x36313451

Q416: three-plane 16-bit YUV 4:4:4.

The three planes contain Y, U and V respectively.

◆ VA_FOURCC_RGB565

#define VA_FOURCC_RGB565   0x36314752

RG16: packed 5/6-bit RGB.

Each pixel is a two-byte little-endian value. Red, green and blue are found in bits 15:11, 10:5, 4:0 respectively.

◆ VA_FOURCC_RGBA

#define VA_FOURCC_RGBA   0x41424752

RGBA: packed 8-bit RGBA.

Four bytes per pixel: red, green, blue, alpha.

◆ VA_FOURCC_RGBP

#define VA_FOURCC_RGBP   0x50424752

RGBP: three-plane 8-bit RGB.

The three planes contain red, green and blue respectively.

◆ VA_FOURCC_RGBX

#define VA_FOURCC_RGBX   0x58424752

RGBX: packed 8-bit RGB.

Four bytes per pixel: red, green, blue, unspecified.

◆ VA_FOURCC_UYVY

#define VA_FOURCC_UYVY   0x59565955

UYUV: packed 8-bit YUV 4:2:2.

Four bytes per pair of pixels: U, Y, U, V.

◆ VA_FOURCC_VYUY

#define VA_FOURCC_VYUY   0x59555956

VYUV: packed 8-bit YUV 4:2:2.

Four bytes per pair of pixels: V, Y, U, V.

◆ VA_FOURCC_X2B10G10R10

#define VA_FOURCC_X2B10G10R10   0x30334258 /* VA_FOURCC('X','B','3','0') */

10-bit Pixel BGR formats without alpha.

◆ VA_FOURCC_X2R10G10B10

#define VA_FOURCC_X2R10G10B10   0x30335258 /* VA_FOURCC('X','R','3','0') */

10-bit Pixel RGB formats without alpha.

◆ VA_FOURCC_XBGR

#define VA_FOURCC_XBGR   0x52474258

XBGR: packed 8-bit RGB.

Four bytes per pixel: unspecified, blue, green, red.

◆ VA_FOURCC_XRGB

#define VA_FOURCC_XRGB   0x42475258

XRGB: packed 8-bit RGB.

Four bytes per pixel: unspecified, red, green, blue.

◆ VA_FOURCC_XYUV

#define VA_FOURCC_XYUV   0x56555958

XYUV: packed 8-bit YUVX 4:4:4.

Four bytes per pixel: X, Y, U, V.

◆ VA_FOURCC_Y16

#define VA_FOURCC_Y16   0x20363159

Y16: 16-bit greyscale.

Only a single sample, 16 bit Y plane for monochrome images

◆ VA_FOURCC_Y210

#define VA_FOURCC_Y210   0x30313259

Y210: packed 10-bit YUV 4:2:2.

Eight bytes represent a pair of pixels. Each sample is a two-byte little-endian value, with the bottom six bits ignored. The samples are in the order Y, U, Y, V.

◆ VA_FOURCC_Y212

#define VA_FOURCC_Y212   0x32313259

Y212: packed 12-bit YUV 4:2:2.

Eight bytes represent a pair of pixels. Each sample is a two-byte little-endian value. The samples are in the order Y, U, Y, V.

◆ VA_FOURCC_Y216

#define VA_FOURCC_Y216   0x36313259

Y216: packed 16-bit YUV 4:2:2.

Eight bytes represent a pair of pixels. Each sample is a two-byte little-endian value. The samples are in the order Y, U, Y, V.

◆ VA_FOURCC_Y410

#define VA_FOURCC_Y410   0x30313459

Y410: packed 10-bit YUVA 4:4:4.

Each pixel is a four-byte little-endian value. A, V, Y, U are found in bits 31:30, 29:20, 19:10, 9:0 respectively.

◆ VA_FOURCC_Y412

#define VA_FOURCC_Y412   0x32313459

Y412 packed 12-bit YUVA 4:4:4.

Each pixel is a set of four samples, each of which is a two-byte little-endian value. The samples are in the order A, V, Y, U.

◆ VA_FOURCC_Y416

#define VA_FOURCC_Y416   0x36313459

Y416: packed 16-bit YUVA 4:4:4.

Each pixel is a set of four samples, each of which is a two-byte little-endian value. The samples are in the order A, V, Y, U.

◆ VA_FOURCC_Y8

#define VA_FOURCC_Y8   0x20203859

Y8: 8-bit greyscale.

Only a single sample, 8 bit Y plane for monochrome images

◆ VA_FOURCC_Y800

#define VA_FOURCC_Y800   0x30303859

Y800: 8-bit greyscale.

◆ VA_FOURCC_YUY2

#define VA_FOURCC_YUY2   0x32595559

YUY2: packed 8-bit YUV 4:2:2.

Four bytes per pair of pixels: Y, U, Y, V.

◆ VA_FOURCC_YV12

#define VA_FOURCC_YV12   0x32315659

YV12: three-plane 8-bit YUV 4:2:0.

The three planes contain Y, V and U respectively.

◆ VA_FOURCC_YV16

#define VA_FOURCC_YV16   0x36315659

YV16: three-plane 8-bit YUV 4:2:2.

The three planes contain Y, V and U respectively.

◆ VA_FOURCC_YV24

#define VA_FOURCC_YV24   0x34325659

YV24: three-plane 8-bit YUV 4:4:4.

The three planes contain Y, V and U respectively.

◆ VA_FOURCC_YV32

#define VA_FOURCC_YV32   0x32335659

YV32: four-plane 8-bit YUVA 4:4:4

The four planes contain Y, V, U and A respectively.

◆ VA_FOURCC_YVYU

#define VA_FOURCC_YVYU   0x55595659

YVYU: packed 8-bit YUV 4:2:2.

Four bytes per pair of pixels: Y, V, Y, U.

◆ VA_FRAME_PICTURE

#define VA_FRAME_PICTURE   0x00000000
  1. De-interlacing flags for vaPutSurface()
  2. Surface sample type for input/output surface flag
    • Progressive: VA_FRAME_PICTURE
    • Interleaved: VA_TOP_FIELD_FIRST, VA_BOTTOM_FIELD_FIRST
    • Field: VA_TOP_FIELD, VA_BOTTOM_FIELD

◆ VA_MAPBUFFER_FLAG_DEFAULT

#define VA_MAPBUFFER_FLAG_DEFAULT   0

VA_MAPBUFFER_FLAG_DEFAULT is used when there are no flag specified same as VA_MAPBUFFER_FLAG_READ | VA_MAPBUFFER_FLAG_WRITE.

Map data store of the buffer into the client's address space this interface could be used to convey the operation hint backend driver could use these hint to optimize the implementations

◆ VA_PADDING_LOW

#define VA_PADDING_LOW   4

Padding size in 4-bytes

◆ VA_RC_PARALLEL

#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.

◆ VA_ROTATION_NONE

#define VA_ROTATION_NONE   0x00000000

attribute value for VADisplayAttribRotation

◆ VA_RT_FORMAT_RGB32_10BPP

#define VA_RT_FORMAT_RGB32_10BPP   VA_RT_FORMAT_RGB32_10
Deprecated:
use VA_RT_FORMAT_RGB32_10 instead.

◆ VA_RT_FORMAT_YUV420_10BPP

#define VA_RT_FORMAT_YUV420_10BPP   VA_RT_FORMAT_YUV420_10
Deprecated:
use VA_RT_FORMAT_YUV420_10 instead.

◆ VA_SLICE_DATA_FLAG_ALL

#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.

◆ VA_SRC_COLOR_MASK

#define VA_SRC_COLOR_MASK   0x000000f0

Color space conversion flags for vaPutSurface()

◆ VA_STATUS_ERROR_INVALID_VALUE

#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.

◆ VA_STATUS_SUCCESS

#define VA_STATUS_SUCCESS   0x00000000

Return status type from functions Values for the return status

◆ VA_SUBPICTURE_CHROMA_KEYING

#define VA_SUBPICTURE_CHROMA_KEYING   0x0001

flags for subpictures

Typedef Documentation

◆ VABufferID

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.

◆ VAContextID

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

◆ VADisplay

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

◆ VAGenericID

typedef unsigned int VAGenericID

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

◆ VAMessageCallback

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

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

◆ VANativeDisplay

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

◆ VASubpictureID

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

◆ VABufferType

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

VASubsetsParameterBufferType 

HEVC Decoding Subset Parameter buffer type.

The subsets parameter buffer is concatenation with one or multiple subset entry point offsets. All the offset values are layed out one by one according to slice order with first slice segment first, second slice segment second, etc... The entry number is indicated by parameter num_entry_point_offsets. And the first entry position of the entry point offsets for any slice segment is indicated by parameter entry_offset_to_subset_array in VAPictureParameterBufferHEVC data structure.

VAContextParameterUpdateBufferType 

adjust context parameters dynamically

this parameter is used to update context parameters, detail parameter is in VAContextParameterUpdateBuffer

VAProtectedSessionExecuteBufferType 

Protected session execution buffer type.

It's for TEE execution usage (vaProtectedSessionExecute()). The buffer structure is in VAProtectedSessionExecuteBuffer

VAEncryptionParameterBufferType 

Encryption parameters buffer for protected content session.

Refer to VAEncryptionParameters

VAEncDeltaQpPerBlockBufferType 

Encoding delta QP per block buffer.

This buffer only could be created and accepted when VAConfigAttribValEncPerBlockControl delta_qp_support == 1. This input buffer contains delta QP per block for encoding. The supported size of delta QP block and the size of delta QP must be quried from VAConfigAttribValEncPerBlockControl.

VAAlfBufferType 

VVC ALF data buffer.

Refer to VAAlfDataVVC

VALmcsBufferType 

VVC LMCS data buffer.

Refer to VALmcsDataVVC

VASubPicBufferType 

VVC SubPic data buffer.

Refer to VASubPicVVC

VATileBufferType 

VVC Tile Dimension data buffer.

Data buffer of tile widths and heights, with each element formatted as uint16_t

VASliceStructBufferType 

VVC Slice Structure data buffer.

Refer to VASliceStructVVC

◆ VAConfigAttribType

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.

VAConfigAttribMaxFrameSize 

encode max frame size attribute. Read-only attribute value VAConfigAttribValMaxFrameSize represent max frame size support

VAConfigAttribPredictionDirection 

inter frame prediction directrion attribute. Read-only. this attribute conveys the prediction direction (backward or forword) for specific config the value could be VA_PREDICTION_DIRECTION_XXXX. it can be combined with VAConfigAttribEncMaxRefFrames to describe reference list , and the prediction direction. if this attrib is not present,both direction should be supported, no restriction. for example: normal HEVC encoding , maximum reference frame number in reflist 0 and reflist 1 is deduced by VAConfigAttribEncMaxRefFrames. so there are typical P frame, B frame, if VAConfigAttribPredictionDirection is also present. it will stipulate prediction direction in both reference list. if only one prediction direction present(such as PREVIOUS),all reference frame should be previous frame (PoC < current).

VAConfigAttribMultipleFrame 

combined submission of multiple frames from different streams, it is optimization for different HW implementation, multiple frames encode/decode can improve HW concurrency

VAConfigAttribContextPriority 

priority setting for the context. Read-Write attribute value is VAConfigAttribValContextPriority this setting also could be update by VAContextParameterUpdateBuffer

VAConfigAttribDecAV1Features 

AV1 decoding features. Read-only.

This attribute describes the supported features of an AV1 decoder configuration. The value returned uses the VAConfigAttribValDecAV1Features type.

VAConfigAttribTEEType 

TEE could be any HW secure device. Read-only.

VAConfigAttribTEETypeClient 

TEE type client is a specific module supporting specific functions in TEE. Read-only.

VAConfigAttribProtectedContentCipherAlgorithm 

Cipher algorithm of the protected content session.

This attribute specifies the cipher algorithm of the protected content session. It could be VA_PC_CIPHER_AES, etc....

VAConfigAttribProtectedContentCipherBlockSize 

Cipher block size of the protected content session.

This attribute specifies the block size of the protected content session. It could be VA_PC_BLOCK_SIZE_128, VA_PC_BLOCK_SIZE_192, or VA_PC_BLOCK_SIZE_256, etc....

VAConfigAttribProtectedContentCipherMode 

Cipher mode of the protected content session.

This attribute specifies the cipher mode of the protected content session. It could be VA_PC_CIPHER_MODE_ECB, VA_PC_CIPHER_MODE_CBC, VA_PC_CIPHER_MODE_CTR, etc...

VAConfigAttribProtectedContentCipherSampleType 

Decryption sample type of the protected content session.

This attribute specifies the decryption sample type of the protected content session. It could be VA_PC_SAMPLE_TYPE_FULLSAMPLE or VA_PC_SAMPLE_TYPE_SUBSAMPLE.

VAConfigAttribProtectedContentUsage 

Special usage attribute of the protected session.

The attribute specifies the flow for the protected session could be used. For example, it could be VA_PC_USAGE_DEFAULT, VA_PC_USAGE_WIDEVINE, etc....

VAConfigAttribEncHEVCFeatures 

HEVC/H.265 encoding features. Read-only.

This attribute describes the supported features of an HEVC/H.265 encoder configuration. The value returned uses the VAConfigAttribValEncHEVCFeatures type.

If this attribute is supported by a driver then it must also support the VAConfigAttribEncHEVCBlockSizes attribute.

VAConfigAttribEncHEVCBlockSizes 

HEVC/H.265 encoding block sizes. Read-only.

This attribute describes the supported coding tree and transform block sizes of an HEVC/H.265 encoder configuration. The value returned uses the VAConfigAttribValEncHEVCBlockSizes type.

If this attribute is supported by a driver then it must also support the VAConfigAttribEncHEVCFeatures attribute.

VAConfigAttribEncAV1 

AV1 encoding attribute. Read-only.

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

VAConfigAttribEncAV1Ext1 

AV1 encoding attribute extend1. Read-only.

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

VAConfigAttribEncAV1Ext2 

AV1 encoding attribute extend2. Read-only.

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

VAConfigAttribEncPerBlockControl 

Settings per block attribute for Encoding. Read-only.

This attribute describes whether to support delta qp per block, the supported size of delta qp block and the size of delta QP in bytes. The value returned uses the VAConfigAttribValEncPerBlockControl type.

VAConfigAttribEncMaxTileRows 

Maximum number of tile rows. Read-only.

This attribute determines the maximum number of tile rows supported for encoding with tile support.

VAConfigAttribEncMaxTileCols 

Maximum number of tile cols. Read-only.

This attribute determines the maximum number of tile columns supported for encoding with tile support.

◆ VADisplayAttribBLEMode

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

Display attributes can also be used to query/set platform or display adaptor (vaDisplay) related information. These attributes do not depend on vaConfig, and could not be used for vaPutSurface. Application can use vaQueryDisplayAttributes/vaGetDisplayAttributes at anytime after vaInitialize, but (for settable attributes) vaSetDisplayAttributes should be called after vaInitialize and before any other function call.

To distinguish these two types of display attributes, display adaptor related attributes should be marked as "HW attribute" in the description.

◆ VAEncMiscParameterType

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.

VAEncMiscParameterTypeMultiPassFrameSize 

Buffer type used to express a maximum frame size (in bytes) settings for multiple pass.

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

◆ VAEncPackedHeaderType

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

◆ VAEntrypoint

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.

VAEntrypointProtectedTEEComm 

VAEntrypointProtectedTEEComm.

A function for communicating with TEE (Trusted Execution Environment).

VAEntrypointProtectedContent 

VAEntrypointProtectedContent.

A function for protected content to decrypt encrypted content.

◆ VAGenericValueType

Generic value types.

Enumerator
VAGenericValueTypeInteger 

32-bit signed integer.

VAGenericValueTypeFloat 

32-bit floating-point value.

VAGenericValueTypePointer 

Generic pointer type

VAGenericValueTypeFunc 

Pointer to function

◆ VAMvModeVC1

VC-1 data structures

◆ VAProfile

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
VAProfileProtected 

Profile ID used for protected video playback.

◆ VASurfaceAttribType

Surface attribute types.

Enumerator
VASurfaceAttribPixelFormat 

Pixel format as a FOURCC (int, read/write).

When vaQuerySurfaceAttributes() is called, the driver will return one PixelFormat attribute per supported pixel format.

When provided as an input to vaCreateSurfaces(), the driver will allocate a surface with the provided pixel format.

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

Refer to the documentation for the memory type being created to determine what descriptor structure to pass here. If not otherwise stated, the common VASurfaceAttribExternalBuffers should be used.

VASurfaceAttribUsageHint 

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

VASurfaceAttribDRMFormatModifiers 

List of possible DRM format modifiers (pointer, write).

The value must be a pointer to a VADRMFormatModifierList. This can only be used when allocating a new buffer, it's invalid to use this attribute when importing an existing buffer.

VASurfaceAttribAlignmentSize 

width and height log2 aligment in pixels (int, read-only)

For special HW requirement used in some codecs, if VASurfaceAttribAlignmentSize is not implemented in the driver, then the surface_width and surface_height should keep the original logic without any modification, this is an add-on requirement to surface_width and surface_height.

VASurfaceAttribCount 

Number of surface attributes.

Function Documentation

◆ vaAcquireBufferHandle()

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

◆ vaAssociateSubpicture()

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.

◆ vaBeginPicture()

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

◆ vaBufferSetNumElements()

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.

◆ vaCreateBuffer()

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.

◆ vaCreateBuffer2()

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

◆ vaCreateConfig()

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.

◆ vaCreateContext()

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

◆ vaCreateImage()

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.

◆ vaCreateMFContext()

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.

◆ vaCreateSubpicture()

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

Subpictures are created with an image associated.

◆ vaCreateSurfaces()

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

◆ vaDeassociateSubpicture()

VAStatus vaDeassociateSubpicture ( VADisplay  dpy,
VASubpictureID  subpicture,
VASurfaceID *  target_surfaces,
int  num_surfaces 
)

vaDeassociateSubpicture removes the association of the subpicture with target_surfaces.

◆ vaDeriveImage()

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.

◆ vaDestroyBuffer()

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.

◆ vaDestroyConfig()

VAStatus vaDestroyConfig ( VADisplay  dpy,
VAConfigID  config_id 
)

Free resources associdated with a given config

◆ vaDestroyContext()

VAStatus vaDestroyContext ( VADisplay  dpy,
VAContextID  context 
)

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

◆ vaDestroyImage()

VAStatus vaDestroyImage ( VADisplay  dpy,
VAImageID  image 
)

Should call DestroyImage before destroying the surface it is bound to

◆ vaDestroySubpicture()

VAStatus vaDestroySubpicture ( VADisplay  dpy,
VASubpictureID  subpicture 
)

Destroy the subpicture before destroying the image it is assocated to

◆ vaDestroySurfaces()

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.

◆ vaEndPicture()

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

◆ vaErrorStr()

const char* vaErrorStr ( VAStatus  error_status)

Returns a short english description of error_status

◆ vaExportSurfaceHandle()

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.

◆ vaGetConfigAttributes()

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

◆ vaGetImage()

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

◆ vaGetLibFunc()

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

◆ vaInitialize()

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

Initialize the library

◆ vaMapBuffer()

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

◆ vaMaxNumConfigAttributes()

int vaMaxNumConfigAttributes ( VADisplay  dpy)

Get maximum number of attributs supported by the implementation

◆ vaMaxNumEntrypoints()

int vaMaxNumEntrypoints ( VADisplay  dpy)

Get maximum number of entrypoints supported by the implementation

◆ vaMaxNumImageFormats()

int vaMaxNumImageFormats ( VADisplay  dpy)

Get maximum number of image formats supported by the implementation

◆ vaMaxNumProfiles()

int vaMaxNumProfiles ( VADisplay  dpy)

Get maximum number of profiles supported by the implementation

◆ vaMaxNumSubpictureFormats()

int vaMaxNumSubpictureFormats ( VADisplay  dpy)

Get maximum number of subpicture formats supported by the implementation

◆ vaMFAddContext()

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.

◆ vaMFReleaseContext()

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

◆ vaMFSubmit()

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.

◆ vaPutImage()

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

◆ vaQueryConfigAttributes()

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"

◆ vaQueryConfigEntrypoints()

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".

◆ vaQueryConfigProfiles()

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".

◆ vaQueryImageFormats()

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".

◆ vaQueryProcessingRate()

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

◆ vaQuerySubpictureFormats()

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

◆ vaQuerySurfaceAttributes()

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 config. 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

◆ vaQuerySurfaceError()

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".

After the applications get VA_STATUS_HW_BUSY or VA_STATUS_SUCCESSFULL from vaSyncSurface(), it still can call vaQuerySurfaceError to find out further details to know if has real hw reset happened on this surface since umd and kmd could recover the context from reset with success in sometimes. VA_STATUS_HW_BUSY or VA_STATUS_SUCCESSFULL also could 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 VADecodeErrorType. The array is terminated if "status==-1" is detected.

◆ vaQuerySurfaceStatus()

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

Find out any pending ops on the render target

◆ vaQueryVendorString()

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"

◆ vaReleaseBufferHandle()

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

◆ vaRenderPicture()

VAStatus vaRenderPicture ( VADisplay  dpy,
VAContextID  context,
VABufferID buffers,
int  num_buffers 
)

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

◆ vaSetDriverName()

VAStatus vaSetDriverName ( VADisplay  dpy,
char *  driver_name 
)

Set the override driver name instead of queried driver driver.

◆ vaSetErrorCallback()

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.

◆ vaSetInfoCallback()

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.

◆ vaSetSubpictureChromakey()

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

◆ vaSetSubpictureGlobalAlpha()

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

◆ vaSetSubpictureImage()

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.

◆ vaSyncBuffer()

VAStatus vaSyncBuffer ( VADisplay  dpy,
VABufferID  buf_id,
uint64_t  timeout_ns 
)

Synchronizes pending operations associated with the supplied buffer.

This function blocks during specified timeout (in nanoseconds) until all pending operations on the supplied buffer have been completed. If timeout is zero, the function returns immediately.

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_TIMEDOUT: synchronization is still in progress, client should call the function again to complete synchronization
Parameters
[in]dpythe VA display
[in]buf_idthe buffer for which synchronization is performed
[in]timeout_nsthe timeout in nanoseconds

◆ vaSyncSurface()

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.

◆ vaSyncSurface2()

VAStatus vaSyncSurface2 ( VADisplay  dpy,
VASurfaceID  surface,
uint64_t  timeout_ns 
)

Synchronizes pending operations associated with the supplied surface.

This function blocks during specified timeout (in nanoseconds) until all pending operations on the render target have been completed. If timeout is zero, the function returns immediately.

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_SURFACE: an invalid surface was supplied
  • VA_STATUS_ERROR_TIMEDOUT: synchronization is still in progress, client should call the function again to complete synchronization
Parameters
[in]dpythe VA display
[in]surfacethe surface for which synchronization is performed
[in]timeout_nsthe timeout in nanoseconds

◆ vaTerminate()

VAStatus vaTerminate ( VADisplay  dpy)

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

◆ vaUnmapBuffer()

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