1*4882a593Smuzhiyun /* 2*4882a593Smuzhiyun 3*4882a593Smuzhiyun XFree86 Xv DDX written by Mark Vojkovich (markv@valinux.com) 4*4882a593Smuzhiyun Adapted for KDrive by Pontus Lidman <pontus.lidman@nokia.com> 5*4882a593Smuzhiyun 6*4882a593Smuzhiyun Copyright (C) 2000, 2001 - Nokia Home Communications 7*4882a593Smuzhiyun Copyright (C) 1998, 1999 - The XFree86 Project Inc. 8*4882a593Smuzhiyun 9*4882a593Smuzhiyun All rights reserved. 10*4882a593Smuzhiyun 11*4882a593Smuzhiyun Permission is hereby granted, free of charge, to any person obtaining 12*4882a593Smuzhiyun a copy of this software and associated documentation files (the 13*4882a593Smuzhiyun "Software"), to deal in the Software without restriction, including 14*4882a593Smuzhiyun without limitation the rights to use, copy, modify, merge, publish, 15*4882a593Smuzhiyun distribute, and/or sell copies of the Software, and to permit persons 16*4882a593Smuzhiyun to whom the Software is furnished to do so, provided that the above 17*4882a593Smuzhiyun copyright notice(s) and this permission notice appear in all copies of 18*4882a593Smuzhiyun the Software and that both the above copyright notice(s) and this 19*4882a593Smuzhiyun permission notice appear in supporting documentation. 20*4882a593Smuzhiyun 21*4882a593Smuzhiyun THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 22*4882a593Smuzhiyun EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 23*4882a593Smuzhiyun MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT 24*4882a593Smuzhiyun OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 25*4882a593Smuzhiyun HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY 26*4882a593Smuzhiyun SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER 27*4882a593Smuzhiyun RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF 28*4882a593Smuzhiyun CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 29*4882a593Smuzhiyun CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 30*4882a593Smuzhiyun 31*4882a593Smuzhiyun Except as contained in this notice, the name of a copyright holder 32*4882a593Smuzhiyun shall not be used in advertising or otherwise to promote the sale, use 33*4882a593Smuzhiyun or other dealings in this Software without prior written authorization 34*4882a593Smuzhiyun of the copyright holder. 35*4882a593Smuzhiyun 36*4882a593Smuzhiyun */ 37*4882a593Smuzhiyun 38*4882a593Smuzhiyun #ifndef _XVDIX_H_ 39*4882a593Smuzhiyun #define _XVDIX_H_ 40*4882a593Smuzhiyun 41*4882a593Smuzhiyun #include "scrnintstr.h" 42*4882a593Smuzhiyun #include "regionstr.h" 43*4882a593Smuzhiyun #include "windowstr.h" 44*4882a593Smuzhiyun #include "pixmapstr.h" 45*4882a593Smuzhiyun #include "mivalidate.h" 46*4882a593Smuzhiyun #include "validate.h" 47*4882a593Smuzhiyun #include "resource.h" 48*4882a593Smuzhiyun #include "gcstruct.h" 49*4882a593Smuzhiyun #include "dixstruct.h" 50*4882a593Smuzhiyun 51*4882a593Smuzhiyun #include "../../Xext/xvdix.h" 52*4882a593Smuzhiyun 53*4882a593Smuzhiyun #define VIDEO_OVERLAID_IMAGES 0x00000004 54*4882a593Smuzhiyun #define VIDEO_OVERLAID_STILLS 0x00000008 55*4882a593Smuzhiyun #define VIDEO_CLIP_TO_VIEWPORT 0x00000010 56*4882a593Smuzhiyun 57*4882a593Smuzhiyun typedef int (*PutVideoFuncPtr) (KdScreenInfo * screen, DrawablePtr pDraw, 58*4882a593Smuzhiyun short vid_x, short vid_y, short drw_x, 59*4882a593Smuzhiyun short drw_y, short vid_w, short vid_h, 60*4882a593Smuzhiyun short drw_w, short drw_h, RegionPtr clipBoxes, 61*4882a593Smuzhiyun void *data); 62*4882a593Smuzhiyun typedef int (*PutStillFuncPtr) (KdScreenInfo * screen, DrawablePtr pDraw, 63*4882a593Smuzhiyun short vid_x, short vid_y, short drw_x, 64*4882a593Smuzhiyun short drw_y, short vid_w, short vid_h, 65*4882a593Smuzhiyun short drw_w, short drw_h, RegionPtr clipBoxes, 66*4882a593Smuzhiyun void *data); 67*4882a593Smuzhiyun typedef int (*GetVideoFuncPtr) (KdScreenInfo * screen, DrawablePtr pDraw, 68*4882a593Smuzhiyun short vid_x, short vid_y, short drw_x, 69*4882a593Smuzhiyun short drw_y, short vid_w, short vid_h, 70*4882a593Smuzhiyun short drw_w, short drw_h, RegionPtr clipBoxes, 71*4882a593Smuzhiyun void *data); 72*4882a593Smuzhiyun typedef int (*GetStillFuncPtr) (KdScreenInfo * screen, DrawablePtr pDraw, 73*4882a593Smuzhiyun short vid_x, short vid_y, short drw_x, 74*4882a593Smuzhiyun short drw_y, short vid_w, short vid_h, 75*4882a593Smuzhiyun short drw_w, short drw_h, RegionPtr clipBoxes, 76*4882a593Smuzhiyun void *data); 77*4882a593Smuzhiyun typedef void (*StopVideoFuncPtr) (KdScreenInfo * screen, void *data, 78*4882a593Smuzhiyun Bool Exit); 79*4882a593Smuzhiyun typedef int (*SetPortAttributeFuncPtr) (KdScreenInfo * screen, Atom attribute, 80*4882a593Smuzhiyun int value, void *data); 81*4882a593Smuzhiyun typedef int (*GetPortAttributeFuncPtr) (KdScreenInfo * screen, Atom attribute, 82*4882a593Smuzhiyun int *value, void *data); 83*4882a593Smuzhiyun typedef void (*QueryBestSizeFuncPtr) (KdScreenInfo * screen, Bool motion, 84*4882a593Smuzhiyun short vid_w, short vid_h, short drw_w, 85*4882a593Smuzhiyun short drw_h, unsigned int *p_w, 86*4882a593Smuzhiyun unsigned int *p_h, void *data); 87*4882a593Smuzhiyun typedef int (*PutImageFuncPtr) (KdScreenInfo * screen, DrawablePtr pDraw, 88*4882a593Smuzhiyun short src_x, short src_y, short drw_x, 89*4882a593Smuzhiyun short drw_y, short src_w, short src_h, 90*4882a593Smuzhiyun short drw_w, short drw_h, int image, 91*4882a593Smuzhiyun unsigned char *buf, short width, short height, 92*4882a593Smuzhiyun Bool Sync, RegionPtr clipBoxes, void *data); 93*4882a593Smuzhiyun typedef int (*ReputImageFuncPtr) (KdScreenInfo * screen, DrawablePtr pDraw, 94*4882a593Smuzhiyun short drw_x, short drw_y, RegionPtr clipBoxes, 95*4882a593Smuzhiyun void *data); 96*4882a593Smuzhiyun typedef int (*QueryImageAttributesFuncPtr) (KdScreenInfo * screen, int image, 97*4882a593Smuzhiyun unsigned short *width, 98*4882a593Smuzhiyun unsigned short *height, 99*4882a593Smuzhiyun int *pitches, int *offsets); 100*4882a593Smuzhiyun 101*4882a593Smuzhiyun typedef enum { 102*4882a593Smuzhiyun XV_OFF, 103*4882a593Smuzhiyun XV_PENDING, 104*4882a593Smuzhiyun XV_ON 105*4882a593Smuzhiyun } XvStatus; 106*4882a593Smuzhiyun 107*4882a593Smuzhiyun /*** this is what the driver needs to fill out ***/ 108*4882a593Smuzhiyun 109*4882a593Smuzhiyun typedef struct { 110*4882a593Smuzhiyun int id; 111*4882a593Smuzhiyun const char *name; 112*4882a593Smuzhiyun unsigned short width, height; 113*4882a593Smuzhiyun XvRationalRec rate; 114*4882a593Smuzhiyun } KdVideoEncodingRec, *KdVideoEncodingPtr; 115*4882a593Smuzhiyun 116*4882a593Smuzhiyun typedef struct { 117*4882a593Smuzhiyun char depth; 118*4882a593Smuzhiyun short class; 119*4882a593Smuzhiyun } KdVideoFormatRec, *KdVideoFormatPtr; 120*4882a593Smuzhiyun 121*4882a593Smuzhiyun typedef struct { 122*4882a593Smuzhiyun unsigned int type; 123*4882a593Smuzhiyun int flags; 124*4882a593Smuzhiyun const char *name; 125*4882a593Smuzhiyun int nEncodings; 126*4882a593Smuzhiyun KdVideoEncodingPtr pEncodings; 127*4882a593Smuzhiyun int nFormats; 128*4882a593Smuzhiyun KdVideoFormatPtr pFormats; 129*4882a593Smuzhiyun int nPorts; 130*4882a593Smuzhiyun DevUnion *pPortPrivates; 131*4882a593Smuzhiyun int nAttributes; 132*4882a593Smuzhiyun XvAttributePtr pAttributes; 133*4882a593Smuzhiyun int nImages; 134*4882a593Smuzhiyun XvImagePtr pImages; 135*4882a593Smuzhiyun PutVideoFuncPtr PutVideo; 136*4882a593Smuzhiyun PutStillFuncPtr PutStill; 137*4882a593Smuzhiyun GetVideoFuncPtr GetVideo; 138*4882a593Smuzhiyun GetStillFuncPtr GetStill; 139*4882a593Smuzhiyun StopVideoFuncPtr StopVideo; 140*4882a593Smuzhiyun SetPortAttributeFuncPtr SetPortAttribute; 141*4882a593Smuzhiyun GetPortAttributeFuncPtr GetPortAttribute; 142*4882a593Smuzhiyun QueryBestSizeFuncPtr QueryBestSize; 143*4882a593Smuzhiyun PutImageFuncPtr PutImage; 144*4882a593Smuzhiyun ReputImageFuncPtr ReputImage; 145*4882a593Smuzhiyun QueryImageAttributesFuncPtr QueryImageAttributes; 146*4882a593Smuzhiyun } KdVideoAdaptorRec, *KdVideoAdaptorPtr; 147*4882a593Smuzhiyun 148*4882a593Smuzhiyun Bool 149*4882a593Smuzhiyun KdXVScreenInit(ScreenPtr pScreen, KdVideoAdaptorPtr Adaptors, int num); 150*4882a593Smuzhiyun 151*4882a593Smuzhiyun /*** These are DDX layer privates ***/ 152*4882a593Smuzhiyun 153*4882a593Smuzhiyun typedef struct { 154*4882a593Smuzhiyun DestroyWindowProcPtr DestroyWindow; 155*4882a593Smuzhiyun ClipNotifyProcPtr ClipNotify; 156*4882a593Smuzhiyun WindowExposuresProcPtr WindowExposures; 157*4882a593Smuzhiyun CloseScreenProcPtr CloseScreen; 158*4882a593Smuzhiyun } KdXVScreenRec, *KdXVScreenPtr; 159*4882a593Smuzhiyun 160*4882a593Smuzhiyun typedef struct { 161*4882a593Smuzhiyun int flags; 162*4882a593Smuzhiyun PutVideoFuncPtr PutVideo; 163*4882a593Smuzhiyun PutStillFuncPtr PutStill; 164*4882a593Smuzhiyun GetVideoFuncPtr GetVideo; 165*4882a593Smuzhiyun GetStillFuncPtr GetStill; 166*4882a593Smuzhiyun StopVideoFuncPtr StopVideo; 167*4882a593Smuzhiyun SetPortAttributeFuncPtr SetPortAttribute; 168*4882a593Smuzhiyun GetPortAttributeFuncPtr GetPortAttribute; 169*4882a593Smuzhiyun QueryBestSizeFuncPtr QueryBestSize; 170*4882a593Smuzhiyun PutImageFuncPtr PutImage; 171*4882a593Smuzhiyun ReputImageFuncPtr ReputImage; 172*4882a593Smuzhiyun QueryImageAttributesFuncPtr QueryImageAttributes; 173*4882a593Smuzhiyun } XvAdaptorRecPrivate, *XvAdaptorRecPrivatePtr; 174*4882a593Smuzhiyun 175*4882a593Smuzhiyun typedef struct { 176*4882a593Smuzhiyun KdScreenInfo *screen; 177*4882a593Smuzhiyun DrawablePtr pDraw; 178*4882a593Smuzhiyun unsigned char type; 179*4882a593Smuzhiyun unsigned int subWindowMode; 180*4882a593Smuzhiyun DDXPointRec clipOrg; 181*4882a593Smuzhiyun RegionPtr clientClip; 182*4882a593Smuzhiyun RegionPtr pCompositeClip; 183*4882a593Smuzhiyun Bool FreeCompositeClip; 184*4882a593Smuzhiyun XvAdaptorRecPrivatePtr AdaptorRec; 185*4882a593Smuzhiyun XvStatus isOn; 186*4882a593Smuzhiyun Bool moved; 187*4882a593Smuzhiyun int vid_x, vid_y, vid_w, vid_h; 188*4882a593Smuzhiyun int drw_x, drw_y, drw_w, drw_h; 189*4882a593Smuzhiyun DevUnion DevPriv; 190*4882a593Smuzhiyun } XvPortRecPrivate, *XvPortRecPrivatePtr; 191*4882a593Smuzhiyun 192*4882a593Smuzhiyun typedef struct _KdXVWindowRec { 193*4882a593Smuzhiyun XvPortRecPrivatePtr PortRec; 194*4882a593Smuzhiyun struct _KdXVWindowRec *next; 195*4882a593Smuzhiyun } KdXVWindowRec, *KdXVWindowPtr; 196*4882a593Smuzhiyun 197*4882a593Smuzhiyun #endif /* _XVDIX_H_ */ 198