(file) Return to video CVS log (file) (dir) Up to [XFree86 CVS] / xc / doc / hardcopy / Xv

File: [XFree86 CVS] / xc / doc / hardcopy / Xv / video (download)
Revision: 1.2, Fri Dec 17 03:03:58 1999 UTC (14 years, 8 months ago) by mvojkovi
Branch: MAIN
CVS Tags: xf-4_8_0-bindist, xf-4_8_0, xf-4_8-branch, xf-4_7_99_9, xf-4_7_99_8, xf-4_7_99_7, xf-4_7_99_6, xf-4_7_99_5, xf-4_7_99_4, xf-4_7_99_31, xf-4_7_99_30, xf-4_7_99_3, xf-4_7_99_29, xf-4_7_99_28, xf-4_7_99_27, xf-4_7_99_26, xf-4_7_99_25, xf-4_7_99_24, xf-4_7_99_23, xf-4_7_99_22, xf-4_7_99_21, xf-4_7_99_20, xf-4_7_99_2, xf-4_7_99_19, xf-4_7_99_18, xf-4_7_99_17, xf-4_7_99_16, xf-4_7_99_15, xf-4_7_99_14, xf-4_7_99_13, xf-4_7_99_12, xf-4_7_99_11, xf-4_7_99_10, xf-4_7_99_1, xf-4_7_0, xf-4_7-branch, xf-4_6_99_9, xf-4_6_99_8, xf-4_6_99_7, xf-4_6_99_6, xf-4_6_99_5, xf-4_6_99_4, xf-4_6_99_3, xf-4_6_99_29, xf-4_6_99_28, xf-4_6_99_27, xf-4_6_99_26, xf-4_6_99_25, xf-4_6_99_24, xf-4_6_99_23, xf-4_6_99_22, xf-4_6_99_21, xf-4_6_99_20, xf-4_6_99_2, xf-4_6_99_19, xf-4_6_99_18, xf-4_6_99_17, xf-4_6_99_16, xf-4_6_99_15, xf-4_6_99_14, xf-4_6_99_13, xf-4_6_99_12, xf-4_6_99_11, xf-4_6_99_10, xf-4_6_99_1, xf-4_6_0, xf-4_6-branch, xf-4_5_99_904, xf-4_5_99_903, xf-4_5_99_902, xf-4_5_99_901, xf-4_5_99_9, xf-4_5_99_8, xf-4_5_99_7, xf-4_5_99_6, xf-4_5_99_5, xf-4_5_99_4, xf-4_5_99_3, xf-4_5_99_22, xf-4_5_99_21, xf-4_5_99_20, xf-4_5_99_2, xf-4_5_99_19, xf-4_5_99_18, xf-4_5_99_17, xf-4_5_99_16, xf-4_5_99_15, xf-4_5_99_14, xf-4_5_99_13, xf-4_5_99_12, xf-4_5_99_11, xf-4_5_99_10, xf-4_5_99_1, xf-4_5_0, xf-4_5-branch, xf-4_4_99_903, xf-4_4_99_902, xf-4_4_99_901, xf-4_4_99_9, xf-4_4_99_8, xf-4_4_99_7, xf-4_4_99_6, xf-4_4_99_5, xf-4_4_99_4, xf-4_4_99_3, xf-4_4_99_22, xf-4_4_99_21, xf-4_4_99_20, xf-4_4_99_2, xf-4_4_99_19, xf-4_4_99_18, xf-4_4_99_17, xf-4_4_99_16, xf-4_4_99_15, xf-4_4_99_14, xf-4_4_99_13, xf-4_4_99_12, xf-4_4_99_11, xf-4_4_99_10, xf-4_4_99_1, xf-4_4_0, xf-4_4-branch, xf-4_3_99_903, xf-4_3_99_902, xf-4_3_99_901, xf-4_3_99_9, xf-4_3_99_8, xf-4_3_99_7, xf-4_3_99_6, xf-4_3_99_5, xf-4_3_99_4, xf-4_3_99_3, xf-4_3_99_2, xf-4_3_99_16, xf-4_3_99_15, xf-4_3_99_14, xf-4_3_99_13, xf-4_3_99_12, xf-4_3_99_11, xf-4_3_99_10, xf-4_3_99_1, xf-4_3_0_2, xf-4_3_0_1, xf-4_3_0, xf-4_3-branch, xf-4_2_99_902, xf-4_2_99_901, xf-4_2_99_4, xf-4_2_99_3, xf-4_2_99_2, xf-4_2_99_1, xf-4_2_1_2, xf-4_2_1_1, xf-4_2_1, xf-4_2_0_1, xf-4_2_0-bindist-1, xf-4_2_0-bindist, xf-4_2_0, xf-4_2-branch, xf-4_1_99_7, xf-4_1_99_6, xf-4_1_99_5, xf-4_1_99_4, xf-4_1_99_3, xf-4_1_99_2, xf-4_1_99_1, xf-4_1_0_2, xf-4_1_0_1, xf-4_1_0-bindist, xf-4_1_0, xf-4_1-branch, xf-4_0g, xf-4_0f, xf-4_0e, xf-4_0d, xf-4_0c, xf-4_0b, xf-4_0a, xf-4_0_99_902, xf-4_0_99_901, xf-4_0_99_900, xf-4_0_99_3, xf-4_0_99_2, xf-4_0_99_1, xf-4_0_3b, xf-4_0_3a, xf-4_0_3, xf-4_0_2c, xf-4_0_2b, xf-4_0_2a, xf-4_0_2-branch, xf-4_0_2-bindist, xf-4_0_2, xf-4_0_1h, xf-4_0_1g, xf-4_0_1f, xf-4_0_1e, xf-4_0_1d, xf-4_0_1c, xf-4_0_1b, xf-4_0_1a, xf-4_0_1Zc, xf-4_0_1Zb, xf-4_0_1Za, xf-4_0_1Z, xf-4_0_1-bindist, xf-4_0_1, xf-4_0Z, xf-4_0-bindist, xf-4_0, xf-3_9_18b, xf-3_9_18a, xf-3_9_18Za, xf-3_9_18Z, xf-3_9_18, xf-3_9_17f, xf-3_9_17e, xf-3_9_17d, xf-3_9_17c, xf-3_9_17b, xf-3_9_17a, xf-3_9_17Z, xf-3_9_17, xf-3_9_16Za, xf-3_9_16Z, pre-R651-import, HEAD, Domain-branch
Changes since 1.1: +5 -1 lines
  More doc updates.


