Blame XvMC_API.txt

Packit Service d3952c
Packit Service d3952c
   X-Video Motion Compensation - API specification v. 1.0
Packit Service d3952c
Packit Service d3952c
   Mark Vojkovich <markv@xfree86.org>
Packit Service d3952c
Packit Service d3952c
Packit Service d3952c
/* history */
Packit Service d3952c
Packit Service d3952c
   first draft (9/6/00)
Packit Service d3952c
   second draft (10/31/00) - Changed to allow acceleration at both
Packit Service d3952c
      the motion compensation and IDCT level.
Packit Service d3952c
   third draft (1/21/01) - Some refinements and subpicture support.
Packit Service d3952c
   fourth draft (5/2/01) - Dual Prime clarification, add
Packit Service d3952c
      XvMCSetAttribute.
Packit Service d3952c
   fifth draft (6/26/01) - Change definition of XvMCCompositeSubpicture
Packit Service d3952c
      plus some clarifications and fixed typographical errors.
Packit Service d3952c
   sixth draft (9/24/01) - Added XVMC_SECOND_FIELD and removed
Packit Service d3952c
      XVMC_PROGRESSIVE_FRAME and XVMC_TOP_FIELD_FIRST flags.
Packit Service d3952c
   seventh draft (10/26/01) - Added XVMC_INTRA_UNSIGNED option.
Packit Service d3952c
   eighth draft (11/13/02) - Removed IQ level acceleration and
Packit Service d3952c
      changed some structures to remove unused fields.
Packit Service d3952c
Packit Service d3952c
/* acknowledgements */
Packit Service d3952c
Packit Service d3952c
   Thanks to Matthew J. Sottek from Intel for lots of input.
Packit Service d3952c
Packit Service d3952c
/********************************************************************/
Packit Service d3952c
Packit Service d3952c
      OVERVIEW
Packit Service d3952c
Packit Service d3952c
/********************************************************************/
Packit Service d3952c
Packit Service d3952c
     XvMC extends the X-Video extension (Xv) and makes use of the
Packit Service d3952c
  familar concept of the XvPort.  Ports have attributes that can be set
Packit Service d3952c
  and queried through Xv.  In XvMC ports can also have hardware motion
Packit Service d3952c
  compensation contexts created for use with them.  Ports which support
Packit Service d3952c
  XvImages (ie. they have an "XV_IMAGE" port encoding as described in
Packit Service d3952c
  the Xv version 2.2 API addendum) can be queried for the list of XvMCSurface
Packit Service d3952c
  types they support.  If they support any XvMCSurface types an
Packit Service d3952c
  XvMCContext can be created for that port.
Packit Service d3952c
Packit Service d3952c
     An XvMCContext describes the state of the motion compensation
Packit Service d3952c
  pipeline.  An individual XvMCContext can be created for use with
Packit Service d3952c
  a single port, surface type, motion compensation type, width and
Packit Service d3952c
  height combination.  For example, a context might be created for a
Packit Service d3952c
  particular port that does MPEG-2 motion compensation on 720 x 480
Packit Service d3952c
  4:2:0 surfaces.  Once the context is created, referencing it implies
Packit Service d3952c
  the port, surface type, size and the motion compensation type.  Contexts
Packit Service d3952c
  may be "direct" or "indirect".  For indirect contexts the X server
Packit Service d3952c
  renders all video using the data passed to it by the client.  For
Packit Service d3952c
  direct contexts the client libraries render the video with little
Packit Service d3952c
  or no interaction with the X server.
Packit Service d3952c
Packit Service d3952c
     XvMCSurfaces are buffers into which the motion compensation
Packit Service d3952c
  hardware can render.  The data in the buffers themselves are not client
Packit Service d3952c
  accessible and may be stored in a hardware-specific format.  Any
Packit Service d3952c
  number of buffers can be created for use with a particular context
Packit Service d3952c
  (resources permitting).
Packit Service d3952c
Packit Service d3952c
     XvMC provides video acceleration starting at one of two places
Packit Service d3952c
  in the video pipeline.  Acceleration starting at the first point,
Packit Service d3952c
  which we shall call the "Motion Compensation" level, begins after the
Packit Service d3952c
  the inverse quantization and IDCT at the place where motion compensation
Packit Service d3952c
  is to be applied.  The second point, which we shall call the "IDCT"
Packit Service d3952c
  level, begins before the IDCT just after the inverse quantization.
Packit Service d3952c
Packit Service d3952c
     Rendering is done by presenting the library with a target XvMCSurface
Packit Service d3952c
  and up to two reference XvMCSurfaces for the motion compensation, a
Packit Service d3952c
  buffer of 8x8 blocks and a command buffer which describes how to
Packit Service d3952c
  use the 8x8 blocks along with motion compensation vectors to construct
Packit Service d3952c
  the data in the target XvMCSurface.  When the pipeline starts at the
Packit Service d3952c
  IDCT level, Xv will perform the IDCT on the blocks before performing
Packit Service d3952c
  the motion compensation. A function is provided to copy/overlay a
Packit Service d3952c
  portion of the XvMCSurface to a drawable with arbitrary scaling.
Packit Service d3952c
Packit Service d3952c
    XvMCSubpictures are separate surfaces that may be blended with the
Packit Service d3952c
  target surface.  Any number of XvMCSubpictures may be created for use
Packit Service d3952c
  with a context (resources permitting).  Both "backend" and "frontend"
Packit Service d3952c
  subpicture behavior are supported.
Packit Service d3952c
Packit Service d3952c
/********************************************************************/
Packit Service d3952c
Packit Service d3952c
          QUERYING THE EXTENSION
Packit Service d3952c
Packit Service d3952c
/********************************************************************/
Packit Service d3952c
Packit Service d3952c
/* Errors */
Packit Service d3952c
#define XvMCBadContext		0
Packit Service d3952c
#define XvMCBadSurface		1
Packit Service d3952c
#define XvMCBadSubpicture	2
Packit Service d3952c
Packit Service d3952c
Bool XvMCQueryExtension (Display *display, int *eventBase, int *errBase)
Packit Service d3952c
Packit Service d3952c
   Returns True if the extension exists, False otherwise.  Also returns
Packit Service d3952c
 the error and event bases.
Packit Service d3952c
Packit Service d3952c
   display - The connection to the server.
Packit Service d3952c
Packit Service d3952c
   eventBase -
Packit Service d3952c
   errBase -  The returned event and error bases.  Currently there
Packit Service d3952c
              are no events defined.
Packit Service d3952c
Packit Service d3952c
Status XvMCQueryVersion (Display *display, int *major, int *minor)
Packit Service d3952c
Packit Service d3952c
   Query the major and minor version numbers of the extension.
Packit Service d3952c
Packit Service d3952c
   display - The connection to the server.
Packit Service d3952c
Packit Service d3952c
   major -
Packit Service d3952c
   minor -  The returned major and minor version numbers.
Packit Service d3952c
Packit Service d3952c
/********************************************************************/
Packit Service d3952c
Packit Service d3952c
          QUERYING SURFACE TYPES
Packit Service d3952c
Packit Service d3952c
/********************************************************************/
Packit Service d3952c
Packit Service d3952c
/* Chroma formats */
Packit Service d3952c
#define XVMC_CHROMA_FORMAT_420		0x00000001
Packit Service d3952c
#define XVMC_CHROMA_FORMAT_422		0x00000002
Packit Service d3952c
#define XVMC_CHROMA_FORMAT_444		0x00000003
Packit Service d3952c
Packit Service d3952c
/* XvMCSurfaceInfo Flags */
Packit Service d3952c
#define XVMC_OVERLAID_SURFACE			0x00000001
Packit Service d3952c
#define XVMC_BACKEND_SUBPICTURE			0x00000002
Packit Service d3952c
#define XVMC_SUBPICTURE_INDEPENDENT_SCALING	0x00000004
Packit Service d3952c
#define XVMC_INTRA_UNSIGNED                     0x00000008
Packit Service d3952c
Packit Service d3952c
/* Motion Compensation types */
Packit Service d3952c
#define XVMC_MOCOMP			0x00000000
Packit Service d3952c
#define XVMC_IDCT			0x00010000
Packit Service d3952c
Packit Service d3952c
#define	XVMC_MPEG_1			0x00000001
Packit Service d3952c
#define XVMC_MPEG_2			0x00000002
Packit Service d3952c
#define XVMC_H263			0x00000003
Packit Service d3952c
#define XVMC_MPEG_4			0x00000004
Packit Service d3952c
Packit Service d3952c
Packit Service d3952c
typedef struct {
Packit Service d3952c
   int surface_type_id;
Packit Service d3952c
   int chroma_format;
Packit Service d3952c
   unsigned short max_width;
Packit Service d3952c
   unsigned short max_height;
Packit Service d3952c
   unsigned short subpicture_max_width;
Packit Service d3952c
   unsigned short subpicture_max_height;
Packit Service d3952c
   int mc_type;
Packit Service d3952c
   int flags;
Packit Service d3952c
} XvMCSurfaceInfo;
Packit Service d3952c
Packit Service d3952c
   surface_type_id - Unique descriptor for this surface type.
