summaryrefslogtreecommitdiff
path: root/src/va.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/va.h')
-rwxr-xr-xsrc/va.h142
1 files changed, 110 insertions, 32 deletions
diff --git a/src/va.h b/src/va.h
index 49c26bd..739af99 100755
--- a/src/va.h
+++ b/src/va.h
@@ -24,7 +24,7 @@
/*
* Video Decode Acceleration API Specification
*
- * Rev. 0.25
+ * Rev. 0.29
* <jonathan.bian@intel.com>
*
* Revision History:
@@ -46,6 +46,11 @@
* rev 0.24 (09/18/2007 Jonathan Bian) - Added display attributes.
* rev 0.25 (10/18/2007 Jonathan Bian) - Changed to use IDs only for some types.
* rev 0.26 (11/07/2007 Waldo Bastian) - Change vaCreateBuffer semantics
+ * rev 0.27 (11/19/2007 Matt Sottek) - Added DeriveImage
+ * rev 0.28 (12/06/2007 Jonathan Bian) - Added new versions of PutImage and AssociateSubpicture
+ * to enable scaling
+ * rev 0.29 (02/07/2007 Jonathan Bian) - VC1 parameter fixes,
+ * added VA_STATUS_ERROR_RESOLUTION_NOT_SUPPORTED
*
* Acknowledgements:
* Some concepts borrowed from XvMC and XvImage.
@@ -108,6 +113,9 @@ typedef int VAStatus; /* Return status type from functions */
#define VA_STATUS_ERROR_UNSUPPORTED_RT_FORMAT 0x0000000e
#define VA_STATUS_ERROR_UNSUPPORTED_BUFFERTYPE 0x0000000f
#define VA_STATUS_ERROR_SURFACE_BUSY 0x00000010
+#define VA_STATUS_ERROR_FLAG_NOT_SUPPORTED 0x00000011
+#define VA_STATUS_ERROR_INVALID_PARAMETER 0x00000012
+#define VA_STATUS_ERROR_RESOLUTION_NOT_SUPPORTED 0x00000013
#define VA_STATUS_ERROR_UNKNOWN 0xFFFFFFFF
/*
@@ -147,15 +155,26 @@ VAStatus vaTerminate (
/*
* 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:
- * <vendorname>-<major_version>-<minor_version>-<addtional_info>
+ * 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:
- * "IntelGMA500-1.0-0.2-patch3
+ * "Intel GMA500 - 2.0.0.32L.0005"
*/
const char *vaQueryVendorString (
VADisplay dpy
);
+typedef int (*VAPrivFunc)();
+
+/*
+ * Return a function pointer given a function name in the library.
+ * This allows private interfaces into the library
+ */
+VAPrivFunc vaGetLibFunc (
+ VADisplay dpy,
+ const char *func
+);
+
/* Currently defined profiles */
typedef enum
{
@@ -741,7 +760,7 @@ typedef struct _VAPictureParameterBufferVC1
union {
struct {
unsigned char reference_distance_flag : 1;/* PICTURE_LAYER::REFDIST_FLAG */
- unsigned char reference_distance : 1;/* PICTURE_LAYER::REFDIST */
+ unsigned char reference_distance : 5;/* PICTURE_LAYER::REFDIST */
unsigned char num_reference_pictures: 1;/* PICTURE_LAYER::NUMREF */
unsigned char reference_field_pic_indicator : 1;/* PICTURE_LAYER::REFFIELD */
};
@@ -765,6 +784,7 @@ typedef struct _VAPictureParameterBufferVC1
union {
struct {
unsigned char dquant : 2; /* ENTRY_POINT_LAYER::DQUANT */
+ unsigned char quantizer : 2; /* ENTRY_POINT_LAYER::QUANTIZER */
unsigned char half_qp : 1; /* PICTURE_LAYER::HALFQP */
unsigned char pic_quantizer_scale : 5;/* PICTURE_LAYER::PQUANT */
unsigned char pic_quantizer_type : 1;/* PICTURE_LAYER::PQUANTIZER */
@@ -906,9 +926,9 @@ typedef struct _VAIQMatrixBufferH264
typedef struct _VASliceParameterBufferH264
{
unsigned int slice_data_size;/* number of bytes in the slice data buffer for this slice */
- unsigned int slice_data_offset;/* the offset to first byte of slice data */
+ unsigned int slice_data_offset;/* the offset to the NAL start code for this slice */
unsigned int slice_data_flag; /* see VA_SLICE_DATA_FLAG_XXX defintions */
- unsigned short slice_data_bit_offset; /* bit offset in the first byte of valid data */
+ unsigned short slice_data_bit_offset; /* bit offset from NAL start code to the beginning of slice data */
unsigned short first_mb_in_slice;
unsigned char slice_type;
unsigned char direct_spatial_mv_pred_flag;
@@ -1079,18 +1099,6 @@ VAStatus vaQuerySurfaceStatus (
VASurfaceStatus *status /* out */
);
-
-/*
- * Copies the surface to a buffer
- * The stride of the surface will be stored in *stride
- * Caller should free the returned buffer with free() when done.
- */
-VAStatus vaDbgCopySurfaceToBuffer(VADisplay dpy,
- VASurfaceID surface,
- void **buffer, /* out */
- unsigned int *stride /* out */
-);
-
/*
* Images and Subpictures
* VAImage is used to either get the surface data to client memory, or
@@ -1252,6 +1260,63 @@ VAStatus vaPutImage (
int dest_y
);
+ /*
+ * Similar to vaPutImage but with additional destination width
+ * and height arguments to enable scaling
+ */
+VAStatus vaPutImage2 (
+ 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
+);
+
+/*
+ * 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 vaDeriveImage (
+ VADisplay dpy,
+ VASurfaceID surface,
+ VAImage *image /* out */
+);
+
+
+
/*
* Subpictures
* Subpicture is a special type of image that can be blended
@@ -1313,17 +1378,6 @@ VAStatus vaSetSubpictureImage (
VAImageID image
);
-VAStatus vaSetSubpicturePalette (
- VADisplay dpy,
- VASubpictureID subpicture,
- /*
- * pointer to an array holding the palette data. The size of the array is
- * num_palette_entries * entry_bytes in size. The order of the components
- * in the palette is described by the component_order in VAImage struct
- */
- unsigned char *palette
-);
-
/*
* If chromakey is enabled, then the area where the source value falls within
* the chromakey [min, max] range is transparent
@@ -1378,6 +1432,30 @@ VAStatus vaAssociateSubpicture (
);
/*
+ * Similar to vaAssociateSubpicture but with additional destination width
+ * and height to enable scaling
+ */
+VAStatus vaAssociateSubpicture2 (
+ VADisplay dpy,
+ VASubpictureID subpicture,
+ VASurfaceID *target_surfaces,
+ int num_surfaces,
+ short src_x, /* upper left offset in subpicture */
+ short src_y,
+ unsigned short src_width,
+ unsigned short src_height,
+ short dest_x, /* upper left offset in surface */
+ short dest_y,
+ unsigned short dest_width,
+ unsigned short dest_height,
+ /*
+ * whether to enable chroma-keying or global-alpha
+ * see VA_SUBPICTURE_XXX values
+ */
+ unsigned int flags
+);
+
+/*
* vaDeassociateSubpicture removes the association of the subpicture with target_surfaces.
*/
VAStatus vaDeassociateSubpicture (
@@ -1501,8 +1579,8 @@ Mostly to demonstrate program flow with no error handling ...
int max_num_profiles, max_num_entrypoints, max_num_attribs;
max_num_profiles = vaMaxNumProfiles(dpy);
- max_num_entrypoints = vaMaxNumProfiles(dpy);
- max_num_attribs = vaMaxNumProfiles(dpy);
+ max_num_entrypoints = vaMaxNumEntrypoints(dpy);
+ max_num_attribs = vaMaxNumAttributes(dpy);
/* find out whether MPEG2 MP is supported */
VAProfile *profiles = malloc(sizeof(VAProfile)*max_num_profiles);