Addendum to the Xv Client library documentation
===============================================

  The following features are new to version 2.2

1) In addition to XvInputMask and XvOutputMask masks in the type field
   of the XvAdaptorInfo there are 3 new bits defined - XvVideoMask,
   XvStillMask and XvImageMask indicating that the adaptor is capable
   of video, still or image primitives respectively.

2) A new function and structure is defined to allow querying
   port attributes.

typedef struct {
  int flags;    
  int min_value;
  int max_value;
  char *name;
} XvAttribute;

  flags  -   May be XvGettable or XvSettable or both OR'd together
	     indicating the particular attribute is readable, writeable
	     or readable and writeable.

  min_value, max_value -  Indicate the minimun and maximum attribute
	     values which are valid for the driver.

  name -  A string describing the name of the attribute that may be used
	     to retrieve the Atom for the particular attribute.


extern XvAttribute* XvQueryPortAttributes(
  Display*                /* display */,
  XvPortID                /* port */,
  int*                    /* number */
);

   XvQueryPortAttributes returns the number of attributes and an
   array of XvAttributes valid for the given port.  The array may
   be freed with XFree().


3)  The X Video Extension (Xv) is extended to support client images in
alternate colorspaces (XvImages) in the following way.

  Xv Adaptors which are capable of displaying XvImages will have
  the XvImageMask field set in the type field of the XvAdaptorInfo.

  XvImage formats supported by the port may be queried with 
  XvListImageFormats().

  XvImages may be created with the help of XvCreateImage() or
  XvShmCreateImage();

  XvImages may be displayed with XvPutImage() or XvShmPutImage().

  The Port attributes of the port specified in the Xv(Shm)PutImage
  command will be valid for the image operation when applicable.

  There will be a port encoding with the name "XV_IMAGE".  The
  width and height of that encoding will indicate the maximum
  source image size.

typedef struct {
  int id;                      /* Unique descriptor for the format */
  int type;                    /* XvRGB, XvYUV */
  int byte_order;              /* LSBFirst, MSBFirst */
  char guid[16];               /* Globally Unique IDentifier */
  int bits_per_pixel;
  int format;                  /* XvPacked, XvPlanar */
  int num_planes;

  /* for RGB formats */
  int depth;
  unsigned int red_mask;       
  unsigned int green_mask;   
  unsigned int blue_mask;   

  /* for YUV formats */
  unsigned int y_sample_bits;
  unsigned int u_sample_bits;
  unsigned int v_sample_bits;   
  unsigned int horz_y_period;
  unsigned int horz_u_period;
  unsigned int horz_v_period;
  unsigned int vert_y_period;
  unsigned int vert_u_period;
  unsigned int vert_v_period;
  char component_order[32];    /* eg. UYVY */
  int scanline_order;          /* XvTopToBottom, XvBottomToTop */
} XvImageFormatValues; 


   id -  A unique descriptor for the format.  This is often the FOURCC
	 for the format, when applicable.  This id is used to describe
	 the format during XvImage creation.

   type - XvRGB or XvYUV.

   byte_order -  The byte order of the image.  It is either LSBFirst
	         or MSBFirst.
	
   guid -  The Globally Unique IDentifier (also known as Universally Unique
	   IDentifier).  When not applicable, all characters are NULL.  

   bits_per_pixel - The bits taken up (but not necessarily used) by each
                    pixel.  Note that for some planar formats which have
                    fractional bits per pixel (such as IF09) this number
                    may be rounded _down_.

   format - XvPacked or XvPlanar.

   num_planes - The number of planes in planar formats.

   depth - Significant bits per pixel.

   red_mask, green_mask, blue_mask -  The red, green and blue bitmasks
				      (RGB formats only).


   ?_sample_bits -  The size of each sample in bits (YUV formats only).

   horz_?_period, vert_?_period -  The period (in pixels) on which samples
                                   occur in the horizontal and vertical 
                                   directions (YUV formats only).

   component_order -  Upper case ascii characters representing the order
                      that samples are stored within packed formats.
                      For planar formats this represents the ordering of
                      the planes.

   scanline_order - XvTopToBottom or XvBottomToTop.