Packit Service d3952c
Packit Service d3952c
   chroma_format - Chroma format of this surface (eg. XVMC_CHROMA_FORMAT_420,
Packit Service d3952c
		XVMC_CHROMA_FORMAT_422, XVMC_CHROMA_FORMAT_444).
Packit Service d3952c
Packit Service d3952c
   max_width -
Packit Service d3952c
   max_height -  Maximum dimensions of the luma data in pixels.
Packit Service d3952c
Packit Service d3952c
   subpicture_max_width -
Packit Service d3952c
   subpicture_max_height -  The Maximum dimensions of the subpicture
Packit Service d3952c
                            that can be created for use with this surface
Packit Service d3952c
                            Both fields are zero if subpictures are not
Packit Service d3952c
                            supported.
Packit Service d3952c
Packit Service d3952c
   mc_type -  The type of motion compensation available for this
Packit Service d3952c
              surface.  This consists of XVMC_MPEG_1, XVMC_MPEG_2, XVMC_H263
Packit Service d3952c
              or XVMC_MPEG_4 OR'd together with any of the following:
Packit Service d3952c
Packit Service d3952c
                 XVMC_MOCOMP - Acceleration starts at the motion compensation
Packit Service d3952c
                               level;
Packit Service d3952c
Packit Service d3952c
                 XVMC_IDCT - Acceleration starts at the IDCT level.
Packit Service d3952c
Packit Service d3952c
   flags -  Any combination of the following may be OR'd together.
Packit Service d3952c
Packit Service d3952c
	XVMC_OVERLAID_SURFACE - Displayed data is overlaid and not
Packit Service d3952c
	                        physically in the visible framebuffer.
Packit Service d3952c
                                When this is set the client is responsible
Packit Service d3952c
                                for painting the colorkey.
Packit Service d3952c
Packit Service d3952c
	XVMC_BACKEND_SUBPICTURE - The supicture is of the "backend"
Packit Service d3952c
                                  variety.  It is "frontend" otherwise.
Packit Service d3952c
                                  There is more information on this in the
Packit Service d3952c
                                  section on subpictures below.
Packit Service d3952c
Packit Service d3952c
	XVMC_SUBPICTURE_INDEPENDENT_SCALING - The subpicture can be scaled
Packit Service d3952c
                                              independently of the video
Packit Service d3952c
                                              surface.  See the section on
Packit Service d3952c
                                              subpictures below.
Packit Service d3952c
Packit Service d3952c
        XVMC_INTRA_UNSIGNED - When this flag is set, the motion compenstation
Packit Service d3952c
                              level Intra macroblock data should be in an
Packit Service d3952c
                              unsigned format rather than the signed format
Packit Service d3952c
                              present in the mpeg stream.  This flag applies
Packit Service d3952c
                              only to motion compensation level acceleration.
Packit Service d3952c
Packit Service d3952c
XvMCSurfaceInfo * XvMCListSurfaceTypes(Display *dpy, XvPortID port, int *num)
Packit Service d3952c
Packit Service d3952c
   Returns the number of surface types supported by the XvPort and an array
Packit Service d3952c
   of XvMCSurfaceInfo describing each surface type.  The returned array
Packit Service d3952c
   should be freed with XFree().
Packit Service d3952c
Packit Service d3952c
   dpy -  The connection to the server.
Packit Service d3952c
Packit Service d3952c
   port - The port we want to get the XvMCSurfaceInfo array for.
Packit Service d3952c
Packit Service d3952c
   num  - The number of elements returned in the array.
Packit Service d3952c
Packit Service d3952c
   Errors:
Packit Service d3952c
Packit Service d3952c
      XvBadPort -  The requested port does not exist.
Packit Service d3952c
Packit Service d3952c
      BadAlloc - There are insufficient resources to complete this request.
Packit Service d3952c
Packit Service d3952c
Packit Service d3952c
/********************************************************************/
Packit Service d3952c
Packit Service d3952c
          CREATING A CONTEXT
Packit Service d3952c
Packit Service d3952c
/********************************************************************/
Packit Service d3952c
Packit Service d3952c
/* XvMCContext flags */
Packit Service d3952c
#define XVMC_DIRECT			0x00000001
Packit Service d3952c
Packit Service d3952c
typedef struct {
Packit Service d3952c
   XID context_id;
Packit Service d3952c
   int surface_type_id;
Packit Service d3952c
   unsigned short width;
Packit Service d3952c
   unsigned short height;
Packit Service d3952c
   XVPortID port;
Packit Service d3952c
   int flags;
Packit Service d3952c
   void * privData;  /* private to the library */
Packit Service d3952c
} XvMCContext;
Packit Service d3952c
Packit Service d3952c
   context_id - An XID associated with the context.
Packit Service d3952c
Packit Service d3952c
   surface_type_id - This refers to the XvMCSurfaceInfo that describes
Packit Service d3952c
                     the surface characteristics.
Packit Service d3952c
Packit Service d3952c
   width -
Packit Service d3952c
   height -  The dimensions (of the luma data) this context supports.
Packit Service d3952c
Packit Service d3952c
   port -  The port that this context supports.
Packit Service d3952c
Packit Service d3952c
   flags -  Any combination may be OR'd together.
Packit Service d3952c
Packit Service d3952c
	XVMC_DIRECT -  This context is direct rendered.
Packit Service d3952c
Packit Service d3952c
Packit Service d3952c
Status XvMCCreateContext (
Packit Service d3952c
   Display display,
Packit Service d3952c
   XVPortID port,
Packit Service d3952c
   int surface_type_id,
Packit Service d3952c
   int width,
Packit Service d3952c
   int height,
Packit Service d3952c
   int flags,
Packit Service d3952c
   XvMCContext * context
Packit Service d3952c
);
Packit Service d3952c
Packit Service d3952c
   This creates a context by filling out the XvMCContext structure passed
Packit Service d3952c
   to it and returning Success.
Packit Service d3952c
Packit Service d3952c
   display -  Specifies the connection to the server.
Packit Service d3952c
Packit Service d3952c
   port -  Specifies the port to create the context for.
Packit Service d3952c
Packit Service d3952c
   surface_type_id -
Packit Service d3952c
   width -
Packit Service d3952c
   height -  Specifies the surface type and dimensions that this
Packit Service d3952c
             context will be used for.  The surface_type_id corresponds
Packit Service d3952c
             to the surface_type_id referenced by the XvMCSurfaceInfo.
Packit Service d3952c
	     The surface returned may be larger than the surface requested
Packit Service d3952c
             (usually the next larger multiple of 16x16 pixels).
Packit Service d3952c
Packit Service d3952c
   flags -  Any of the following may by OR'd together:
Packit Service d3952c
Packit Service d3952c
	 XVMC_DIRECT -  A direct context is requested.
Packit Service d3952c
                        If a direct context cannot be created the request
Packit Service d3952c
                        will not fail, rather, an indirect context will
Packit Service d3952c
			be created instead.
Packit Service d3952c
Packit Service d3952c
   context - Pointer to the pre-allocated XvMCContext structure.
Packit Service d3952c
Packit Service d3952c
Packit Service d3952c
Packit Service d3952c
   Errors:
Packit Service d3952c
Packit Service d3952c
      XvBadPort -  The requested port does not exist.
Packit Service d3952c
Packit Service d3952c
      BadValue -  The dimensions requested are not supported by the
Packit Service d3952c
                  surface type.
Packit Service d3952c
Packit Service d3952c
      BadMatch -  The surface_type_id is not supported by the port.
Packit Service d3952c
Packit Service d3952c
      BadAlloc -  There are not sufficient resources to fulfill this
Packit Service d3952c
                  request.
