Commit 42c28c46 authored by Austin Yuan's avatar Austin Yuan

bump libva to 23

parent f579969b
...@@ -517,6 +517,18 @@ VAStatus dummy_DestroySubpicture( ...@@ -517,6 +517,18 @@ VAStatus dummy_DestroySubpicture(
return VA_STATUS_SUCCESS; return VA_STATUS_SUCCESS;
} }
VAStatus dummy_SetSubpictureImage(
VADriverContextP ctx,
VASubpicture *subpicture,
VAImage *image
)
{
INIT_DRIVER_DATA
/* TODO */
return VA_STATUS_SUCCESS;
}
VAStatus dummy_SetSubpicturePalette( VAStatus dummy_SetSubpicturePalette(
VADriverContextP ctx, VADriverContextP ctx,
VASubpicture *subpicture, VASubpicture *subpicture,
...@@ -1005,6 +1017,25 @@ VAStatus dummy_PutSurface( ...@@ -1005,6 +1017,25 @@ VAStatus dummy_PutSurface(
return VA_STATUS_ERROR_UNKNOWN; return VA_STATUS_ERROR_UNKNOWN;
} }
VAStatus dummy_CopySurfaceToGLXPbuffer (
VADriverContextP ctx,
VASurface *surface,
XID pbuffer_id,
short srcx,
short srcy,
unsigned short width,
unsigned short height,
short destx,
short desty,
unsigned int draw_buffer,
unsigned int flags /* de-interlacing flags */
)
{
/* TODO */
return VA_STATUS_ERROR_UNKNOWN;
}
VAStatus dummy_DbgCopySurfaceToBuffer( VAStatus dummy_DbgCopySurfaceToBuffer(
VADriverContextP ctx, VADriverContextP ctx,
VASurface *surface, VASurface *surface,
...@@ -1056,7 +1087,7 @@ VAStatus dummy_Terminate( VADriverContextP ctx ) ...@@ -1056,7 +1087,7 @@ VAStatus dummy_Terminate( VADriverContextP ctx )
return VA_STATUS_SUCCESS; return VA_STATUS_SUCCESS;
} }
VAStatus __vaDriverInit_0_22( VADriverContextP ctx ) VAStatus __vaDriverInit_0_23( VADriverContextP ctx )
{ {
object_base_p obj; object_base_p obj;
int result; int result;
...@@ -1094,6 +1125,7 @@ VAStatus __vaDriverInit_0_22( VADriverContextP ctx ) ...@@ -1094,6 +1125,7 @@ VAStatus __vaDriverInit_0_22( VADriverContextP ctx )
ctx->vtable.vaSyncSurface = dummy_SyncSurface; ctx->vtable.vaSyncSurface = dummy_SyncSurface;
ctx->vtable.vaQuerySurfaceStatus = dummy_QuerySurfaceStatus; ctx->vtable.vaQuerySurfaceStatus = dummy_QuerySurfaceStatus;
ctx->vtable.vaPutSurface = dummy_PutSurface; ctx->vtable.vaPutSurface = dummy_PutSurface;
ctx->vtable.vaCopySurfaceToGLXPbuffer = dummy_CopySurfaceToGLXPbuffer;
ctx->vtable.vaQueryImageFormats = dummy_QueryImageFormats; ctx->vtable.vaQueryImageFormats = dummy_QueryImageFormats;
ctx->vtable.vaCreateImage = dummy_CreateImage; ctx->vtable.vaCreateImage = dummy_CreateImage;
ctx->vtable.vaDestroyImage = dummy_DestroyImage; ctx->vtable.vaDestroyImage = dummy_DestroyImage;
...@@ -1102,6 +1134,7 @@ VAStatus __vaDriverInit_0_22( VADriverContextP ctx ) ...@@ -1102,6 +1134,7 @@ VAStatus __vaDriverInit_0_22( VADriverContextP ctx )
ctx->vtable.vaQuerySubpictureFormats = dummy_QuerySubpictureFormats; ctx->vtable.vaQuerySubpictureFormats = dummy_QuerySubpictureFormats;
ctx->vtable.vaCreateSubpicture = dummy_CreateSubpicture; ctx->vtable.vaCreateSubpicture = dummy_CreateSubpicture;
ctx->vtable.vaDestroySubpicture = dummy_DestroySubpicture; ctx->vtable.vaDestroySubpicture = dummy_DestroySubpicture;
ctx->vtable.vaSetSubpictureImage = dummy_SetSubpictureImage;
ctx->vtable.vaSetSubpicturePalette = dummy_SetSubpicturePalette; ctx->vtable.vaSetSubpicturePalette = dummy_SetSubpicturePalette;
ctx->vtable.vaSetSubpictureChromakey = dummy_SetSubpictureChromakey; ctx->vtable.vaSetSubpictureChromakey = dummy_SetSubpictureChromakey;
ctx->vtable.vaSetSubpictureGlobalAlpha = dummy_SetSubpictureGlobalAlpha; ctx->vtable.vaSetSubpictureGlobalAlpha = dummy_SetSubpictureGlobalAlpha;
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
#define DEFAULT_DRIVER_DIR "/usr/X11R6/lib/modules/dri" #define DEFAULT_DRIVER_DIR "/usr/X11R6/lib/modules/dri"
#define DRIVER_EXTENSION "_drv_video.so" #define DRIVER_EXTENSION "_drv_video.so"
#define DRIVER_INIT_FUNC "__vaDriverInit_0_22" #define DRIVER_INIT_FUNC "__vaDriverInit_0_23"
#define CTX(dpy) ((VADriverContextP) dpy ); #define CTX(dpy) ((VADriverContextP) dpy );
#define ASSERT_CONTEXT(dpy) assert( vaDbgContextIsValid(dpy) ) #define ASSERT_CONTEXT(dpy) assert( vaDbgContextIsValid(dpy) )
...@@ -276,6 +276,7 @@ static VAStatus va_openDriver(VADriverContextP ctx, char *driver_name) ...@@ -276,6 +276,7 @@ static VAStatus va_openDriver(VADriverContextP ctx, char *driver_name)
CHECK_VTABLE(vaStatus, ctx, SyncSurface); CHECK_VTABLE(vaStatus, ctx, SyncSurface);
CHECK_VTABLE(vaStatus, ctx, QuerySurfaceStatus); CHECK_VTABLE(vaStatus, ctx, QuerySurfaceStatus);
CHECK_VTABLE(vaStatus, ctx, PutSurface); CHECK_VTABLE(vaStatus, ctx, PutSurface);
CHECK_VTABLE(vaStatus, ctx, CopySurfaceToGLXPbuffer);
CHECK_VTABLE(vaStatus, ctx, QueryImageFormats); CHECK_VTABLE(vaStatus, ctx, QueryImageFormats);
CHECK_VTABLE(vaStatus, ctx, CreateImage); CHECK_VTABLE(vaStatus, ctx, CreateImage);
CHECK_VTABLE(vaStatus, ctx, DestroyImage); CHECK_VTABLE(vaStatus, ctx, DestroyImage);
...@@ -284,6 +285,7 @@ static VAStatus va_openDriver(VADriverContextP ctx, char *driver_name) ...@@ -284,6 +285,7 @@ static VAStatus va_openDriver(VADriverContextP ctx, char *driver_name)
CHECK_VTABLE(vaStatus, ctx, QuerySubpictureFormats); CHECK_VTABLE(vaStatus, ctx, QuerySubpictureFormats);
CHECK_VTABLE(vaStatus, ctx, CreateSubpicture); CHECK_VTABLE(vaStatus, ctx, CreateSubpicture);
CHECK_VTABLE(vaStatus, ctx, DestroySubpicture); CHECK_VTABLE(vaStatus, ctx, DestroySubpicture);
CHECK_VTABLE(vaStatus, ctx, SetSubpictureImage);
CHECK_VTABLE(vaStatus, ctx, SetSubpicturePalette); CHECK_VTABLE(vaStatus, ctx, SetSubpicturePalette);
CHECK_VTABLE(vaStatus, ctx, SetSubpictureChromakey); CHECK_VTABLE(vaStatus, ctx, SetSubpictureChromakey);
CHECK_VTABLE(vaStatus, ctx, SetSubpictureGlobalAlpha); CHECK_VTABLE(vaStatus, ctx, SetSubpictureGlobalAlpha);
...@@ -762,6 +764,29 @@ VAStatus vaPutSurface ( ...@@ -762,6 +764,29 @@ VAStatus vaPutSurface (
cliprects, number_cliprects, flags ); cliprects, number_cliprects, flags );
} }
VAStatus vaCopySurfaceToGLXPbuffer (
VADisplay dpy,
VASurface *surface,
XID pbuffer_id,
short srcx,
short srcy,
unsigned short width,
unsigned short height,
short destx,
short desty,
unsigned int draw_buffer,
unsigned int flags /* de-interlacing flags */
)
{
VADriverContextP ctx = CTX(dpy);
ASSERT_CONTEXT(ctx);
TRACE(vaCopySurfaceToGLXPbuffer);
return ctx->vtable.vaCopySurfaceToGLXPbuffer( ctx, surface, pbuffer_id,
srcx,srcy,width, height,destx,desty,
draw_buffer, flags );
}
/* Get maximum number of image formats supported by the implementation */ /* Get maximum number of image formats supported by the implementation */
int vaMaxNumImageFormats ( int vaMaxNumImageFormats (
VADisplay dpy VADisplay dpy
...@@ -931,6 +956,20 @@ VAStatus vaDestroySubpicture ( ...@@ -931,6 +956,20 @@ VAStatus vaDestroySubpicture (
return ctx->vtable.vaDestroySubpicture ( ctx, subpicture); return ctx->vtable.vaDestroySubpicture ( ctx, subpicture);
} }
VAStatus vaSetSubpictureImage (
VADisplay dpy,
VASubpicture *subpicture,
VAImage *image
)
{
VADriverContextP ctx = CTX(dpy);
ASSERT_CONTEXT(ctx);
TRACE(vaSetSubpictureImage);
return ctx->vtable.vaSetSubpictureImage ( ctx, subpicture, image);
}
VAStatus vaSetSubpicturePalette ( VAStatus vaSetSubpicturePalette (
VADisplay dpy, VADisplay dpy,
VASubpicture *subpicture, VASubpicture *subpicture,
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
/* /*
* Video Decode Acceleration API Specification * Video Decode Acceleration API Specification
* *
* Rev. 0.22 * Rev. 0.23
* <jonathan.bian@intel.com> * <jonathan.bian@intel.com>
* *
* Revision History: * Revision History:
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
* rev 0.20 (08/08/2007 Jonathan Bian) - Added missing fields to VC-1 PictureParameter structure. * rev 0.20 (08/08/2007 Jonathan Bian) - Added missing fields to VC-1 PictureParameter structure.
* rev 0.21 (08/20/2007 Jonathan Bian) - Added image and subpicture support. * rev 0.21 (08/20/2007 Jonathan Bian) - Added image and subpicture support.
* rev 0.22 (08/27/2007 Jonathan Bian) - Added support for chroma-keying and global alpha. * rev 0.22 (08/27/2007 Jonathan Bian) - Added support for chroma-keying and global alpha.
* rev 0.23 (09/07/2007 Jonathan Bian) - Fixed some issues with images and subpictures.
* *
* Acknowledgements: * Acknowledgements:
* Some concepts borrowed from XvMC and XvImage. * Some concepts borrowed from XvMC and XvImage.
...@@ -397,7 +398,8 @@ typedef enum ...@@ -397,7 +398,8 @@ typedef enum
VASliceDataBufferType = 5, VASliceDataBufferType = 5,
VAMacroblockParameterBufferType = 6, VAMacroblockParameterBufferType = 6,
VAResidualDataBufferType = 7, VAResidualDataBufferType = 7,
VADeblockingParameterBufferType = 8 VADeblockingParameterBufferType = 8,
VAImageBufferType = 9
} VABufferType; } VABufferType;
/**************************** /****************************
...@@ -430,7 +432,9 @@ typedef struct _VAPictureParameterBufferMPEG2 ...@@ -430,7 +432,9 @@ typedef struct _VAPictureParameterBufferMPEG2
unsigned char alternate_scan : 1; unsigned char alternate_scan : 1;
unsigned char repeat_first_field : 1; unsigned char repeat_first_field : 1;
unsigned char progressive_frame : 1; unsigned char progressive_frame : 1;
unsigned char is_first_field : 1;/* indicate whether the current field is the first field for field picture */ unsigned char is_first_field : 1; /* indicate whether the current field
* is the first field for field picture
*/
}; };
unsigned int picture_coding_extension; unsigned int picture_coding_extension;
}; };
...@@ -1030,6 +1034,7 @@ VAStatus vaQuerySurfaceStatus ( ...@@ -1030,6 +1034,7 @@ VAStatus vaQuerySurfaceStatus (
VASurfaceStatus *status /* out */ VASurfaceStatus *status /* out */
); );
/* /*
* Copies the surface to a buffer * Copies the surface to a buffer
* The stride of the surface will be stored in *stride * The stride of the surface will be stored in *stride
...@@ -1075,10 +1080,18 @@ typedef int VAImageID; ...@@ -1075,10 +1080,18 @@ typedef int VAImageID;
typedef struct _VAImage typedef struct _VAImage
{ {
VAImageID image_id; /* uniquely identify this image */ VAImageID image_id; /* uniquely identify this image */
VASurfaceID surface_id; /* which surface will this image be associated with */
VAImageFormat format; VAImageFormat format;
unsigned char *data; /* image data pointer */ VABufferID buf; /* image data buffer */
/* The following fields are set by the library */ /*
* Image data will be stored in a buffer of type VAImageBufferType to facilitate
* data store on the server side for optimal performance.
* It is expected that the client will first call vaCreateImage which returns a VAImage
* structure with the following fields filled by the library. It will then
* create the "buf" with vaBufferCreate. For PutImage, then client will call
* vaBufferData() with the image data before calling PutImage, and for GetImage
* the client will call vaBufferData() with a NULL data pointer, and then call GetImage.
* After that the client can use the Map/Unmap buffer functions to access the image data.
*/
unsigned short width; unsigned short width;
unsigned short height; unsigned short height;
unsigned int data_size; unsigned int data_size;
...@@ -1090,7 +1103,7 @@ typedef struct _VAImage ...@@ -1090,7 +1103,7 @@ typedef struct _VAImage
unsigned int *pitches; unsigned int *pitches;
/* /*
* An array of size num_planes indicating the byte offset from * An array of size num_planes indicating the byte offset from
* "data" t the start of each plane. * the beginning of the image data to the start of each plane.
*/ */
unsigned int *offsets; unsigned int *offsets;
} VAImage; } VAImage;
...@@ -1113,12 +1126,13 @@ VAStatus vaQueryImageFormats ( ...@@ -1113,12 +1126,13 @@ VAStatus vaQueryImageFormats (
); );
/* /*
* Create a VAImage structure
* The width and height fields returned in the VAImage structure may get * The width and height fields returned in the VAImage structure may get
* enlarged for some YUV formats. The size of the data buffer that needs * enlarged for some YUV formats. The size of the data buffer that needs
* to be allocated will be given in the "data_size" field in VAImage. * to be allocated will be given in the "data_size" field in VAImage.
* Image data is not allocated by this function. The client should * Image data is not allocated by this function. The client should
* allocate the memory and fill in the VAImage structure's data field * allocate the memory required for the data and fill in the data field after
* after looking at "data_size" returned from the library. * looking at "data_size" returned from this call.
*/ */
VAStatus vaCreateImage ( VAStatus vaCreateImage (
VADisplay dpy, VADisplay dpy,
...@@ -1244,6 +1258,16 @@ VAStatus vaDestroySubpicture ( ...@@ -1244,6 +1258,16 @@ VAStatus vaDestroySubpicture (
VASubpicture *subpicture VASubpicture *subpicture
); );
/*
* Bind an image to the subpicture. This image will now be associated with
* the subpicture instead of the one at creation.
*/
VAStatus vaSetSubpictureImage (
VADisplay dpy,
VASubpicture *subpicture,
VAImage *image
);
VAStatus vaSetSubpicturePalette ( VAStatus vaSetSubpicturePalette (
VADisplay dpy, VADisplay dpy,
VASubpicture *subpicture, VASubpicture *subpicture,
...@@ -1453,7 +1477,7 @@ Mostly to demonstrate program flow with no error handling ... ...@@ -1453,7 +1477,7 @@ Mostly to demonstrate program flow with no error handling ...
VASubpicture subpicture; VASubpicture subpicture;
unsigned char sub_data[128][16]; unsigned char sub_data[128][16];
/* fill sub_data with subtitle in AI44 */ /* fill sub_data with subtitle in AI44 */
vaCreateImage(dpy, surfaces, sub_formats, 128, 16, sub_data, &sub_image); vaCreateImage(dpy, sub_formats, 128, 16,&sub_image);
vaCreateSubpicture(dpy, &sub_image, &subpicture); vaCreateSubpicture(dpy, &sub_image, &subpicture);
unsigned char palette[3][16]; unsigned char palette[3][16];
/* fill the palette data */ /* fill the palette data */
......
...@@ -208,6 +208,20 @@ struct VADriverContext ...@@ -208,6 +208,20 @@ struct VADriverContext
int flags /* de-interlacing flags */ int flags /* de-interlacing flags */
); );
VAStatus (*vaCopySurfaceToGLXPbuffer) (
VADriverContextP ctx,
VASurface *surface,
XID pbuffer_id,
short srcx,
short srcy,
unsigned short width,
unsigned short height,
short destx,
short desty,
unsigned int draw_buffer,
unsigned int flags /* de-interlacing flags */
);
VAStatus (*vaQueryImageFormats) ( VAStatus (*vaQueryImageFormats) (
VADriverContextP ctx, VADriverContextP ctx,
VAImageFormat *format_list, /* out */ VAImageFormat *format_list, /* out */
...@@ -267,6 +281,12 @@ struct VADriverContext ...@@ -267,6 +281,12 @@ struct VADriverContext
VASubpicture *subpicture VASubpicture *subpicture
); );
VAStatus (*vaSetSubpictureImage) (
VADriverContextP ctx,
VASubpicture *subpicture,
VAImage *image
);
VAStatus (*vaSetSubpicturePalette) ( VAStatus (*vaSetSubpicturePalette) (
VADriverContextP ctx, VADriverContextP ctx,
VASubpicture *subpicture, VASubpicture *subpicture,
......
...@@ -32,6 +32,10 @@ extern "C" { ...@@ -32,6 +32,10 @@ extern "C" {
* rectangle * rectangle
*/ */
/* de-interlace flags for vaPutSurface */
#define VA_TOP_FIELD 0x00000001
#define VA_BOTTOM_FIELD 0x00000002
#define VA_FRAME_PICTURE 0x00000004 /* weave */
VAStatus vaPutSurface ( VAStatus vaPutSurface (
VADisplay dpy, VADisplay dpy,
VASurface *surface, VASurface *surface,
...@@ -49,6 +53,50 @@ VAStatus vaPutSurface ( ...@@ -49,6 +53,50 @@ VAStatus vaPutSurface (
int flags /* de-interlacing flags */ int flags /* de-interlacing flags */
); );
/*
This function copies a rectangle of dimension "width" by "height"
from the VASurface indicated by "surface" to the GLXPbuffer
identified by its XID "pbuffer_id". The locations of source and
destination rectangles are specified differently for the VASurface
source and the GLXPbuffer destination as follows. On the VASurface,
the rectangle location is specified in the usual X-Window fashion
with srcx and srcy indicating the location of the upper left hand
corner of the rectangle relative to the VASurface origin (the upper
left hand corner of the XvMCSurface with positive Y axis going in the
down direction). On the GLXPbuffer the rectangle location is
specified in the usual OpenGL fashion with the dstx and dsty
indicating the location of the lower left hand corner of the
rectangle relative to the GLXPbuffer origin (the lower left hand
corner of the GLXPbuffer with the positive Y axis going in the
up direction).
The "draw_buffer" takes the same OpenGL enums that glDrawBuffer()
takes (ie. GL_FRONT_LEFT, GL_FRONT_RIGHT, GL_BACK_LEFT, GL_BACK_RIGHT,
GL_FRONT, GL_BACK, GL_LEFT, GL_RIGHT or GL_FRONT_AND_BACK). This
indicates which buffer of the GLXPbuffer is to be used for the
destination of the copy. Buffers specified in the "draw_buffer"
that do not exist in the GLXPbuffer are ignored.
"flags" may be VA_TOP_FIELD, VA_BOTTOM_FIELD or VA_FRAME_PICTURE.
If flags is not VA_FRAME_PICTURE, the srcy and height are in field
coordinates, not frame. That is, the total copyable height is half
the height of the VASurface.
*/
VAStatus vaCopySurfaceToGLXPbuffer (
VADisplay dpy,
VASurface *surface,
XID pbuffer_id,
short srcx,
short srcy,
unsigned short width,
unsigned short height,
short destx,
short desty,
unsigned int draw_buffer,
unsigned int flags /* de-interlacing flags */
);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment