src/video/Xext/extensions/Xvlib.h
author Sam Lantinga <slouken@libsdl.org>
Mon, 29 May 2006 04:04:35 +0000
branchSDL-1.3
changeset 1668 4da1ee79c9af
parent 1662 782fd950bd46
permissions -rw-r--r--
more tweaking indent options
     1 /***********************************************************
     2 Copyright 1991 by Digital Equipment Corporation, Maynard, Massachusetts,
     3 and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
     4 
     5                         All Rights Reserved
     6 
     7 Permission to use, copy, modify, and distribute this software and its 
     8 documentation for any purpose and without fee is hereby granted, 
     9 provided that the above copyright notice appear in all copies and that
    10 both that copyright notice and this permission notice appear in 
    11 supporting documentation, and that the names of Digital or MIT not be
    12 used in advertising or publicity pertaining to distribution of the
    13 software without specific, written prior permission.  
    14 
    15 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
    16 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
    17 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
    18 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
    19 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
    20 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
    21 SOFTWARE.
    22 
    23 ******************************************************************/
    24 /* $XFree86: xc/include/extensions/Xvlib.h,v 1.3 1999/12/11 19:28:48 mvojkovi Exp $ */
    25 
    26 #ifndef XVLIB_H
    27 #define XVLIB_H
    28 /*
    29 ** File: 
    30 **
    31 **   Xvlib.h --- Xv library public header file
    32 **
    33 ** Author: 
    34 **
    35 **   David Carver (Digital Workstation Engineering/Project Athena)
    36 **
    37 ** Revisions:
    38 **
    39 **   26.06.91 Carver
    40 **     - changed XvFreeAdaptors to XvFreeAdaptorInfo
    41 **     - changed XvFreeEncodings to XvFreeEncodingInfo
    42 **
    43 **   11.06.91 Carver
    44 **     - changed SetPortControl to SetPortAttribute
    45 **     - changed GetPortControl to GetPortAttribute
    46 **     - changed QueryBestSize
    47 **
    48 **   05.15.91 Carver
    49 **     - version 2.0 upgrade
    50 **
    51 **   01.24.91 Carver
    52 **     - version 1.4 upgrade
    53 **
    54 */
    55 
    56 #include <X11/Xfuncproto.h>
    57 #include "Xv.h"
    58 #include "SDL_name.h"
    59 
    60 typedef struct
    61 {
    62     int numerator;
    63     int denominator;
    64 } SDL_NAME(XvRational);
    65 
    66 typedef struct
    67 {
    68     int flags;                  /* XvGettable, XvSettable */
    69     int min_value;
    70     int max_value;
    71     char *name;
    72 } SDL_NAME(XvAttribute);
    73 
    74 typedef struct
    75 {
    76     XvEncodingID encoding_id;
    77     char *name;
    78     unsigned long width;
    79     unsigned long height;
    80       SDL_NAME(XvRational) rate;
    81     unsigned long num_encodings;
    82 } SDL_NAME(XvEncodingInfo);
    83 
    84 typedef struct
    85 {
    86     char depth;
    87     unsigned long visual_id;
    88 } SDL_NAME(XvFormat);
    89 
    90 typedef struct
    91 {
    92     XvPortID base_id;
    93     unsigned long num_ports;
    94     char type;
    95     char *name;
    96     unsigned long num_formats;
    97       SDL_NAME(XvFormat) * formats;
    98     unsigned long num_adaptors;
    99 } SDL_NAME(XvAdaptorInfo);
   100 
   101 typedef struct
   102 {
   103     int type;
   104     unsigned long serial;       /* # of last request processed by server */
   105     Bool send_event;            /* true if this came from a SendEvent request */
   106     Display *display;           /* Display the event was read from */
   107     Drawable drawable;          /* drawable */
   108     unsigned long reason;       /* what generated this event */
   109     XvPortID port_id;           /* what port */
   110     Time time;                  /* milliseconds */
   111 } SDL_NAME(XvVideoNotifyEvent);
   112 
   113 typedef struct
   114 {
   115     int type;
   116     unsigned long serial;       /* # of last request processed by server */
   117     Bool send_event;            /* true if this came from a SendEvent request */
   118     Display *display;           /* Display the event was read from */
   119     XvPortID port_id;           /* what port */
   120     Time time;                  /* milliseconds */
   121     Atom attribute;             /* atom that identifies attribute */
   122     long value;                 /* value of attribute */
   123 } SDL_NAME(XvPortNotifyEvent);
   124 
   125 typedef union
   126 {
   127     int type;
   128       SDL_NAME(XvVideoNotifyEvent) xvvideo;
   129       SDL_NAME(XvPortNotifyEvent) xvport;
   130     long pad[24];
   131 } SDL_NAME(XvEvent);
   132 
   133 typedef struct
   134 {
   135     int id;                     /* Unique descriptor for the format */
   136     int type;                   /* XvRGB, XvYUV */
   137     int byte_order;             /* LSBFirst, MSBFirst */
   138     char guid[16];              /* Globally Unique IDentifier */
   139     int bits_per_pixel;
   140     int format;                 /* XvPacked, XvPlanar */
   141     int num_planes;
   142 
   143     /* for RGB formats only */
   144     int depth;
   145     unsigned int red_mask;
   146     unsigned int green_mask;
   147     unsigned int blue_mask;
   148 
   149     /* for YUV formats only */
   150     unsigned int y_sample_bits;
   151     unsigned int u_sample_bits;
   152     unsigned int v_sample_bits;
   153     unsigned int horz_y_period;
   154     unsigned int horz_u_period;
   155     unsigned int horz_v_period;
   156     unsigned int vert_y_period;
   157     unsigned int vert_u_period;
   158     unsigned int vert_v_period;
   159     char component_order[32];   /* eg. UYVY */
   160     int scanline_order;         /* XvTopToBottom, XvBottomToTop */
   161 } SDL_NAME(XvImageFormatValues);
   162 
   163 typedef struct
   164 {
   165     int id;
   166     int width, height;
   167     int data_size;              /* bytes */
   168     int num_planes;
   169     int *pitches;               /* bytes */
   170     int *offsets;               /* bytes */
   171     char *data;
   172     XPointer obdata;
   173 } SDL_NAME(XvImage);
   174 
   175 _XFUNCPROTOBEGIN extern int SDL_NAME(XvQueryExtension) (
   176 #if NeedFunctionPrototypes
   177                                                            Display *
   178                                                            /* display */ ,
   179                                                            unsigned int *
   180                                                            /* p_version */ ,
   181                                                            unsigned int *
   182                                                            /* p_revision */ ,
   183                                                            unsigned int *
   184                                                            /* p_requestBase */
   185                                                            , unsigned int *
   186                                                            /* p_eventBase */
   187                                                            , unsigned int *     /* p_errorBase */
   188 #endif
   189     );
   190 
   191 extern int SDL_NAME(XvQueryAdaptors) (
   192 #if NeedFunctionPrototypes
   193                                          Display * /* display */ ,
   194                                          Window /* window */ ,
   195                                          unsigned int * /* p_nAdaptors */ ,
   196                                          SDL_NAME(XvAdaptorInfo) **     /* p_pAdaptors */
   197 #endif
   198     );
   199 
   200 extern int SDL_NAME(XvQueryEncodings) (
   201 #if NeedFunctionPrototypes
   202                                           Display * /* display */ ,
   203                                           XvPortID /* port */ ,
   204                                           unsigned int * /* p_nEncoding */ ,
   205                                           SDL_NAME(XvEncodingInfo) **   /* p_pEncoding */
   206 #endif
   207     );
   208 
   209 extern int SDL_NAME(XvPutVideo) (
   210 #if NeedFunctionPrototypes
   211                                     Display * /* display */ ,
   212                                     XvPortID /* port */ ,
   213                                     Drawable /* d */ ,
   214                                     GC /* gc */ ,
   215                                     int /* vx */ ,
   216                                     int /* vy */ ,
   217                                     unsigned int /* vw */ ,
   218                                     unsigned int /* vh */ ,
   219                                     int /* dx */ ,
   220                                     int /* dy */ ,
   221                                     unsigned int /* dw */ ,
   222                                     unsigned int        /* dh */
   223 #endif
   224     );
   225 
   226 extern int SDL_NAME(XvPutStill) (
   227 #if NeedFunctionPrototypes
   228                                     Display * /* display */ ,
   229                                     XvPortID /* port */ ,
   230                                     Drawable /* d */ ,
   231                                     GC /* gc */ ,
   232                                     int /* vx */ ,
   233                                     int /* vy */ ,
   234                                     unsigned int /* vw */ ,
   235                                     unsigned int /* vh */ ,
   236                                     int /* dx */ ,
   237                                     int /* dy */ ,
   238                                     unsigned int /* dw */ ,
   239                                     unsigned int        /* dh */
   240 #endif
   241     );
   242 
   243 extern int SDL_NAME(XvGetVideo) (
   244 #if NeedFunctionPrototypes
   245                                     Display * /* display */ ,
   246                                     XvPortID /* port */ ,
   247                                     Drawable /* d */ ,
   248                                     GC /* gc */ ,
   249                                     int /* vx */ ,
   250                                     int /* vy */ ,
   251                                     unsigned int /* vw */ ,
   252                                     unsigned int /* vh */ ,
   253                                     int /* dx */ ,
   254                                     int /* dy */ ,
   255                                     unsigned int /* dw */ ,
   256                                     unsigned int        /* dh */
   257 #endif
   258     );
   259 
   260 extern int SDL_NAME(XvGetStill) (
   261 #if NeedFunctionPrototypes
   262                                     Display * /* display */ ,
   263                                     XvPortID /* port */ ,
   264                                     Drawable /* d */ ,
   265                                     GC /* gc */ ,
   266                                     int /* vx */ ,
   267                                     int /* vy */ ,
   268                                     unsigned int /* vw */ ,
   269                                     unsigned int /* vh */ ,
   270                                     int /* dx */ ,
   271                                     int /* dy */ ,
   272                                     unsigned int /* dw */ ,
   273                                     unsigned int        /* dh */
   274 #endif
   275     );
   276 
   277 extern int SDL_NAME(XvStopVideo) (
   278 #if NeedFunctionPrototypes
   279                                      Display * /* display */ ,
   280                                      XvPortID /* port */ ,
   281                                      Drawable   /* drawable */
   282 #endif
   283     );
   284 
   285 extern int SDL_NAME(XvGrabPort) (
   286 #if NeedFunctionPrototypes
   287                                     Display * /* display */ ,
   288                                     XvPortID /* port */ ,
   289                                     Time        /* time */
   290 #endif
   291     );
   292 
   293 extern int SDL_NAME(XvUngrabPort) (
   294 #if NeedFunctionPrototypes
   295                                       Display * /* display */ ,
   296                                       XvPortID /* port */ ,
   297                                       Time      /* time */
   298 #endif
   299     );
   300 
   301 extern int SDL_NAME(XvSelectVideoNotify) (
   302 #if NeedFunctionPrototypes
   303                                              Display * /* display */ ,
   304                                              Drawable /* drawable */ ,
   305                                              Bool       /* onoff */
   306 #endif
   307     );
   308 
   309 extern int SDL_NAME(XvSelectPortNotify) (
   310 #if NeedFunctionPrototypes
   311                                             Display * /* display */ ,
   312                                             XvPortID /* port */ ,
   313                                             Bool        /* onoff */
   314 #endif
   315     );
   316 
   317 extern int SDL_NAME(XvSetPortAttribute) (
   318 #if NeedFunctionPrototypes
   319                                             Display * /* display */ ,
   320                                             XvPortID /* port */ ,
   321                                             Atom /* attribute */ ,
   322                                             int /* value */
   323 #endif
   324     );
   325 
   326 extern int SDL_NAME(XvGetPortAttribute) (
   327 #if NeedFunctionPrototypes
   328                                             Display * /* display */ ,
   329                                             XvPortID /* port */ ,
   330                                             Atom /* attribute */ ,
   331                                             int *       /* p_value */
   332 #endif
   333     );
   334 
   335 extern int SDL_NAME(XvQueryBestSize) (
   336 #if NeedFunctionPrototypes
   337                                          Display * /* display */ ,
   338                                          XvPortID /* port */ ,
   339                                          Bool /* motion */ ,
   340                                          unsigned int /* vid_w */ ,
   341                                          unsigned int /* vid_h */ ,
   342                                          unsigned int /* drw_w */ ,
   343                                          unsigned int /* drw_h */ ,
   344                                          unsigned int * /* p_actual_width */
   345                                          , unsigned int *       /* p_actual_width */
   346 #endif
   347     );
   348 
   349 extern
   350 SDL_NAME(XvAttribute) *
   351 SDL_NAME(XvQueryPortAttributes) (
   352 #if NeedFunctionPrototypes
   353                                     Display * /* display */ ,
   354                                     XvPortID /* port */ ,
   355                                     int *       /* number */
   356 #endif
   357     );
   358 
   359 
   360      extern void SDL_NAME(XvFreeAdaptorInfo) (
   361 #if NeedFunctionPrototypes
   362                                                  SDL_NAME(XvAdaptorInfo) *      /* adaptors */
   363 #endif
   364     );
   365 
   366      extern void SDL_NAME(XvFreeEncodingInfo) (
   367 #if NeedFunctionPrototypes
   368                                                   SDL_NAME(XvEncodingInfo) *    /* encodings */
   369 #endif
   370     );
   371 
   372 
   373      extern SDL_NAME(XvImageFormatValues) * SDL_NAME(XvListImageFormats) (
   374 #if NeedFunctionPrototypes
   375                                                                              Display
   376                                                                              *
   377                                                                              display,
   378                                                                              XvPortID
   379                                                                              port_id,
   380                                                                              int
   381                                                                              *count_return
   382 #endif
   383     );
   384 
   385      extern SDL_NAME(XvImage) * SDL_NAME(XvCreateImage) (
   386 #if NeedFunctionPrototypes
   387                                                             Display *
   388                                                             display,
   389                                                             XvPortID port,
   390                                                             int id,
   391                                                             char *data,
   392                                                             int width,
   393                                                             int height
   394 #endif
   395     );
   396 
   397      extern int SDL_NAME(XvPutImage) (
   398 #if NeedFunctionPrototypes
   399                                          Display * display,
   400                                          XvPortID id,
   401                                          Drawable d,
   402                                          GC gc,
   403                                          SDL_NAME(XvImage) * image,
   404                                          int src_x,
   405                                          int src_y,
   406                                          unsigned int src_w,
   407                                          unsigned int src_h,
   408                                          int dest_x,
   409                                          int dest_y,
   410                                          unsigned int dest_w,
   411                                          unsigned int dest_h
   412 #endif
   413     );
   414 
   415      extern int SDL_NAME(XvShmPutImage) (
   416 #if NeedFunctionPrototypes
   417                                             Display * display,
   418                                             XvPortID id,
   419                                             Drawable d,
   420                                             GC gc,
   421                                             SDL_NAME(XvImage) * image,
   422                                             int src_x,
   423                                             int src_y,
   424                                             unsigned int src_w,
   425                                             unsigned int src_h,
   426                                             int dest_x,
   427                                             int dest_y,
   428                                             unsigned int dest_w,
   429                                             unsigned int dest_h,
   430                                             Bool send_event
   431 #endif
   432     );
   433 
   434 #ifdef _XSHM_H_
   435 
   436      extern SDL_NAME(XvImage) * SDL_NAME(XvShmCreateImage) (
   437 #if NeedFunctionPrototypes
   438                                                                Display *
   439                                                                display,
   440                                                                XvPortID
   441                                                                port, int id,
   442                                                                char *data,
   443                                                                int width,
   444                                                                int height,
   445                                                                XShmSegmentInfo
   446                                                                * shminfo
   447 #endif
   448     );
   449 
   450 #endif
   451 
   452 
   453 _XFUNCPROTOEND
   454 #endif /* XVLIB_H */
   455 /* vi: set ts=4 sw=4 expandtab: */