Packit Service d3952c
Packit Service d3952c
Packit Service d3952c
Status XvMCDestroyContext (Display display, XvMCContext * context)
Packit Service d3952c
Packit Service d3952c
     Destroys the specified context.
Packit Service d3952c
Packit Service d3952c
      display - Specifies the connection to the server.
Packit Service d3952c
Packit Service d3952c
      context - The context to be destroyed.
Packit Service d3952c
Packit Service d3952c
     Errors:
Packit Service d3952c
Packit Service d3952c
       XvMCBadContext - The XvMCContext is not valid.
Packit Service d3952c
Packit Service d3952c
Packit Service d3952c
/*********************************************************************/
Packit Service d3952c
Packit Service d3952c
          SURFACE CREATION
Packit Service d3952c
Packit Service d3952c
/*********************************************************************/
Packit Service d3952c
Packit Service d3952c
typedef struct {
Packit Service d3952c
  XID surface_id;
Packit Service d3952c
  XID context_id;
Packit Service d3952c
  int surface_type_id;
Packit Service d3952c
  unsigned short width;
Packit Service d3952c
  unsigned short height;
Packit Service d3952c
  void *privData;  /* private to the library */
Packit Service d3952c
} XvMCSurface;
Packit Service d3952c
Packit Service d3952c
  surface_id -  An XID associated with the surface.
Packit Service d3952c
Packit Service d3952c
  context_id -  The XID of the context for which the surface was created.
Packit Service d3952c
Packit Service d3952c
  surface_type_id - Derived from the context_id, it specifies the
Packit Service d3952c
                    XvMCSurfaceInfo describing the surface.
Packit Service d3952c
Packit Service d3952c
  width -
Packit Service d3952c
  height -  The width and height of the luma data.
Packit Service d3952c
Packit Service d3952c
Packit Service d3952c
Status
Packit Service d3952c
XvMCCreateSurface(
Packit Service d3952c
  Display *display,
Packit Service d3952c
  XvMCContext * context;
Packit Service d3952c
  XvMCSurface * surface;
Packit Service d3952c
);
Packit Service d3952c
Packit Service d3952c
     Creates a surface (Frame) for use with the specified context.
Packit Service d3952c
   The surface structure is filled out and Success is returned if no
Packit Service d3952c
   error occured.
Packit Service d3952c
Packit Service d3952c
   context - pointer to a valid context.  The context implies
Packit Service d3952c
             the surface type to be created, and its dimensions.
Packit Service d3952c
Packit Service d3952c
   surface - pointer to a pre-allocated XvMCSurface structure.
Packit Service d3952c
Packit Service d3952c
   Errors:
Packit Service d3952c
Packit Service d3952c
	XvMCBadContext - the context is not valid.
Packit Service d3952c
Packit Service d3952c
        BadAlloc - there are insufficient resources to complete
Packit Service d3952c
                   this operation.
Packit Service d3952c
Packit Service d3952c
Status XvMCDestroySurface(Display *display, XvMCSurface *surface);
Packit Service d3952c
Packit Service d3952c
   Destroys the given surface.
Packit Service d3952c
Packit Service d3952c
    display - Specifies the connection to the server.
Packit Service d3952c
Packit Service d3952c
    surface - The surface to be destroyed.
Packit Service d3952c
Packit Service d3952c
    Errors:
Packit Service d3952c
Packit Service d3952c
       XvMCBadSurface - The XvMCSurface is not valid.
Packit Service d3952c
Packit Service d3952c
Packit Service d3952c
Packit Service d3952c
/*********************************************************************/
Packit Service d3952c
Packit Service d3952c
    RENDERING A FRAME
Packit Service d3952c
Packit Service d3952c
/*********************************************************************/
Packit Service d3952c
Packit Service d3952c
typedef struct {
Packit Service d3952c
  XID context_id;
Packit Service d3952c
  unsigned int num_blocks;
Packit Service d3952c
  short *blocks;
Packit Service d3952c
  void *privData;	/* private to the library */
Packit Service d3952c
} XvMCBlockArray;
Packit Service d3952c
Packit Service d3952c
   num_blocks - Number of 64 element blocks in the blocks array.
Packit Service d3952c
Packit Service d3952c
   context_id - XID of the context these blocks were allocated for.
Packit Service d3952c
Packit Service d3952c
   blocks -  Pointer to an array of (64 * num_blocks) shorts.
Packit Service d3952c
Packit Service d3952c
Status XvMCCreateBlocks (
Packit Service d3952c
    Display *display,
Packit Service d3952c
    XvMCContext *context,
Packit Service d3952c
    unsigned int num_blocks,
Packit Service d3952c
    XvMCBlockArray * block
Packit Service d3952c
);
Packit Service d3952c
Packit Service d3952c
   This allocates an array of DCT blocks in the XvMCBlockArray
Packit Service d3952c
   structure passed to it.  Success is returned if no error occured.
Packit Service d3952c
Packit Service d3952c
    display - The connection to the server.
Packit Service d3952c
Packit Service d3952c
    context -  The context the block array is being created for.
Packit Service d3952c
Packit Service d3952c
    num_blocks - The number of 64 element short blocks to be allocated.
Packit Service d3952c
                 This number must be non-zero.
Packit Service d3952c
Packit Service d3952c
    block -  A pointer to a pre-allocated XvMCBlockArray structure.
Packit Service d3952c
Packit Service d3952c
      Errors:
Packit Service d3952c
Packit Service d3952c
	  XvMCBadContext - the context is invalid.
Packit Service d3952c
Packit Service d3952c
          BadAlloc -  There are insufficient resources to complete the
Packit Service d3952c
                      operation.
Packit Service d3952c
Packit Service d3952c
          BadValue -  num_blocks was zero.
Packit Service d3952c
Packit Service d3952c
Status XvMCDestroyBlocks (Display *display, XvMCBlockArray * block)
Packit Service d3952c
Packit Service d3952c
   Frees the given array.
Packit Service d3952c
Packit Service d3952c
     display -  The connection to the server.
Packit Service d3952c
Packit Service d3952c
     block - The block array to be freed.
Packit Service d3952c
Packit Service d3952c
Packit Service d3952c
   ----------------------------------------------------------
Packit Service d3952c
Packit Service d3952c
#define XVMC_MB_TYPE_MOTION_FORWARD	0x02
Packit Service d3952c
#define XVMC_MB_TYPE_MOTION_BACKWARD	0x04
Packit Service d3952c
#define XVMC_MB_TYPE_PATTERN		0x08
Packit Service d3952c
#define XVMC_MB_TYPE_INTRA		0x10
Packit Service d3952c
Packit Service d3952c
#define XVMC_PREDICTION_FIELD		0x01
Packit Service d3952c
#define XVMC_PREDICTION_FRAME		0x02
Packit Service d3952c
#define XVMC_PREDICTION_DUAL_PRIME	0x03
Packit Service d3952c
#define XVMC_PREDICTION_16x8		0x02
Packit Service d3952c
#define XVMC_PREDICTION_4MV		0x04
Packit Service d3952c
Packit Service d3952c
#define XVMC_SELECT_FIRST_FORWARD	0x01
Packit Service d3952c
#define XVMC_SELECT_FIRST_BACKWARD	0x02
Packit Service d3952c
#define XVMC_SELECT_SECOND_FORWARD	0x04
Packit Service d3952c
#define XVMC_SELECT_SECOND_BACKWARD	0x08
Packit Service d3952c
Packit Service d3952c
#define XVMC_DCT_TYPE_FRAME		0x00
Packit Service d3952c
#define XVMC_DCT_TYPE_FIELD		0x01
Packit Service d3952c
Packit Service d3952c
typedef struct {
Packit Service d3952c
   unsigned short x;
Packit Service d3952c
   unsigned short y;
Packit Service d3952c
   unsigned char macroblock_type;
Packit Service d3952c
   unsigned char motion_type;
Packit Service d3952c
   unsigned char motion_vertical_field_select;
Packit Service d3952c
   unsigned char dct_type;
Packit Service d3952c
   short PMV[2][2][2];
Packit Service d3952c
   unsigned int index;
Packit Service d3952c
   unsigned short coded_block_pattern;
Packit Service d3952c
   unsigned short pad0;
Packit Service d3952c
} XvMCMacroBlock;
Packit Service d3952c
Packit Service d3952c
    x, y -  location of the macroblock on the surface in units of macroblocks.
