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

Classes

struct  VAConfigAttrib
 
union  VAConfigAttribValEncJPEG
 Attribute value for VAConfigAttribEncJPEG. More...
 
union  VAConfigAttribValEncROI
 Attribute value for VAConfigAttribEncROI. More...
 
union  VAConfigAttribValEncRateControlExt
 Attribute value for VAConfigAttribEncRateControlExt. More...
 
struct  VAGenericValue
 Generic value. More...
 
struct  VASurfaceAttrib
 Surface attribute. More...
 
struct  VASurfaceAttribExternalBuffers
 VASurfaceAttribExternalBuffers structure for the VASurfaceAttribExternalBufferDescriptor attribute. More...
 
struct  VAEncPackedHeaderParameterBuffer
 Packed header parameter. More...
 
struct  VAEncMiscParameterBuffer
 
struct  VAEncMiscParameterTemporalLayerStructure
 Temporal layer Structure. More...
 
struct  VAEncMiscParameterRateControl
 Rate control parameters. More...
 
struct  VAEncMiscParameterMaxSliceSize
 
struct  VAEncMiscParameterBufferMaxFrameSize
 Defines a maximum frame size (in bits). More...
 
struct  VAEncMiscParameterBufferQualityLevel
 Encoding quality level. More...
 
struct  VAEncMiscParameterSkipFrame
 Encoding skip frame. More...
 
struct  VAEncROI
 Encoding region-of-interest (ROI). 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  VACodedBufferSegment
 Coded buffer segment. More...
 
struct  VABufferInfo
 VA buffer information. More...
 
struct  VASurfaceDecodeMBErrors
 
struct  VAPictureHEVC
 Description of picture properties of those in DPB surfaces. More...
 

Macros

#define VA_STATUS_SUCCESS   0x00000000
 
#define VA_STATUS_ERROR_INVALID_VALUE   0x00000019
 An invalid/unsupported value was supplied. More...
 
#define VA_STATUS_ERROR_UNSUPPORTED_FILTER   0x00000020
 An unsupported filter was supplied.
 
#define VA_STATUS_ERROR_INVALID_FILTER_CHAIN   0x00000021
 An invalid filter chain was supplied.
 
#define VA_STATUS_ERROR_HW_BUSY   0x00000022
 Indicate HW busy (e.g. run multiple encoding simultaneously).
 
#define VA_STATUS_ERROR_UNSUPPORTED_MEMORY_TYPE   0x00000024
 An unsupported memory type was supplied.
 
#define VA_FRAME_PICTURE   0x00000000
 
#define VA_ENABLE_BLEND   0x00000004 /* video area blend with the constant color */
 
#define VA_CLEAR_DRAWABLE   0x00000008
 
#define VA_SRC_COLOR_MASK   0x000000f0
 
#define VA_FILTER_SCALING_DEFAULT   0x00000000
 
#define VA_RT_FORMAT_YUV420   0x00000001
 
#define VA_RT_FORMAT_YUV420_10BPP   0x00000100
 
#define VA_RT_FORMAT_RGB16   0x00010000
 
#define VA_ATTRIB_NOT_SUPPORTED   0x80000000
 
#define VA_SLICE_DATA_FLAG_ALL   0x00 /* whole slice is in the buffer */
 
#define VA_CODED_BUF_STATUS_PICTURE_AVE_QP_MASK   0xff
 
#define VA_CODED_BUF_STATUS_FRAME_SIZE_OVERFLOW   0x1000
 The frame has exceeded the maximum requested size. More...
 
#define VA_CODED_BUF_STATUS_SINGLE_NALU   0x10000000
 The coded buffer segment contains a single NAL unit. More...
 
#define VA_FOURCC(ch0, ch1, ch2, ch3)
 
#define VA_FOURCC_YV16   0x36315659
 
#define VA_FOURCC_P010   0x30313050
 
#define VA_FOURCC_I010   0x30313049
 
