|
VA-API
|
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_BT601 0x00000010 |
| #define | VA_FILTER_SCALING_DEFAULT 0x00000000 |
| #define | VA_RT_FORMAT_YUV420 0x00000001 |
| #define | VA_ATTRIB_NOT_SUPPORTED 0x80000000 |
| #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_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 * | VANativeDisplay |
| typedef unsigned int | VAGenericID |
| typedef VAGenericID | VAContextID |
| typedef void(* | VAGenericFunc )(void) |
| Generic function type. | |
| typedef VAGenericID | VABufferID |
| typedef VAGenericID | VASubpictureID |
Functions | |
| const char * | vaErrorStr (VAStatus error_status) |
| 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. | |
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. | |
| #define VA_ATTRIB_NOT_SUPPORTED 0x80000000 |
if an attribute is not applicable for a given profile/entrypoint pair, then set the value to the following
| #define VA_CLEAR_DRAWABLE 0x00000008 |
Clears the drawable with background color. for hardware overlay based implementation this flag can be used to turn off the overlay
| #define VA_CODED_BUF_STATUS_FRAME_SIZE_OVERFLOW 0x1000 |
The frame has exceeded the maximum requested size.
This flag indicates that the encoded frame size exceeds the value specified through a misc parameter buffer of type VAEncMiscParameterTypeMaxFrameSize.
| #define VA_CODED_BUF_STATUS_PICTURE_AVE_QP_MASK 0xff |
device independent data structure for codedbuffer
| #define VA_CODED_BUF_STATUS_SINGLE_NALU 0x10000000 |
The coded buffer segment contains a single NAL unit.
This flag indicates that the coded buffer segment contains a single NAL unit. This flag might be useful to the user for processing the coded buffer.
| #define VA_ENABLE_BLEND 0x00000004 /* video area blend with the constant color */ |
Enabled the positioning/cropping/blending feature: 1, specify the video playback position in the isurface 2, specify the cropping info for video playback 3, encoded video will blend with background color
| #define VA_FILTER_SCALING_DEFAULT 0x00000000 |
Scaling flags for vaPutSurface()
| #define VA_FOURCC | ( | ch0, | |
| ch1, | |||
| ch2, | |||
| ch3 | |||
| ) |
Images and Subpictures VAImage is used to either get the surface data to client memory, or to copy image data in client memory to a surface. Both images, subpictures and surfaces follow the same 2D coordinate system where origin is at the upper left corner with positive X to the right and positive Y down
| #define VA_FRAME_PICTURE 0x00000000 |
De-interlacing flags for vaPutSurface()
| #define VA_OOL_DEBLOCKING_FALSE 0x00000000 |
attribute value for VADisplayAttribOutOfLoopDeblock
| #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.
| #define VA_RENDER_DEVICE_UNDEFINED 0 |
Render device
| #define VA_RENDER_MODE_UNDEFINED 0 |
Render mode
| #define VA_ROTATION_NONE 0x00000000 |
attribute value for VADisplayAttribRotation
| #define VA_RT_FORMAT_YUV420 0x00000001 |
attribute value for VAConfigAttribRTFormat
| #define VA_SRC_BT601 0x00000010 |
Color space conversion flags for vaPutSurface()
| #define VA_STATUS_ERROR_INVALID_VALUE 0x00000019 |
An invalid/unsupported value was supplied.
This is a catch-all error code for invalid or unsupported values. e.g. value exceeding the valid range, invalid type in the context of generic attribute values.
| #define VA_STATUS_SUCCESS 0x00000000 |
Return status type from functions Values for the return status
| #define VA_SUBPICTURE_CHROMA_KEYING 0x0001 |
flags for subpictures
| typedef VAGenericID 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.
| typedef VAGenericID 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
| 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:
Initialization & Configuration Management
| typedef unsigned int VAGenericID |
Generic ID type, can be re-typed for specific implementation
| 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()
| typedef VAGenericID 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.
| enum 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. |
| enum VAConfigAttribType |
Currently defined configuration attribute types
| Enumerator | |
|---|---|
| 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 |
| VAConfigAttribEncInterlaced |
Interlaced mode. Read/write. This attribute determines what kind of interlaced encoding mode the driver supports. See |
| 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 |
| 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. |
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()
| enum VADisplayAttribType |
Currently defined display attribute types
Packed header type.
| enum VAEntrypoint |
| enum VAGenericValueType |
| enum VAMvModeVC1 |
VC-1 data structures
| enum VAProfile |
| enum 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 |
| 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. |
| 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:
| [in] | dpy | the VA display |
| [in] | buf_id | the VA buffer |
| [in,out] | buf_info | the associated VA buffer information |
| 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.
| VAStatus vaBeginPicture | ( | VADisplay | dpy, |
| VAContextID | context, | ||
| VASurfaceID | render_target | ||
| ) |
Get ready to decode a picture to a target surface
| VAStatus vaBufferSetNumElements | ( | VADisplay | dpy, |
| VABufferID | buf_id, | ||
| unsigned int | num_elements | ||
| ) |
Convey to the server how many valid elements are in the buffer. e.g. if multiple slice parameters are being held in a single buffer, this will communicate to the server the number of slice parameters that are valid in the buffer.
| VAStatus vaCreateBuffer | ( | VADisplay | dpy, |
| VAContextID | context, | ||
| VABufferType | type, | ||
| unsigned int | size, | ||
| unsigned int | num_elements, | ||
| void * | data, | ||
| VABufferID * | buf_id | ||
| ) |
Buffer functions Creates a buffer for "num_elements" elements of "size" bytes and initalize with "data". if "data" is null, then the contents of the buffer data store are undefined. Basically there are two ways to get buffer data to the server side. One is to call vaCreateBuffer() with a non-null "data", which results the data being copied to the data store on the server side. A different method that eliminates this copy is to pass null as "data" when calling vaCreateBuffer(), and then use vaMapBuffer() to map the data store from the server side to the client address space for access. Note: image buffers are created by the library, not the client. Please see vaCreateImage on how image buffers are managed.
| 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.
| 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
| VAStatus vaCreateImage | ( | VADisplay | dpy, |
| VAImageFormat * | format, | ||
| int | width, | ||
| int | height, | ||
| VAImage * | image | ||
| ) |
Create a VAImage structure The width and height fields returned in the VAImage structure may get enlarged for some YUV formats. Upon return from this function, image->buf has been created and proper storage allocated by the library. The client can access the image through the Map/Unmap calls.
| VAStatus vaCreateSubpicture | ( | VADisplay | dpy, |
| VAImageID | image, | ||
| VASubpictureID * | subpicture | ||
| ) |
Subpictures are created with an image associated.
| VAStatus vaCreateSurfaces | ( | VADisplay | dpy, |
| unsigned int | format, | ||
| unsigned int | width, | ||
| unsigned int | height, | ||
| VASurfaceID * | surfaces, | ||
| unsigned int | num_surfaces, | ||
| VASurfaceAttrib * | attrib_list, | ||
| unsigned int | num_attribs | ||
| ) |
Creates an array of surfaces.
Creates an array of surfaces. The optional list of attributes shall be constructed and validated through vaGetSurfaceAttributes() or constructed based based on what the underlying hardware could expose through vaQuerySurfaceAttributes().
| [in] | dpy | the VA display |
| [in] | format | the desired surface format. See VA_RT_FORMAT_* |
| [in] | width | the surface width |
| [in] | height | the surface height |
| [out] | surfaces | the array of newly created surfaces |
| [in] | num_surfaces | the number of surfaces to create |
| [in] | attrib_list | the list of (optional) attributes, or NULL |
| [in] | num_attribs | the number of attributes supplied in attrib_list, or zero |
| VAStatus vaDeassociateSubpicture | ( | VADisplay | dpy, |
| VASubpictureID | subpicture, | ||
| VASurfaceID * | target_surfaces, | ||
| int | num_surfaces | ||
| ) |
vaDeassociateSubpicture removes the association of the subpicture with target_surfaces.
| VAStatus vaDeriveImage | ( | VADisplay | dpy, |
| VASurfaceID | surface, | ||
| VAImage * | image | ||
| ) |
Derive an VAImage from an existing surface. This interface will derive a VAImage and corresponding image buffer from an existing VA Surface. The image buffer can then be mapped/unmapped for direct CPU access. This operation is only possible on implementations with direct rendering capabilities and internal surface formats that can be represented with a VAImage. When the operation is not possible this interface will return VA_STATUS_ERROR_OPERATION_FAILED. Clients should then fall back to using vaCreateImage + vaPutImage to accomplish the same task in an indirect manner.
Implementations should only return success when the resulting image buffer would be useable with vaMap/Unmap.
When directly accessing a surface special care must be taken to insure proper synchronization with the graphics hardware. Clients should call vaQuerySurfaceStatus to insure that a surface is not the target of concurrent rendering or currently being displayed by an overlay.
Additionally nothing about the contents of a surface should be assumed following a vaPutSurface. Implementations are free to modify the surface for scaling or subpicture blending within a call to vaPutImage.
Calls to vaPutImage or vaGetImage using the same surface from which the image has been derived will return VA_STATUS_ERROR_SURFACE_BUSY. vaPutImage or vaGetImage with other surfaces is supported.
An image created with vaDeriveImage should be freed with vaDestroyImage. The image and image buffer structures will be destroyed; however, the underlying surface will remain unchanged until freed with vaDestroySurfaces.
| VAStatus vaDestroyBuffer | ( | VADisplay | dpy, |
| VABufferID | buffer_id | ||
| ) |
After this call, the buffer is deleted and this buffer_id is no longer valid Only call this if the buffer is not going to be passed to vaRenderBuffer
| VAStatus vaDestroyConfig | ( | VADisplay | dpy, |
| VAConfigID | config_id | ||
| ) |
Free resources associdated with a given config
| VAStatus vaDestroyContext | ( | VADisplay | dpy, |
| VAContextID | context | ||
| ) |
vaDestroyContext - Destroy a context dpy: display context: context to be destroyed
| VAStatus vaDestroyImage | ( | VADisplay | dpy, |
| VAImageID | image | ||
| ) |
Should call DestroyImage before destroying the surface it is bound to
| VAStatus vaDestroySubpicture | ( | VADisplay | dpy, |
| VASubpictureID | subpicture | ||
| ) |
Destroy the subpicture before destroying the image it is assocated to
| VAStatus vaDestroySurfaces | ( | VADisplay | dpy, |
| VASurfaceID * | surfaces, | ||
| int | num_surfaces | ||
| ) |
vaDestroySurfaces - Destroy resources associated with surfaces. Surfaces can only be destroyed after 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.
| 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.
| const char* vaErrorStr | ( | VAStatus | error_status | ) |
Returns a short english description of error_status
| VAStatus vaGetConfigAttributes | ( | VADisplay | dpy, |
| VAProfile | profile, | ||
| VAEntrypoint | entrypoint, | ||
| VAConfigAttrib * | attrib_list, | ||
| int | num_attribs | ||
| ) |
Get attributes for a given profile/entrypoint pair The caller must provide an "attrib_list" with all attributes to be retrieved. Upon return, the attributes in "attrib_list" have been updated with their value. Unknown attributes or attributes that are not supported for the given profile/entrypoint pair will have their value set to VA_ATTRIB_NOT_SUPPORTED
| VAStatus 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.
| VAStatus vaGetImage | ( | VADisplay | dpy, |
| VASurfaceID | surface, | ||
| int | x, | ||
| int | y, | ||
| unsigned int | width, | ||
| unsigned int | height, | ||
| VAImageID | image | ||
| ) |
Retrive surface data into a VAImage Image must be in a format supported by the implementation
| VAPrivFunc vaGetLibFunc | ( | VADisplay | dpy, |
| const char * | func | ||
| ) |
Return a function pointer given a function name in the library. This allows private interfaces into the library
| VAStatus vaInitialize | ( | VADisplay | dpy, |
| int * | major_version, | ||
| int * | minor_version | ||
| ) |
Initialize the library
| VAStatus vaMapBuffer | ( | VADisplay | dpy, |
| VABufferID | buf_id, | ||
| void ** | pbuf | ||
| ) |
Map data store of the buffer into the client's address space vaCreateBuffer() needs to be called with "data" set to NULL before calling vaMapBuffer()
if buffer type is VAEncCodedBufferType, pbuf points to link-list of VACodedBufferSegment, and the list is terminated if "next" is NULL
| int vaMaxNumConfigAttributes | ( | VADisplay | dpy | ) |
Get maximum number of attributs supported by the implementation
| int vaMaxNumDisplayAttributes | ( | VADisplay | dpy | ) |
Get maximum number of display attributs supported by the implementation
| int vaMaxNumEntrypoints | ( | VADisplay | dpy | ) |
Get maximum number of entrypoints supported by the implementation
| int vaMaxNumImageFormats | ( | VADisplay | dpy | ) |
Get maximum number of image formats supported by the implementation
| int vaMaxNumProfiles | ( | VADisplay | dpy | ) |
Get maximum number of profiles supported by the implementation
| int vaMaxNumSubpictureFormats | ( | VADisplay | dpy | ) |
Get maximum number of subpicture formats supported by the implementation
| VAStatus vaPutImage | ( | VADisplay | dpy, |
| VASurfaceID | surface, | ||
| VAImageID | image, | ||
| int | src_x, | ||
| int | src_y, | ||
| unsigned int | src_width, | ||
| unsigned int | src_height, | ||
| int | dest_x, | ||
| int | dest_y, | ||
| unsigned int | dest_width, | ||
| unsigned int | dest_height | ||
| ) |
Copy data from a VAImage to a surface Image must be in a format supported by the implementation Returns a VA_STATUS_ERROR_SURFACE_BUSY if the surface shouldn't be rendered into when this is called
| VAStatus vaQueryConfigAttributes | ( | VADisplay | dpy, |
| VAConfigID | config_id, | ||
| VAProfile * | profile, | ||
| VAEntrypoint * | entrypoint, | ||
| VAConfigAttrib * | attrib_list, | ||
| int * | num_attribs | ||
| ) |
Query all attributes for a given configuration The profile of the configuration is returned in "profile" The entrypoint of the configuration is returned in "entrypoint" The caller must provide an "attrib_list" array that can hold at least vaMaxNumConfigAttributes() entries. The actual number of attributes returned in "attrib_list" is returned in "num_attribs"
| VAStatus vaQueryConfigEntrypoints | ( | VADisplay | dpy, |
| VAProfile | profile, | ||
| VAEntrypoint * | entrypoint_list, | ||
| int * | num_entrypoints | ||
| ) |
Query supported entrypoints for a given profile The caller must provide an "entrypoint_list" array that can hold at least vaMaxNumEntrypoints() entries. The actual number of entrypoints returned in "entrypoint_list" is returned in "num_entrypoints".
Query supported profiles The caller must provide a "profile_list" array that can hold at least vaMaxNumProfile() entries. The actual number of profiles returned in "profile_list" is returned in "num_profile".
| VAStatus 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".
| VAStatus vaQueryImageFormats | ( | VADisplay | dpy, |
| VAImageFormat * | format_list, | ||
| int * | num_formats | ||
| ) |
Query supported image formats The caller must provide a "format_list" array that can hold at least vaMaxNumImageFormats() entries. The actual number of formats returned in "format_list" is returned in "num_formats".
| VAStatus vaQuerySubpictureFormats | ( | VADisplay | dpy, |
| VAImageFormat * | format_list, | ||
| unsigned int * | flags, | ||
| unsigned int * | num_formats | ||
| ) |
Query supported subpicture formats The caller must provide a "format_list" array that can hold at least vaMaxNumSubpictureFormats() entries. The flags arrary holds the flag for each format to indicate additional capabilities for that format. The actual number of formats returned in "format_list" is returned in "num_formats". flags: returned value to indicate addtional capabilities VA_SUBPICTURE_CHROMA_KEYING - supports chroma-keying VA_SUBPICTURE_GLOBAL_ALPHA - supports global alpha VA_SUBPICTURE_DESTINATION_IS_SCREEN_COORD - supports unscaled screen relative subpictures for On Screen Display
| VAStatus vaQuerySurfaceAttributes | ( | VADisplay | dpy, |
| VAConfigID | config, | ||
| VASurfaceAttrib * | attrib_list, | ||
| unsigned int * | num_attribs | ||
| ) |
Queries surface attributes for the supplied config.
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.
| [in] | dpy | the VA display |
| [in] | config | the config identifying a codec or a video processing pipeline |
| [out] | attrib_list | the output array of VASurfaceAttrib elements |
| [in,out] | num_attribs | the number of elements allocated on input, the number of elements actually filled in output |
| VAStatus vaQuerySurfaceError | ( | VADisplay | dpy, |
| VASurfaceID | surface, | ||
| VAStatus | error_status, | ||
| void ** | error_info | ||
| ) |
After the application gets VA_STATUS_ERROR_DECODING_ERROR after calling vaSyncSurface(), it can call vaQuerySurfaceError to find out further details on the particular error. VA_STATUS_ERROR_DECODING_ERROR should be passed in as "error_status", upon the return, error_info will point to an array of _VASurfaceDecodeMBErrors structure, which is allocated and filled by libVA with detailed information on the missing or error macroblocks. The array is terminated if "status==-1" is detected.
| VAStatus vaQuerySurfaceStatus | ( | VADisplay | dpy, |
| VASurfaceID | render_target, | ||
| VASurfaceStatus * | status | ||
| ) |
Find out any pending ops on the render target
| const char* vaQueryVendorString | ( | VADisplay | dpy | ) |
vaQueryVendorString returns a pointer to a zero-terminated string describing some aspects of the VA implemenation on a specific hardware accelerator. The format of the returned string is vendor specific and at the discretion of the implementer. e.g. for the Intel GMA500 implementation, an example would be: "Intel GMA500 - 2.0.0.32L.0005"
| VAStatus vaReleaseBufferHandle | ( | VADisplay | dpy, |
| VABufferID | buf_id | ||
| ) |
Releases buffer after usage from external API.
Unlocks the VA buffer object buf_id from external API usage like EGL or OpenCL (OCL). This function is a synchronization point. This means that any pending operation is guaranteed to be completed prior to returning from the function.
The VABufferInfo argument shall point to the original data structure that was obtained from vaAcquireBufferHandle(), unaltered. This is necessary so that the VA driver implementation could deallocate any resources that were needed.
In any case, returning from this function invalidates any contents in VABufferInfo. i.e. the underlyng buffer handle is no longer valid. Therefore, VA driver implementations are free to reset this data structure to safe defaults.
Possible errors:
| [in] | dpy | the VA display |
| [in] | buf_id | the VA buffer |
| VAStatus vaRenderPicture | ( | VADisplay | dpy, |
| VAContextID | context, | ||
| VABufferID * | buffers, | ||
| int | num_buffers | ||
| ) |
Send decode buffers to the server. Buffers are automatically destroyed afterwards
| 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
| VAStatus vaSetSubpictureChromakey | ( | VADisplay | dpy, |
| VASubpictureID | subpicture, | ||
| unsigned int | chromakey_min, | ||
| unsigned int | chromakey_max, | ||
| unsigned int | chromakey_mask | ||
| ) |
If chromakey is enabled, then the area where the source value falls within the chromakey [min, max] range is transparent The chromakey component format is the following: For RGB: [0:7] Red [8:15] Blue [16:23] Green For YUV: [0:7] V [8:15] U [16:23] Y The chromakey mask can be used to mask out certain components for chromakey comparision
| VAStatus vaSetSubpictureGlobalAlpha | ( | VADisplay | dpy, |
| VASubpictureID | subpicture, | ||
| float | global_alpha | ||
| ) |
Global alpha value is between 0 and 1. A value of 1 means fully opaque and a value of 0 means fully transparent. If per-pixel alpha is also specified then the overall alpha is per-pixel alpha multiplied by the global alpha
| VAStatus vaSetSubpictureImage | ( | VADisplay | dpy, |
| VASubpictureID | subpicture, | ||
| VAImageID | image | ||
| ) |
Bind an image to the subpicture. This image will now be associated with the subpicture instead of the one at creation.
| VAStatus vaSyncSurface | ( | VADisplay | dpy, |
| VASurfaceID | render_target | ||
| ) |
This function blocks until all pending operations on the render target have been completed. Upon return it is safe to use the render target for a different picture.
| VAStatus vaTerminate | ( | VADisplay | dpy | ) |
After this call, all library internal resources will be cleaned up
| VAStatus vaUnmapBuffer | ( | VADisplay | dpy, |
| VABufferID | buf_id | ||
| ) |
After client making changes to a mapped data store, it needs to "Unmap" it to let the server know that the data is ready to be consumed by the server
1.8.8