Packit Service d3952c
Packit Service d3952c
    macroblock_type - can be any of the following flags OR'd together:
Packit Service d3952c
Packit Service d3952c
	XVMC_MB_TYPE_MOTION_FORWARD - Forward motion prediction should
Packit Service d3952c
                                      be done.  This flag is ignored for
Packit Service d3952c
				      Intra frames.
Packit Service d3952c
Packit Service d3952c
	XVMC_MB_TYPE_MOTION_BACKWARD - Backward motion prediction should
Packit Service d3952c
                                       be done.  This flag is ignored when
Packit Service d3952c
				       the frame is not bidirectionally
Packit Service d3952c
                                       predicted.
Packit Service d3952c
Packit Service d3952c
        XVMC_MB_TYPE_PATTERN -  Blocks are referenced and they contain
Packit Service d3952c
                                differentials.  The coded_block_pattern will
Packit Service d3952c
                                indicate the number of blocks and index will
Packit Service d3952c
                                note their locations in the block array.
Packit Service d3952c
Packit Service d3952c
	XVMC_MB_TYPE_INTRA -  Blocks are referenced and they are intra blocks.
Packit Service d3952c
                              The coded_block_pattern will indicate the number
Packit Service d3952c
                              of blocks and index will note their locations in
Packit Service d3952c
                              the block array.  XVMC_MB_TYPE_PATTERN and
Packit Service d3952c
                              XVMC_MB_TYPE_INTRA are mutually exclusive.  If
Packit Service d3952c
                              both are specified, XVMC_MB_TYPE_INTRA takes
Packit Service d3952c
                              precedence.
Packit Service d3952c
Packit Service d3952c
    motion_type -  If the surface is a field, the following are valid:
Packit Service d3952c
			XVMC_PREDICTION_FIELD
Packit Service d3952c
			XVMC_PREDICTION_16x8
Packit Service d3952c
			XVMC_PREDICTION_DUAL_PRIME
Packit Service d3952c
		   If the surface is a frame, the following are valid:
Packit Service d3952c
			XVMC_PREDICTION_FIELD
Packit Service d3952c
			XVMC_PREDICTION_FRAME
Packit Service d3952c
			XVMC_PREDICTION_DUAL_PRIME
Packit Service d3952c
Packit Service d3952c
    motion_vertical_field_select - The following flags may be OR'd together
Packit Service d3952c
Packit Service d3952c
		XVMC_SELECT_FIRST_FORWARD
Packit Service d3952c
		XVMC_SELECT_FIRST_BACKWARD
Packit Service d3952c
		XVMC_SELECT_SECOND_FORWARD
Packit Service d3952c
		XVMC_SELECT_SECOND_BACKWARD
Packit Service d3952c
Packit Service d3952c
              If the bit is set the bottom field is indicated.
Packit Service d3952c
              If the bit is clear the top field is indicated.
Packit Service d3952c
Packit Service d3952c
              X X X X D C B A
Packit Service d3952c
              ------- | | | |_  First vector forward
Packit Service d3952c
                |     | | |___  First vector backward
Packit Service d3952c
              unused  | |_____ Second vector forward
Packit Service d3952c
                      |_______ Second vector backward
Packit Service d3952c
Packit Service d3952c
    PMV -  The motion vector(s)
Packit Service d3952c
Packit Service d3952c
               PMV[c][b][a]
Packit Service d3952c
Packit Service d3952c
                  a - This holds the vector. 0 = horizontal, 1 = vertical.
Packit Service d3952c
                  b - 0 = forward, 1 = backward.
Packit Service d3952c
                  c - 0 = first vector, 1 = second vector.
Packit Service d3952c
Packit Service d3952c
	    The motion vectors are used only when XVMC_MB_TYPE_MOTION_FORWARD
Packit Service d3952c
            or XVMC_MB_TYPE_MOTION_BACKWARD are set.
Packit Service d3952c
Packit Service d3952c
            DualPrime vectors must be fully decoded and placed in the PMV
Packit Service d3952c
            array as follows.
Packit Service d3952c
Packit Service d3952c
            Field structure:
Packit Service d3952c
Packit Service d3952c
                PMV[0][0][1:0]  from same parity
Packit Service d3952c
                PMV[0][1][1:0]  from opposite parity
Packit Service d3952c
Packit Service d3952c
            Frame structure:
Packit Service d3952c
Packit Service d3952c
                PMV[0][0][1:0]  top from top
Packit Service d3952c
                PMV[0][1][1:0]  bottom from bottom
Packit Service d3952c
                PMV[1][0][1:0]  top from bottom
Packit Service d3952c
                PMV[1][1][1:0]  bottom from top
Packit Service d3952c
Packit Service d3952c
Packit Service d3952c
    index -  The offset in units of (64 * sizeof(short)) from the start of
Packit Service d3952c
             the block array where this macroblock's DCT blocks, as indicated
Packit Service d3952c
             by the coded_block_pattern, are stored.
Packit Service d3952c
Packit Service d3952c
    coded_block_pattern - Indicates the blocks to be updated.  The bitplanes
Packit Service d3952c
                          are specific to the mc_type of the surface.  This
Packit Service d3952c
                          field is valid only if XVMC_MB_TYPE_PATTERN or
Packit Service d3952c
                          XVMC_MB_TYPE_INTRA are set.  In that case the blocks
Packit Service d3952c
                          are differential or intra blocks respectively.
Packit Service d3952c
			  The bitplanes are described in ISO/IEC 13818-2
Packit Service d3952c
			  Figures 6.10-12.
Packit Service d3952c
Packit Service d3952c
    dct_type -  This field indicates whether frame pictures are frame DCT
Packit Service d3952c
                coded or field DCT coded. ie XVMC_DCT_TYPE_FIELD or
Packit Service d3952c
                XVMC_DCT_TYPE_FRAME.
Packit Service d3952c
Packit Service d3952c
Packit Service d3952c
typedef struct {
Packit Service d3952c
  unsigned int num_blocks;
Packit Service d3952c
  XID context_id;
Packit Service d3952c
  XvMCMacroBlock *macro_blocks;
Packit Service d3952c
  void *privData;	/* private to the library */
Packit Service d3952c
} XvMCMacroBlockArray;
Packit Service d3952c
Packit Service d3952c
Packit Service d3952c
   num_blocks - Number of XvMCMacroBlocks in the macro_blocks array.
Packit Service d3952c
Packit Service d3952c
   context_id - XID of the context these macroblocks were allocated for.
Packit Service d3952c
Packit Service d3952c
   macro_blocks -  Pointer to an array of num_blocks XvMCMacroBlocks.
Packit Service d3952c
Packit Service d3952c
Packit Service d3952c
Status XvMCCreateMacroBlocks (
Packit Service d3952c
    Display *display,
Packit Service d3952c
    XvMCContext *context,
Packit Service d3952c
    unsigned int num_blocks,
Packit Service d3952c
    XvMCMacroBlockArray * blocks
Packit Service d3952c
);
Packit Service d3952c
Packit Service d3952c
   This allocates an array of XvMCMacroBlocks in the XvMCMacroBlockArray
Packit Service d3952c
   structure passed to it.  Success is returned if no error occured.
Packit Service d3952c
Packit Service d3952c
    display - The connection to the server.
Packit Service d3952c
Packit Service d3952c
    context -  The context the macroblock array is being created for.
Packit Service d3952c
Packit Service d3952c
    num_blocks - The number of XvMCMacroBlocks to be allocated.
Packit Service d3952c
                 This number must be non-zero.
Packit Service d3952c
Packit Service d3952c
    blocks -  A pointer to a pre-allocated XvMCMacroBlockArray structure.
Packit Service d3952c
Packit Service d3952c
      Errors:
Packit Service d3952c
Packit Service d3952c
	  XvMCBadContext - the context is invalid.
Packit Service d3952c
Packit Service d3952c
          BadAlloc -  There are insufficient resources to complete the
Packit Service d3952c
                      operation.
Packit Service d3952c
Packit Service d3952c
          BadValue -  num_blocks was zero.
Packit Service d3952c
Packit Service d3952c
Status XvMCDestroyMacroBlocks (Display *display, XvMCMacroBlockArray * block)
Packit Service d3952c
Packit Service d3952c
   Frees the given array.
Packit Service d3952c
Packit Service d3952c
    display - The connection to the server.
Packit Service d3952c
Packit Service d3952c
    block -  The macro block array to be freed.
