2 * Video Decode Acceleration API, X11 specific functions
5 * <jonathan.bian@intel.com>
8 * rev 0.1 (12/10/06 Jonathan Bian) - Initial draft
9 * rev 0.11 (12/15/06 Jonathan Bian) - Fixed some errors
10 * rev 0.12 (02/05/07 Jonathan Bian) - Added VC-1 data structures
11 * rev 0.13 (02/28/07 Jonathan Bian) - Added GetDisplay()
12 * rev 0.14 (04/13/07 Jonathan Bian) - Fixed MPEG-2 PictureParameter struct, cleaned up a few funcs.
13 * rev 0.15 (04/20/07 Jonathan Bian) - Overhauled buffer management
28 * Following is the rendering interface for X windows,
29 * to get the decode output surface to a X drawable
30 * It basically performs a de-interlacing (if needed),
31 * color space conversion and scaling to the destination
35 /* de-interlace flags for vaPutSurface */
36 #define VA_TOP_FIELD 0x00000001
37 #define VA_BOTTOM_FIELD 0x00000002
38 #define VA_FRAME_PICTURE 0x00000004 /* weave */
39 VAStatus vaPutSurface (
42 Drawable draw, /* X Drawable */
51 VARectangle *cliprects, /* client supplied clip list */
52 unsigned int number_cliprects, /* number of clip rects in the clip list */
53 int flags /* de-interlacing flags */
57 This function copies a rectangle of dimension "width" by "height"
58 from the VASurface indicated by "surface" to the GLXPbuffer
59 identified by its XID "pbuffer_id". The locations of source and
60 destination rectangles are specified differently for the VASurface
61 source and the GLXPbuffer destination as follows. On the VASurface,
62 the rectangle location is specified in the usual X-Window fashion
63 with srcx and srcy indicating the location of the upper left hand
64 corner of the rectangle relative to the VASurface origin (the upper
65 left hand corner of the XvMCSurface with positive Y axis going in the
66 down direction). On the GLXPbuffer the rectangle location is
67 specified in the usual OpenGL fashion with the dstx and dsty
68 indicating the location of the lower left hand corner of the
69 rectangle relative to the GLXPbuffer origin (the lower left hand
70 corner of the GLXPbuffer with the positive Y axis going in the
73 The "draw_buffer" takes the same OpenGL enums that glDrawBuffer()
74 takes (ie. GL_FRONT_LEFT, GL_FRONT_RIGHT, GL_BACK_LEFT, GL_BACK_RIGHT,
75 GL_FRONT, GL_BACK, GL_LEFT, GL_RIGHT or GL_FRONT_AND_BACK). This
76 indicates which buffer of the GLXPbuffer is to be used for the
77 destination of the copy. Buffers specified in the "draw_buffer"
78 that do not exist in the GLXPbuffer are ignored.
80 "flags" may be VA_TOP_FIELD, VA_BOTTOM_FIELD or VA_FRAME_PICTURE.
81 If flags is not VA_FRAME_PICTURE, the srcy and height are in field
82 coordinates, not frame. That is, the total copyable height is half
83 the height of the VASurface.
85 VAStatus vaCopySurfaceToGLXPbuffer (
92 unsigned short height,
95 unsigned int draw_buffer,
96 unsigned int flags /* de-interlacing flags */
104 #endif /* _VA_X11_H_ */