#define VA_SUBPICTURE_CHROMA_KEYING   0x0001
 
#define VA_ROTATION_NONE   0x00000000
 
#define VA_OOL_DEBLOCKING_FALSE   0x00000000
 
#define VA_RENDER_MODE_UNDEFINED   0
 
#define VA_RENDER_DEVICE_UNDEFINED   0
 
#define VA_PICTURE_HEVC_FIELD_PIC   0x00000002
 indication of interlace scan picture. should take same value for all the pictures in sequence.
 
#define VA_PICTURE_HEVC_BOTTOM_FIELD   0x00000004
 polarity of the field picture. top field takes even lines of buffer surface. bottom field takes odd lines of buffer surface.
 
#define VA_PICTURE_HEVC_LONG_TERM_REFERENCE   0x00000008
 Long term reference picture.
 
#define VA_PICTURE_HEVC_RPS_ST_CURR_BEFORE   0x00000010
 RefPicSetStCurrBefore of HEVC spec variable Number of ReferenceFrames[] entries with this bit set equals NumPocStCurrBefore. More...
 
#define VA_PICTURE_HEVC_RPS_ST_CURR_AFTER   0x00000020
 RefPicSetStCurrAfter of HEVC spec variable Number of ReferenceFrames[] entries with this bit set equals NumPocStCurrAfter.
 
#define VA_PICTURE_HEVC_RPS_LT_CURR   0x00000040
 RefPicSetLtCurr of HEVC spec variable Number of ReferenceFrames[] entries with this bit set equals NumPocLtCurr.
 

Typedefs

typedef void * VADisplay
 
typedef void(* vaMessageCallback) (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 }
 
enum  VAEntrypoint { , VAEntrypointVideoProc = 10 }
 
enum  VAConfigAttribType { ,
  VAConfigAttribDecSliceMode = 6, VAConfigAttribEncPackedHeaders = 10, VAConfigAttribEncInterlaced = 11, VAConfigAttribEncMaxRefFrames = 13,
  VAConfigAttribEncMaxSlices = 14, VAConfigAttribEncSliceStructure = 15, VAConfigAttribEncMacroblockInfo = 16, VAConfigAttribEncJPEG = 20,
  VAConfigAttribEncQualityRange = 21, VAConfigAttribEncSkipFrame = 24, VAConfigAttribEncROI = 25, VAConfigAttribEncRateControlExt = 26,
  VAConfigAttribTypeMax
}
 
enum  VAGenericValueType { VAGenericValueTypeInteger = 1, VAGenericValueTypeFloat, VAGenericValueTypePointer, VAGenericValueTypeFunc }
 Generic value types. More...
 
enum  VASurfaceAttribType { ,
  VASurfaceAttribPixelFormat, VASurfaceAttribMinWidth, VASurfaceAttribMaxWidth, VASurfaceAttribMinHeight,
  VASurfaceAttribMaxHeight, VASurfaceAttribMemoryType, VASurfaceAttribExternalBufferDescriptor, VASurfaceAttribUsageHint,
  VASurfaceAttribCount
}
 Surface attribute types. More...
 
enum  VABufferType { , VAProcPipelineParameterBufferType = 41, VAProcFilterParameterBufferType = 42 }
 
enum  VAEncMiscParameterType { ,
  VAEncMiscParameterTypeMaxFrameSize = 4, VAEncMiscParameterTypeHRD = 5 , VAEncMiscParameterTypeSkipFrame = 9, VAEncMiscParameterTypeROI = 10,
  VAEncMiscParameterTypeTemporalLayerStructure = 12
}
 
enum  VAEncPackedHeaderType {
  VAEncPackedHeaderSequence = 1, VAEncPackedHeaderPicture = 2, VAEncPackedHeaderSlice = 3, VAEncPackedHeaderRawData = 4,
  VAEncPackedHeaderMiscMask = 0x80000000
}
 Packed header type. More...
 
enum  VAMvModeVC1
 
enum  VADisplayAttribBLEMode
 
enum  VADisplayAttribType
 

Functions

const char * vaErrorStr (VAStatus error_status)
 
vaMessageCallback vaSetErrorCallback (vaMessageCallback)
 
vaMessageCallback vaSetInfoCallback (vaMessageCallback)
 
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 vaCreateBuffer (VADisplay dpy, VAContextID context, VABufferType type, unsigned int size, unsigned int num_elements, void *data, 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 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 vaSyncSurface (VADisplay dpy, VASurfaceID render_target)
 
VAStatus vaQuerySurfaceStatus (VADisplay dpy, VASurfaceID render_target, VASurfaceStatus *status)
 
VAStatus vaQuerySurfaceError (VADisplay dpy, VASurfaceID surface, VAStatus error_status, void **error_info)
 
int vaMaxNumImageFormats (VADisplay dpy)
 
VAStatus vaQueryImageFormats (VADisplay dpy, VAImageFormat *format_list, int *num_formats)
 
VAStatus vaCreateImage (VADisplay dpy, VAImageFormat *format, int width, int height, VAImage *image)
 
VAStatus vaDestroyImage (VADisplay dpy, VAImageID image)
 
VAStatus vaGetImage (VADisplay dpy, VASurfaceID surface, int x, int y, unsigned int width, unsigned int height, VAImageID image)
 
VAStatus vaPutImage (VADisplay dpy, VASurfaceID surface, VAImageID image, int src_x, int src_y, unsigned int src_width, unsigned int src_height, int dest_x, int dest_y, unsigned int dest_width, unsigned int dest_height)
 
VAStatus vaDeriveImage (VADisplay dpy, VASurfaceID surface, VAImage *image)
 
int vaMaxNumSubpictureFormats (VADisplay dpy)
 
VAStatus vaQuerySubpictureFormats (VADisplay dpy, VAImageFormat *format_list, unsigned int *flags, unsigned int *num_formats)
 
VAStatus vaCreateSubpicture (VADisplay dpy, VAImageID image, VASubpictureID *subpicture)
 
VAStatus vaDestroySubpicture (VADisplay dpy, VASubpictureID subpicture)
 
VAStatus vaSetSubpictureImage (VADisplay dpy, VASubpictureID subpicture, VAImageID image)
 
VAStatus vaSetSubpictureChromakey (VADisplay dpy, VASubpictureID subpicture, unsigned int chromakey_min, unsigned int chromakey_max, unsigned int chromakey_mask)
 
VAStatus vaSetSubpictureGlobalAlpha (VADisplay dpy, VASubpictureID subpicture, float global_alpha)
 
VAStatus vaAssociateSubpicture (VADisplay dpy, VASubpictureID subpicture, VASurfaceID *target_surfaces, int num_surfaces, short src_x, short src_y, unsigned short src_width, unsigned short src_height, short dest_x, short dest_y, unsigned short dest_width, unsigned short dest_height, unsigned int flags)
 
VAStatus vaDeassociateSubpicture (VADisplay dpy, VASubpictureID subpicture, VASurfaceID *target_surfaces, int num_surfaces)
 
int vaMaxNumDisplayAttributes (VADisplay dpy)
 
VAStatus vaQueryDisplayAttributes (VADisplay dpy, VADisplayAttribute *attr_list, int *num_attributes)
 
VAStatus vaGetDisplayAttributes (VADisplay dpy, VADisplayAttribute *attr_list, int num_attributes)
 
VAStatus vaSetDisplayAttributes (VADisplay dpy, VADisplayAttribute *attr_list, int num_attributes)
 

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

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 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.
 
#define VA_ENC_PACKED_HEADER_PICTURE   0x00000002
 Driver supports packed picture headers. e.g. PPS for H.264.
 
#define VA_ENC_PACKED_HEADER_SLICE   0x00000004
 Driver supports packed slice headers. e.g. slice_header() for H.264.
 
#define VA_ENC_PACKED_HEADER_MISC   0x00000008
 Driver supports misc packed headers. e.g. SEI for H.264.
 
#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_ARBITRARY_ROWS   0x00000000
 Driver supports an arbitrary number of rows per slice.
 
#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 rows per slice.
 

Surface attribute flags

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

VASurfaceAttribMemoryType values in bit fields.

Bit 0:7 are reserved for generic types, Bit 31:28 are reserved for Linux DRM, Bit 23:20 are reserved for Android. DRM and Android specific types are defined in DRM and Android header files.

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

VASurfaceAttribExternalBuffers flags

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

VASurfaceAttribUsageHint attribute usage hint flags

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

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

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_I010

#define VA_FOURCC_I010   0x30313049

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

§ VA_FOURCC_P010

#define VA_FOURCC_P010   0x30313050

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

§ VA_FOURCC_YV16

#define VA_FOURCC_YV16   0x36315659

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

§ VA_FRAME_PICTURE

#define VA_FRAME_PICTURE   0x00000000

De-interlacing flags for vaPutSurface()

§ VA_OOL_DEBLOCKING_FALSE

#define VA_OOL_DEBLOCKING_FALSE   0x00000000

attribute value for VADisplayAttribOutOfLoopDeblock

§ VA_PICTURE_HEVC_RPS_ST_CURR_BEFORE

#define VA_PICTURE_HEVC_RPS_ST_CURR_BEFORE   0x00000010

RefPicSetStCurrBefore of HEVC spec variable Number of ReferenceFrames[] entries with this bit set equals NumPocStCurrBefore.

VA_PICTURE_HEVC_RPS_ST_CURR_BEFORE, VA_PICTURE_HEVC_RPS_ST_CURR_AFTER and VA_PICTURE_HEVC_RPS_LT_CURR of any picture in ReferenceFrames[] should be exclusive. No more than one of them can be set for any picture. Sum of NumPocStCurrBefore, NumPocStCurrAfter and NumPocLtCurr equals NumPocTotalCurr, which should be equal to or smaller than 8. Application should provide valid values for both short format and long format. The pictures in DPB with any of these three flags turned on are referred by the current picture.

§ VA_RENDER_DEVICE_UNDEFINED

#define VA_RENDER_DEVICE_UNDEFINED   0

Render device

§ VA_RENDER_MODE_UNDEFINED

#define VA_RENDER_MODE_UNDEFINED   0

Render mode

§ VA_ROTATION_NONE

#define VA_ROTATION_NONE   0x00000000

attribute value for VADisplayAttribRotation

§ VA_RT_FORMAT_RGB16

#define VA_RT_FORMAT_RGB16   0x00010000

RGB formats

§ VA_RT_FORMAT_YUV420

#define VA_RT_FORMAT_YUV420   0x00000001

attribute value for VAConfigAttribRTFormat

§ VA_RT_FORMAT_YUV420_10BPP

#define VA_RT_FORMAT_YUV420_10BPP   0x00000100

YUV formats with more than 8 bpp

§ 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 pipeline. Surfaces are render targets for a given context. The data in the surfaces are not accessible to the client and the internal data format of the surface is implementatin specific.

Surfaces will be bound to a context when the context is created. Once a surface is bound to a given context, it can not be used to create another context. The association is removed when the context is 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/display application (client) and a hardware accelerator (server), to off-load video decode/encode/display 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 decode context which represents a "virtualized" hardware decode device
  • Get and fill decode buffers with picture level, slice level and macroblock level data (depending on entrypoints)
  • Pass the decode buffers to the server to decode 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 decoder

§ VAGenericID

typedef unsigned int VAGenericID

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

§ vaMessageCallback

typedef void(* vaMessageCallback) (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
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.

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

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.

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.

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.

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

§ VADisplayAttribType

Currently defined display attribute types

§ VAEncMiscParameterType

Enumerator
VAEncMiscParameterTypeMaxFrameSize 

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

VAEncMiscParameterTypeHRD 

Buffer type used for HRD parameters.

VAEncMiscParameterTypeSkipFrame 

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

VAEncMiscParameterTypeROI 

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

VAEncMiscParameterTypeTemporalLayerStructure 

Buffer type used for temporal layer structure.

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

VAEncPackedHeaderMiscMask 

Misc packed header. See codec-specific definitions.

§ VAEntrypoint

Currently defined entrypoints

Enumerator
VAEntrypointVideoProc 

Video pre/post-processing.

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

§ VASurfaceAttribType

Surface attribute types.

Enumerator
VASurfaceAttribPixelFormat 

Pixel format (fourcc).

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

VASurfaceAttribMinWidth 

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

VASurfaceAttribMaxWidth 

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

VASurfaceAttribMinHeight 

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

VASurfaceAttribMaxHeight 

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

VASurfaceAttribMemoryType 

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

VASurfaceAttribExternalBufferDescriptor 

External buffer descriptor (pointer, write).

VASurfaceAttribUsageHint 

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

VASurfaceAttribCount 

Number of surface attributes.

Function Documentation

§ 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,
short  src_x,
short  src_y,
unsigned short  src_width,
unsigned short  src_height,
short  dest_x,
short  dest_y,
unsigned short  dest_width,
unsigned short  dest_height,
unsigned int  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 
)

Get ready to decode 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.

§ vaCreateConfig()

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

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

§ 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: 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.

§ 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 and validated through vaGetSurfaceAttributes() or constructed based 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 the context associated has 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.

§ vaErrorStr()

const char* vaErrorStr ( VAStatus  error_status)

Returns a short english description of error_status

§ 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

§ vaGetDisplayAttributes()

VAStatus vaGetDisplayAttributes ( VADisplay  dpy,
VADisplayAttribute *  attr_list,
int  num_attributes 
)

Get display attributes This function returns the current attribute values in "attr_list". Only attributes returned with VA_DISPLAY_ATTRIB_GETTABLE set in the "flags" field from vaQueryDisplayAttributes() can have their values retrieved.

§ 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

§ vaMaxNumDisplayAttributes()

int vaMaxNumDisplayAttributes ( VADisplay  dpy)

Get maximum number of display 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

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

§ vaQueryDisplayAttributes()

VAStatus vaQueryDisplayAttributes ( VADisplay  dpy,
VADisplayAttribute *  attr_list,
int *  num_attributes 
)

Query display attributes The caller must provide a "attr_list" array that can hold at least vaMaxNumDisplayAttributes() entries. The actual number of attributes returned in "attr_list" is returned in "num_attributes".

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

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

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

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

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

Parameters
[in]dpythe VA display
[in]configthe config identifying a codec or a video processing pipeline
[out]attrib_listthe output array of VASurfaceAttrib elements
[in,out]num_attribsthe number of elements allocated on input, the number of elements actually filled in output

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

§ 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 decode buffers to the server.

§ vaSetDisplayAttributes()

VAStatus vaSetDisplayAttributes ( VADisplay  dpy,
VADisplayAttribute *  attr_list,
int  num_attributes 
)

Set display attributes Only attributes returned with VA_DISPLAY_ATTRIB_SETTABLE set in the "flags" field from vaQueryDisplayAttributes() can be set. If the attribute is not settable or the value is out of range, the function returns VA_STATUS_ERROR_ATTR_NOT_SUPPORTED

§ vaSetDriverName()

VAStatus vaSetDriverName ( VADisplay  dpy,
char *  driver_name 
)

Set the override driver name instead of queried driver driver.

§ vaSetErrorCallback()

vaMessageCallback vaSetErrorCallback ( vaMessageCallback  )

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

§ vaSetInfoCallback()

vaMessageCallback vaSetInfoCallback ( vaMessageCallback  )

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.

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

§ 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