Packit Service d3952c
Packit Service d3952c
Packit Service d3952c
    ------------------------------------------------------------
Packit Service d3952c
Packit Service d3952c
#define XVMC_TOP_FIELD		0x00000001
Packit Service d3952c
#define XVMC_BOTTOM_FIELD	0x00000002
Packit Service d3952c
#define XVMC_FRAME_PICTURE	(XVMC_TOP_FIELD | XVMC_BOTTOM_FIELD)
Packit Service d3952c
Packit Service d3952c
#define XVMC_SECOND_FIELD       0x00000004
Packit Service d3952c
Packit Service d3952c
Status XvMCRenderSurface(
Packit Service d3952c
    Display *display,
Packit Service d3952c
    XvMCContext *context,
Packit Service d3952c
    unsigned int picture_structure,
Packit Service d3952c
    Surface *target_surface,
Packit Service d3952c
    Surface *past_surface,
Packit Service d3952c
    Surface *future_surface,
Packit Service d3952c
    unsigned int flags,
Packit Service d3952c
    unsigned int num_macroblocks,
Packit Service d3952c
    unsigned int first_macroblock,
Packit Service d3952c
    XvMCMacroBlockArray *macroblock_array,
Packit Service d3952c
    XvMCBlockArray *blocks
Packit Service d3952c
);
Packit Service d3952c
Packit Service d3952c
    This function renders the macroblocks passed to it.  It will not
Packit Service d3952c
    return until it has read all of the macroblocks, however, rendering
Packit Service d3952c
    will usually not be completed by that time.  The return of this
Packit Service d3952c
    function means it is safe to touch the blocks and macroblock_array.
Packit Service d3952c
    To synchronize rendering see the section on sychronization below.
Packit Service d3952c
Packit Service d3952c
    display - The connection to the server.
Packit Service d3952c
Packit Service d3952c
    context - The context used to render.
Packit Service d3952c
Packit Service d3952c
    target_surface -
Packit Service d3952c
    past_surface -
Packit Service d3952c
    furture_surface -
Packit Service d3952c
Packit Service d3952c
        The target_surface is required.  If the future and past
Packit Service d3952c
      surfaces are NULL, the target_surface is an "Intra" frame.
Packit Service d3952c
Packit Service d3952c
      	If the past surface is provided but not the future surface,
Packit Service d3952c
      the target_surface is a "Predicted Inter" frame.
Packit Service d3952c
Packit Service d3952c
	If both past and future surfaces are provided, the
Packit Service d3952c
      target_surface is a "Bidirectionally-predicted Inter" frame.
Packit Service d3952c
Packit Service d3952c
        Specifying a future surface without a past surface results
Packit Service d3952c
      in a BadMatch.
Packit Service d3952c
Packit Service d3952c
      All surfaces must belong to the same context.
Packit Service d3952c
Packit Service d3952c
    picture_structure - XVMC_TOP_FIELD, XVMC_BOTTOM_FIELD or
Packit Service d3952c
                        XVMC_FRAME_PICTURE.
Packit Service d3952c
Packit Service d3952c
Packit Service d3952c
    flags -  Flags may include:
Packit Service d3952c
Packit Service d3952c
            XVMC_SECOND_FIELD - For field pictures this indicates whether
Packit Service d3952c
                                the current field (top or bottom) is first
Packit Service d3952c
                                or second in the sequence.
Packit Service d3952c
Packit Service d3952c
    num_macroblocks -  The number of XvMCMacroBlock structures to execute in
Packit Service d3952c
                       the macroblock_array.
Packit Service d3952c
Packit Service d3952c
    first_macroblock - The index of the first XvMCMacroBlock to process in the
Packit Service d3952c
                       macroblock_array.
Packit Service d3952c
Packit Service d3952c
    blocks - The array of XvMCBlocks to be referenced by the XvMCMacroBlocks.
Packit Service d3952c
             The data in the individual blocks are in raster scan order and
Packit Service d3952c
             should be clamped to the limits specific to the acceleration
Packit Service d3952c
             level.  For motion compensation level acceleration this is 8
Packit Service d3952c
             bits for Intra and 9 bits for non-Intra data.  At the IDCT level
Packit Service d3952c
             this is 12 bits.
Packit Service d3952c
Packit Service d3952c
  Errors:
Packit Service d3952c
Packit Service d3952c
        XvMCBadContext - The context is not valid.
Packit Service d3952c
Packit Service d3952c
        XvMCBadSurface - Any of the surfaces are not valid.
Packit Service d3952c
Packit Service d3952c
	BadMatch - Any of the surfaces do not belong to the specified
Packit Service d3952c
                   context or a future surface was specified without
Packit Service d3952c
                   a past surface.
Packit Service d3952c
Packit Service d3952c
        BadValue - Unrecognized data for the picture_structure.
Packit Service d3952c
Packit Service d3952c
Packit Service d3952c
/***********************************************************************/
Packit Service d3952c
Packit Service d3952c
     DISPLAYING THE SURFACE
Packit Service d3952c
Packit Service d3952c
/***********************************************************************/
Packit Service d3952c
Packit Service d3952c
Packit Service d3952c
Status
Packit Service d3952c
XvMCPutSurface(
Packit Service d3952c
  Display *display,
Packit Service d3952c
  XvMCSurface *surface,
Packit Service d3952c
  Drawable draw,
Packit Service d3952c
  short srcx,
Packit Service d3952c
  short srcy,
Packit Service d3952c
  unsigned short srcw,
Packit Service d3952c
  unsigned short srch,
Packit Service d3952c
  short destx,
Packit Service d3952c
  short desty,
Packit Service d3952c
  unsigned short destw,
Packit Service d3952c
  unsigned short desth,
Packit Service d3952c
  int flags
Packit Service d3952c
);
Packit Service d3952c
Packit Service d3952c
   Display the rectangle from the source defined by srcx/y/w/h scaled
Packit Service d3952c
 to destw by desth and placed at (destx, desty) on the given drawable.
Packit Service d3952c
 This function is not guaranteed to be pipelined with previous rendering
Packit Service d3952c
 commands and may display the surface immediately.  Therefore, the client
Packit Service d3952c
 must query that the surface has finished rendering before calling this
Packit Service d3952c
 function.
Packit Service d3952c
Packit Service d3952c
    display - The connection to the server.
Packit Service d3952c
Packit Service d3952c
    surface - The surface to copy/overlay from.
Packit Service d3952c
Packit Service d3952c
    draw - The drawable to copy/overlay the video on.
Packit Service d3952c
Packit Service d3952c
    srcx -
Packit Service d3952c
    srcy -
Packit Service d3952c
    srcw -
Packit Service d3952c
    srch -  The rectangle in the source area from the surface that is
Packit Service d3952c
            to be displayed.
Packit Service d3952c
Packit Service d3952c
    destx -
Packit Service d3952c
    desty -
Packit Service d3952c
    destw -
Packit Service d3952c
    desth -  The rectangle in the destination drawable where the scaled
Packit Service d3952c
             source rectangle should be displayed.
Packit Service d3952c
Packit Service d3952c
    flags - this indicates the field to be displayed and can be XVMC_TOP_FIELD,
Packit Service d3952c
            XVMC_BOTTOM_FIELD or XVMC_FRAME_PICTURE.  XVMC_FRAME_PICTURE
Packit Service d3952c
            displays both fields (weave).
Packit Service d3952c
Packit Service d3952c
   Errors:
Packit Service d3952c
Packit Service d3952c
       XvMCBadSurface - The surface is not valid.
Packit Service d3952c
Packit Service d3952c
       BadDrawable -  The drawable does not exist.
Packit Service d3952c
Packit Service d3952c
Packit Service d3952c
Status XvMCHideSurface(Display *display, XvMCSurface *surface)
Packit Service d3952c
Packit Service d3952c
   Stops display of a surface.  This is only needed if the surface is an
Packit Service d3952c
   overlaid surface as indicated in the XvMCSurfaceInfo - it is a no-op
Packit Service d3952c
   otherwise.
Packit Service d3952c
Packit Service d3952c
     display - The connection to the server.
Packit Service d3952c
Packit Service d3952c
     surface - The surface to be hidden.
Packit Service d3952c
Packit Service d3952c
      Errors:
Packit Service d3952c
Packit Service d3952c
	  XvMCBadSurface - The surface is not valid.
Packit Service d3952c
Packit Service d3952c
Packit Service d3952c
/***********************************************************************/
Packit Service d3952c
Packit Service d3952c
     COMPOSITING THE SUBPICTURE