Note:  Since some formats (particularly some planar YUV formats) may not
       be completely defined by the parameters above, the guid, when
       available, should provide the most accurate description of the 
       format.



XvImageFormatValues * XvListImageFormats (
   Display 	*display,
   XvPortID 	port_id,
   int 		*count_return
);

   Returns the XvImageFormatValues supported by the specified port. 
This list should be freed with XFree().
   

typedef struct {
   int id;
   int width, height;
   int data_size;
   int num_planes;
   int *pitches;
   int *offsets;
   char *data;          
   XPointer obdata;     
} XvImage;

   id - XvImageFormatValues id.
   
   width, height - The width and height of the image in pixels.

   int data_size - The size of the data buffer in bytes.

   num_planes -  The number of image planes.

   pitches -  An array of size num_planes indicating the scanline pitch
              in bytes.  Each plane may have a different pitch.

   offsets -  An array of size num_planes indicating the byte offset
              from "data" to the start of each plane.

   data -  A pointer to the start of the data buffer.

   obdata -  A private field for holding SHM info.  This field will be
             set up by the client libraries so the programmer will 
             generally need not be concerned with this field.

XvImage * XvCreateImage (
   Display *display,
   XvPortID port,
   int id,
   char *data,
   int width, 
   int height 
);

   display - Specifies the connection to the Xserver.
   port    - Specifies the port the XvImage will be used with.
   id      - Specifies the format of the image to be created by
	     the XvImageFormatValues id.
   data    - Specifies the image data.
   width
   height  - Specifies the desired width and height of the image.

   This function is similar to XCreateImage.  The library will
allocate the XvImage structure and fill out all fields except for
"data".  Width and height may be enlarged in some YUV formats.
The size of the data buffer that needs to be allocated will be
give in the "data_size" field in the XvImage.  Image data is 
not allocated by this function.  The client may pass a pointer
to the preallocated memory as "data" or may allocate the memory
and fill in the XvImage structure's data field after the 
"data_size" field has been filled out by the server.  The XvImage
structure may be freed by XFree();


XvImage * XvShmCreateImage (
   Display *display,
   XvPortID port,
   int id,
   char* data,
   int width, 
   int height,
   XShmSegmentInfo *shminfo
);

   This function is similar to XShmCreateImage.  The library will
allocate the XvImage structure and fill out all fields except for
"data".  Width and height may be enlarged in some YUV formats.
The size of the data buffer that needs to be allocated will be
give in the "data_size" field in the XvImage.  Image data is 
not allocated by this function.  The client may pass a pointer
to the preallocated memory as "data" or may allocate the memory
and fill in the XvImage structure's data field after the 
"data_size" field has been filled out by the server.  The XvImage
structure may be freed by XFree();


XvPutImage (
   Display *display,
   XvPortID id,
   Drawable d,
   GC gc,
   XvImage *image,
   int src_x,
   int src_y,
   unsigned int src_w,
   unsigned int src_h,
   int dest_x, 
   int dest_y,
   unsigned int dest_w,
   unsigned int dest_h,
);

XvShmPutImage (
   Display *display,
   XvPortID id,
   Drawable d,
   GC gc,
   XvImage *image,
   int src_x,
   int src_y,
   unsigned int src_w,
   unsigned int src_h,
   int dest_x, 
   int dest_y,
   unsigned int dest_w,
   unsigned int dest_h,
   Bool send_event
);

   display - The connection to the X-Server.

   id -  The port id of a port on an XvImage capable adaptor.

   d - The target drawable.
   
   gc - the graphics context specifying the clip mask to use, if any.

   image - A pointer to the XvImage to be displayed.

   src_? - The portion of the XvImage to be displayed.
 
   dest_? - The portion of the destination drawable to be filled by the image.

   send_event - Indicates whether or not an XShmCompletionEvent should be
                sent.  If sent, the event's major_code and minor_code
                fields will indicate the Xv extension's major code and
                XvShmPutImage's minor code.

Shared memory segments are attached/detached with XShmAttach/Detach.


Some of the possible Errors:

   BadDrawable   - The specified drawable does not exist.
   BadContext    - The specified GC does not exist.
   BadMatch      - Incompatible arguments such as a port that isn't capable
                   of displaying XvImages.
   XvBadPort     - The specified port does not exist.
   BadAlloc      - The server was unable to allocate resources required 
                   to complete the operation.
   BadValue      - Some numeric value falls outside the range of the 
                   values accepted by the request.
   BadShmSegCode - An invalid shared memory segment.

Powered by
ViewCVS 0.9.2