Packit Service d3952c
Packit Service d3952c
/***********************************************************************/
Packit Service d3952c
Packit Service d3952c
Packit Service d3952c
XvImageFormatValues * XvMCListSubpictureTypes (
Packit Service d3952c
  Display * display,
Packit Service d3952c
  XvPortID port,
Packit Service d3952c
  int surface_type_id,
Packit Service d3952c
  int *count_return
Packit Service d3952c
)
Packit Service d3952c
Packit Service d3952c
  Returns an array of XvImageFormatValues supported by the surface_type_id
Packit Service d3952c
  describing the surface. The surface_type_id is acquired from the
Packit Service d3952c
  XvMCSurfaceInfo.  This list should be freed with XFree().
Packit Service d3952c
Packit Service d3952c
   display - Specifies the connection to the X-server.
Packit Service d3952c
Packit Service d3952c
   port - Specifies the port we are interested in.
Packit Service d3952c
Packit Service d3952c
   surface_type_id - Specifies the surface type for which we want to
Packit Service d3952c
                     query the supported subpicture types.
Packit Service d3952c
Packit Service d3952c
   count_return - the size of the returned array.
Packit Service d3952c
Packit Service d3952c
   Errors:
Packit Service d3952c
Packit Service d3952c
      BadPort -  The port doesn't exist.
Packit Service d3952c
Packit Service d3952c
      BadAlloc - There are insufficient resources to complete this request.
Packit Service d3952c
Packit Service d3952c
      BadMatch - The surface type is not supported on that port.
Packit Service d3952c
Packit Service d3952c
Packit Service d3952c
typedef struct {
Packit Service d3952c
  XID subpicture_id;
Packit Service d3952c
  XID context_id;
Packit Service d3952c
  int xvimage_id;
Packit Service d3952c
  unsigned short width;
Packit Service d3952c
  unsigned short height;
Packit Service d3952c
  int num_palette_entries;
Packit Service d3952c
  int entry_bytes;
Packit Service d3952c
  char component_order[4];
Packit Service d3952c
  void *privData;    /* private to the library */
Packit Service d3952c
} XvMCSubpicture;
Packit Service d3952c
Packit Service d3952c
Packit Service d3952c
   subpicture_id - An XID associated with this subpicture.
Packit Service d3952c
Packit Service d3952c
   context_id - The XID of the context this subpicture was created for.
Packit Service d3952c
Packit Service d3952c
   xvimage_id - The id descriptor of the XvImage format that may be used
Packit Service d3952c
                with this subpicture.
Packit Service d3952c
Packit Service d3952c
   width -
Packit Service d3952c
   height - The dimensions of the subpicture.
Packit Service d3952c
Packit Service d3952c
   num_palette_entries - For paletted formats only.  This is the number
Packit Service d3952c
                         of palette entries.  It is zero for XvImages
Packit Service d3952c
                         without palettes.
Packit Service d3952c
Packit Service d3952c
   entry_bytes -  Each component is one byte and entry_bytes indicates
Packit Service d3952c
                  the number of components in each entry (eg. 3 for
Packit Service d3952c
                  YUV palette entries).  This field is zero when
Packit Service d3952c
                  palettes are not used.
Packit Service d3952c
Packit Service d3952c
   component_order - Is an array of ascii characters describing the order
Packit Service d3952c
                     of the components within the bytes.  Only entry_bytes
Packit Service d3952c
                     characters of the string are used.
Packit Service d3952c
Packit Service d3952c
Status
Packit Service d3952c
XvMCCreateSubpicture (
Packit Service d3952c
   Display *display,
Packit Service d3952c
   XvMCContext *context,
Packit Service d3952c
   XvMCSubpicture *subpicture,
Packit Service d3952c
   unsigned short width,
Packit Service d3952c
   unsigned short height,
Packit Service d3952c
   int xvimage_id
Packit Service d3952c
)
Packit Service d3952c
Packit Service d3952c
   This creates a subpicture by filling out the XvMCSubpicture structure
Packit Service d3952c
   passed to it and returning Success.
Packit Service d3952c
Packit Service d3952c
    display -  Specifies the connection to the X-Server.
Packit Service d3952c
Packit Service d3952c
    context -  The context to create the subpicture for.
Packit Service d3952c
Packit Service d3952c
    subpicture - Pre-allocated XvMCSubpicture structure to be filled
Packit Service d3952c
                 out by this function.
Packit Service d3952c
Packit Service d3952c
    width -
Packit Service d3952c
    height -  The dimensions of the subpicture.
Packit Service d3952c
Packit Service d3952c
    xvimage_id - The id describing the XvImage format.
Packit Service d3952c
Packit Service d3952c
Packit Service d3952c
    Errors:
Packit Service d3952c
Packit Service d3952c
      BadAlloc - There are insufficient resources to complete this request.
Packit Service d3952c
Packit Service d3952c
      XvMCBadContext - The specified context does not exist.
Packit Service d3952c
Packit Service d3952c
      BadMatch - The XvImage format id specified is not supported by
Packit Service d3952c
                 the context.
Packit Service d3952c
Packit Service d3952c
      BadValue - If the size requested is larger than the max size reported
Packit Service d3952c
                 in the XvMCSurfaceInfo.
Packit Service d3952c
Packit Service d3952c
Packit Service d3952c
Status
Packit Service d3952c
XvMCClearSubpicture (
Packit Service d3952c
  Display *display,
Packit Service d3952c
  XvMCSubpicture *subpicture,
Packit Service d3952c
  short x,
Packit Service d3952c
  short y,
Packit Service d3952c
  unsigned short width,
Packit Service d3952c
  unsigned short height,
Packit Service d3952c
  unsigned int color
Packit Service d3952c
)
Packit Service d3952c
Packit Service d3952c
    Clear the area of the given subpicture to "color".
Packit Service d3952c
Packit Service d3952c
    display - The connection to the server.
Packit Service d3952c
Packit Service d3952c
    subpicture - The subpicture to clear.
Packit Service d3952c
Packit Service d3952c
    x -
Packit Service d3952c
    y -
Packit Service d3952c
    width -
Packit Service d3952c
    height -  The rectangle in the subpicture to be cleared.
Packit Service d3952c
Packit Service d3952c
    color -  The data to fill the rectangle with.
Packit Service d3952c
Packit Service d3952c
    Errors:
Packit Service d3952c
Packit Service d3952c
       XvMCBadSubpicture - The subpicture is invalid.
Packit Service d3952c
Packit Service d3952c
Status
Packit Service d3952c
XvMCCompositeSubpicture (
Packit Service d3952c
   Display *display,
Packit Service d3952c
   XvMCSubpicture *subpicture,
Packit Service d3952c
   XvImage *image,
Packit Service d3952c
   short srcx,
Packit Service d3952c
   short srcy,
Packit Service d3952c
   unsigned short width,
Packit Service d3952c
   unsigned short height,
Packit Service d3952c
   short dstx,
Packit Service d3952c
   short dsty
Packit Service d3952c
)
Packit Service d3952c
Packit Service d3952c
    Copies the XvImage to the XvMCSubpicture.
Packit Service d3952c
Packit Service d3952c
    display -  The connection to the server.
Packit Service d3952c
Packit Service d3952c
    subpicture -  The subpicture used as the destination of the copy.
Packit Service d3952c
Packit Service d3952c
    image -  The XvImage to be used as the source of the copy.
Packit Service d3952c
             XvImages should be of the shared memory variety for
Packit Service d3952c
             indirect contexts.
Packit Service d3952c
Packit Service d3952c
    srcx -
Packit Service d3952c
    srcy -
Packit Service d3952c
    width -
Packit Service d3952c
    height -  The rectangle from the image to be composited.
Packit Service d3952c
Packit Service d3952c
    dstx -
Packit Service d3952c
    dsty -  The location in the subpicture where the source rectangle
Packit Service d3952c
            should be composited.
Packit Service d3952c
Packit Service d3952c
    Errors:
Packit Service d3952c
Packit Service d3952c
       XvMCBadSubpicture - The subpicture is invalid.
Packit Service d3952c
Packit Service d3952c
       BadMatch -  The subpicture does not support the type of XvImage
Packit Service d3952c
                   passed to this function.
Packit Service d3952c
Packit Service d3952c
Status
Packit Service d3952c
XvMCDestroySubpicture (Display *display, XvMCSubpicture *subpicture)
Packit Service d3952c
Packit Service d3952c
   Destroys the specified subpicture.
Packit Service d3952c
Packit Service d3952c
   display - Specifies the connection to the X-server.
Packit Service d3952c
Packit Service d3952c
   subpicture - The subpicture to be destroyed.
Packit Service d3952c
Packit Service d3952c
   Errors:
Packit Service d3952c
Packit Service d3952c
      XvMCBadSubpicture -  The subpicture specified does not exist.
Packit Service d3952c
Packit Service d3952c
Packit Service d3952c
Status
Packit Service d3952c
XvMCSetSubpicturePalette (
Packit Service d3952c
  Display *display,
Packit Service d3952c
  XvMCSubpicture *subpicture,
Packit Service d3952c
  unsigned char *palette
Packit Service d3952c
)
Packit Service d3952c
Packit Service d3952c
   Set the subpicture's palette.  This applies to paletted subpictures
Packit Service d3952c
   only.
Packit Service d3952c
Packit Service d3952c
    display -  The connection to the server.
Packit Service d3952c
Packit Service d3952c
    subpicture - The subpicture on which to change the palette.
Packit Service d3952c
Packit Service d3952c
    palette -  A pointer to an array holding the palette data.  The
Packit Service d3952c
               size of this array is
Packit Service d3952c
Packit Service d3952c
                   num_palette_entries * entry_bytes
Packit Service d3952c
Packit Service d3952c
               in size.  The order of the components in the palette
Packit Service d3952c
	       is described by the component_order in the XvMCSubpicture
Packit Service d3952c
               structure.
Packit Service d3952c
Packit Service d3952c
    Errors:
Packit Service d3952c
Packit Service d3952c
      XvMCBadSubpicture -  The subpicture specified does not exist.
Packit Service d3952c
Packit Service d3952c
      BadMatch -  The specified subpicture does not use palettes.
Packit Service d3952c
Packit Service d3952c
Packit Service d3952c
Status
Packit Service d3952c
XvMCBlendSubpicture (
Packit Service d3952c
   Display *display,
Packit Service d3952c
   XvMCSurface *target_surface,
Packit Service d3952c
   XvMCSubpicture *subpicture,
Packit Service d3952c
   short subx,
Packit Service d3952c
   short suby,
Packit Service d3952c
   unsigned short subw,
Packit Service d3952c
   unsigned short subh,
Packit Service d3952c
   short surfx,
Packit Service d3952c
   short surfy,
Packit Service d3952c
   unsigned short surfw,
Packit Service d3952c
   unsigned short surfh
Packit Service d3952c
)
Packit Service d3952c
Packit Service d3952c
Status
Packit Service d3952c
XvMCBlendSubpicture2 (
Packit Service d3952c
   Display *display,
Packit Service d3952c
   XvMCSurface *source_surface,
Packit Service d3952c
   XvMCSurface *target_surface,
Packit Service d3952c
   XvMCSubpicture *subpicture,
Packit Service d3952c
   short subx,
Packit Service d3952c
   short suby,
Packit Service d3952c
   unsigned short subw,
Packit Service d3952c
   unsigned short subh,
Packit Service d3952c
   short surfx,
Packit Service d3952c
   short surfy,
Packit Service d3952c
   unsigned short surfw,
Packit Service d3952c
   unsigned short surfh
Packit Service d3952c
)
Packit Service d3952c
Packit Service d3952c
   The behavior of these two functions is different depending on whether
Packit Service d3952c
or not the XVMC_BACKEND_SUBPICTURE flag is set in the XvMCSurfaceInfo.
Packit Service d3952c
Packit Service d3952c
 XVMC_BACKEND_SUBPICTURE set:
Packit Service d3952c
Packit Service d3952c
    XvMCBlendSubpicture associates the subpicture with the target_surface.
Packit Service d3952c
  Both will be displayed at the next call to XvMCPutSurface.  Additional
Packit Service d3952c
  blends before the call to XvMCPutSurface simply overrides the association.
Packit Service d3952c
  Both the target_surface and subpicture will query XVMC_DISPLAYING from
Packit Service d3952c
  the call to XvMCPutSurface until they are no longer displaying.  It is
Packit Service d3952c
  safe to associate the subpicture and target_surface before rendering has
Packit Service d3952c
  completed (while they still query XVMC_RENDERING) but it is not safe to
Packit Service d3952c
  call XvMCPutSurface at that time.
Packit Service d3952c
Packit Service d3952c
    XvMCBlendSubpicture2 copies the source_surface to the target_surface
Packit Service d3952c
  and associates the subpicture with the target_surface.  This essentially
Packit Service d3952c
  calls XvMCBlendSubpicture on the target_surface after the copy.  Both
Packit Service d3952c
  the subpicture and target_surface will query XVMC_DISPLAYING from the
Packit Service d3952c
  call to XvMCPutSurface until they are no longer displaying.  The
Packit Service d3952c
  source_surface will not query XVMC_DISPLAYING as a result of this function.
Packit Service d3952c
  The copy is pipelined with the rendering and will cause XVMC_RENDERING
Packit Service d3952c
  to be queried until the copy is done.
Packit Service d3952c
Packit Service d3952c
Packit Service d3952c
 XVMC_BACKEND_SUBPICTURE not set ("frontend" behavior):
Packit Service d3952c
Packit Service d3952c
    XvMCBlendSubpicture is a no-op in this case.
Packit Service d3952c
Packit Service d3952c
    XvMCBlendSubpicture2 blends the source_surface and subpicture and
Packit Service d3952c
  puts it in the target_surface.  This does not effect the status of
Packit Service d3952c
  the source surface but will cause the target_surface to query
Packit Service d3952c
  XVMC_RENDERING until the blend is completed.
Packit Service d3952c
Packit Service d3952c
Packit Service d3952c
  display - The connection to the server.
Packit Service d3952c
Packit Service d3952c
  subpicture - The subpicture to be blended into the video.
Packit Service d3952c
Packit Service d3952c
  target_surface - The surface to be displayed with the blended subpicture.
Packit Service d3952c
Packit Service d3952c
  source_surface - Source surface prior to blending.
Packit Service d3952c
Packit Service d3952c
  subx -
Packit Service d3952c
  suby -
Packit Service d3952c
  subw -
Packit Service d3952c
  subh -  The rectangle from the subpicture to be blended.
Packit Service d3952c
Packit Service d3952c
  surfx -
Packit Service d3952c
  surfy -
Packit Service d3952c
  surfw -
Packit Service d3952c
  surfh - The rectangle in the XvMCSurface to blend the subpicture rectangle
Packit Service d3952c
          into.  If XVMC_SUBPICTURE_INDEPENDENT_SCALING is not set in the
Packit Service d3952c
          XvMCSurfaceInfo subw must be equal to surfw and subh must be
Packit Service d3952c
          equal to surfh height or else a BadValue error occurs.
Packit Service d3952c
Packit Service d3952c
   Errors:
Packit Service d3952c
Packit Service d3952c
    XvMCBadSurface - Any of the surfaces are invalid.
Packit Service d3952c
Packit Service d3952c
    XvMCBadSubpicture - The subpicture is invalid.
Packit Service d3952c
Packit Service d3952c
    BadMatch - The subpicture or any of the surfaces do not belong to the
Packit Service d3952c
               same context.
Packit Service d3952c
Packit Service d3952c
    BadValue - XVMC_SUBPICTURE_INDEPENDENT_SCALING is set and the source
Packit Service d3952c
               and destination rectangles are different sizes.
Packit Service d3952c
Packit Service d3952c
Packit Service d3952c
/***********************************************************************/
Packit Service d3952c
Packit Service d3952c
     SURFACE SYNCHRONIZATION
Packit Service d3952c
Packit Service d3952c
/***********************************************************************/
Packit Service d3952c
Packit Service d3952c
Packit Service d3952c
#define XVMC_RENDERING		0x00000001
Packit Service d3952c
#define XVMC_DISPLAYING		0x00000002
Packit Service d3952c
Packit Service d3952c
Status
Packit Service d3952c
XvMCSyncSurface (Display *display, XvMCSurface *surface)
Packit Service d3952c
Packit Service d3952c
   This function blocks until all rendering requests on the surface
Packit Service d3952c
  have been completed.
Packit Service d3952c
Packit Service d3952c
     display - The connection to the server.
Packit Service d3952c
Packit Service d3952c
     surface - The surface to synchronize.
Packit Service d3952c
Packit Service d3952c
     Errors:
Packit Service d3952c
Packit Service d3952c
         XvMCBadSurface - The surface is not valid.
Packit Service d3952c
Packit Service d3952c
Packit Service d3952c
Status
Packit Service d3952c
XvMCFlushSurface (Display *display, XvMCSurface *surface)
Packit Service d3952c
Packit Service d3952c
   This function commits pending rendering requests to ensure that
Packit Service d3952c
  they will be completed in a finite amount of time.
Packit Service d3952c
Packit Service d3952c
    display -  The connnection to the server.
Packit Service d3952c
Packit Service d3952c
    surface -  The surface whos rendering requests should be flushed.
Packit Service d3952c
Packit Service d3952c
     Errors:
Packit Service d3952c
Packit Service d3952c
         XvMCBadSurface - The surface is not valid.
Packit Service d3952c
Packit Service d3952c
Packit Service d3952c
Status
Packit Service d3952c
XvMCGetSurfaceStatus (Display *display, XvMCSurface *surface, int *stat)
Packit Service d3952c
Packit Service d3952c
   display -  The connection to the server.
Packit Service d3952c
Packit Service d3952c
   surface -  The surface whos status is being queried.
Packit Service d3952c
Packit Service d3952c
   stat -  May be any of the following OR'd together:
Packit Service d3952c
Packit Service d3952c
   XVMC_RENDERING - The last XvMCRenderSurface request has not completed
Packit Service d3952c
                    yet.
Packit Service d3952c
Packit Service d3952c
   XVMC_DISPLAYING - The surface is currently being displayed or a
Packit Service d3952c
                     display is pending (ie. it is not safe to render
Packit Service d3952c
                     to it).
Packit Service d3952c
Packit Service d3952c
    Errors:
Packit Service d3952c
Packit Service d3952c
         XvMCBadSurface - The surface is not valid.
Packit Service d3952c
Packit Service d3952c
Packit Service d3952c
/***********************************************************************/
Packit Service d3952c
Packit Service d3952c
     SUBPICTURE SYNCHRONIZATION
Packit Service d3952c
Packit Service d3952c
/***********************************************************************/
Packit Service d3952c
Packit Service d3952c
Packit Service d3952c
Packit Service d3952c
Status
Packit Service d3952c
XvMCSyncSubpicture (Display *display, XvMCSubpicture *subpicture)
Packit Service d3952c
Packit Service d3952c
   This function blocks until all composite/clear requests on the supicture
Packit Service d3952c
  have been completed.
Packit Service d3952c
Packit Service d3952c
     display - The connection to the server.
Packit Service d3952c
Packit Service d3952c
     subpicture -  The subpicture to synchronize.
Packit Service d3952c
Packit Service d3952c
     Errors:
Packit Service d3952c
Packit Service d3952c
         XvMCBadSubpicture - The subpicture is not valid.
Packit Service d3952c
Packit Service d3952c
Packit Service d3952c
Status
Packit Service d3952c
XvMCFlushSubpicture (Display *display, XvMCSubpicture *subpicture)
Packit Service d3952c
Packit Service d3952c
   This function commits pending composite/clear requests to ensure that
Packit Service d3952c
  they will be completed in a finite amount of time.
Packit Service d3952c
Packit Service d3952c
    display - The connection to the server.
Packit Service d3952c
Packit Service d3952c
    subpicture - The subpicture whos compositing should be flushed.
Packit Service d3952c
Packit Service d3952c
     Errors:
Packit Service d3952c
Packit Service d3952c
         XvMCBadSubpicture - The surface is not valid.
Packit Service d3952c
Packit Service d3952c
Packit Service d3952c
Status
Packit Service d3952c
XvMCGetSubpictureStatus (Display *display, XvMCSubpicture *subpic, int *stat)
Packit Service d3952c
Packit Service d3952c
    display - The connection to the server.
Packit Service d3952c
Packit Service d3952c
    subpic - The subpicture whos status is being queried.
Packit Service d3952c
Packit Service d3952c
    stat - may be any of the following OR'd together:
Packit Service d3952c
Packit Service d3952c
   XVMC_RENDERING - The last XvMCCompositeSubpicture or XvMCClearSubpicture
Packit Service d3952c
                    request has not completed yet.
Packit Service d3952c
Packit Service d3952c
   XVMC_DISPLAYING - The subpicture is currently being displayed or a
Packit Service d3952c
                     display is pending (ie. it is not safe to render
Packit Service d3952c
                     to it).
Packit Service d3952c
Packit Service d3952c
     Errors:
Packit Service d3952c
Packit Service d3952c
         XvMCBadSubpicture - The surface is not valid.
Packit Service d3952c
Packit Service d3952c
/********************************************************************/
Packit Service d3952c
Packit Service d3952c
     ATTRIBUTES
Packit Service d3952c
Packit Service d3952c
/********************************************************************/
Packit Service d3952c
Packit Service d3952c
   Context specific attribute functions are provided.  These are
Packit Service d3952c
similar to their Xv Counterparts XvQueryPortAttributes, XvSetPortAttribute
Packit Service d3952c
and XvGetPortAttribute but their state is specific to the context.
Packit Service d3952c
Packit Service d3952c
XvAttribute *
Packit Service d3952c
XvMCQueryAttributes (
Packit Service d3952c
    Display *display,
Packit Service d3952c
    XvMCContext *context,
Packit Service d3952c
    int *number
Packit Service d3952c
)
Packit Service d3952c
Packit Service d3952c
    An array of XvAttributes of size "number" is returned by this function.
Packit Service d3952c
  If there are no attributes, NULL is returned and number is set to 0.
Packit Service d3952c
  The array may be freed with XFree().
Packit Service d3952c
Packit Service d3952c
    display - The connection to the server.
Packit Service d3952c
Packit Service d3952c
    context - The context whos attributes we are querying.
Packit Service d3952c
Packit Service d3952c
    number - The returned number of recognized atoms.
Packit Service d3952c
Packit Service d3952c
    Errors:
Packit Service d3952c
Packit Service d3952c
	XvMCBadContext - The context is invalid.
Packit Service d3952c
Packit Service d3952c
Status
Packit Service d3952c
XvMCSetAttribute (
Packit Service d3952c
    Display *display,
Packit Service d3952c
    XvMCContext *context,
Packit Service d3952c
    Atom attribute,
Packit Service d3952c
    int value
Packit Service d3952c
)
Packit Service d3952c
Packit Service d3952c
    This function sets a context-specific attribute and returns Success
Packit Service d3952c
  if no error has occurred.
Packit Service d3952c
Packit Service d3952c
    display - The connection to the server.
Packit Service d3952c
Packit Service d3952c
    context - The context for which the attribute change is to go into effect.
Packit Service d3952c
Packit Service d3952c
    attribute - The X Atom of the attribute to be changed.
Packit Service d3952c
Packit Service d3952c
    value -  The new value of the attribute.
Packit Service d3952c
Packit Service d3952c
    Errors:
Packit Service d3952c
Packit Service d3952c
	XvMCBadContext - The context is not valid.
Packit Service d3952c
Packit Service d3952c
	BadValue - An invalid value was specified.
Packit Service d3952c
Packit Service d3952c
	BadMatch - This attribute is not defined for this context.
Packit Service d3952c
Packit Service d3952c
Status
Packit Service d3952c
XvMCGetAttribute (
Packit Service d3952c
    Display *display,
Packit Service d3952c
    XvMCContext *context,
Packit Service d3952c
    Atom attribute,
Packit Service d3952c
    int *value
Packit Service d3952c
)
Packit Service d3952c
Packit Service d3952c
    This function queries a context-specific attribute and return
Packit Service d3952c
  Success and the value if no error has occurred.
Packit Service d3952c
Packit Service d3952c
    display - The connection to the server.
Packit Service d3952c
Packit Service d3952c
    context - The context whos attribute we are querying.
Packit Service d3952c
Packit Service d3952c
    attribute - The X Atom of the attribute to be retrieved.
Packit Service d3952c
Packit Service d3952c
    value -  The returned attribute value.
Packit Service d3952c
Packit Service d3952c
    Errors:
Packit Service d3952c
Packit Service d3952c
        XvMCBadContext - The context is not valid.
Packit Service d3952c
Packit Service d3952c
        BadMatch - This attribute is not defined for this context.
Packit Service d3952c