3
XFree86 Xv DDX written by Mark Vojkovich (markv@valinux.com)
4
Adapted for KDrive by Pontus Lidman <pontus.lidman@nokia.com>
6
Copyright (C) 2000, 2001 - Nokia Home Communications
7
Copyright (C) 1998, 1999 - The XFree86 Project Inc.
11
Permission is hereby granted, free of charge, to any person obtaining
12
a copy of this software and associated documentation files (the
13
"Software"), to deal in the Software without restriction, including
14
without limitation the rights to use, copy, modify, merge, publish,
15
distribute, and/or sell copies of the Software, and to permit persons
16
to whom the Software is furnished to do so, provided that the above
17
copyright notice(s) and this permission notice appear in all copies of
18
the Software and that both the above copyright notice(s) and this
19
permission notice appear in supporting documentation.
21
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
24
OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
25
HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY
26
SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER
27
RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
28
CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
29
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
31
Except as contained in this notice, the name of a copyright holder
32
shall not be used in advertising or otherwise to promote the sale, use
33
or other dealings in this Software without prior written authorization
34
of the copyright holder.
38
/* $RCSId: xc/programs/Xserver/hw/kdrive/kxv.h,v 1.1 2001/03/30 02:18:41 keithp Exp $ */
43
#include "scrnintstr.h"
44
#include "regionstr.h"
45
#include "windowstr.h"
46
#include "pixmapstr.h"
47
#include "mivalidate.h"
51
#include "dixstruct.h"
53
#include "../../Xext/xvdix.h"
55
#define VIDEO_NO_CLIPPING 0x00000001
56
#define VIDEO_INVERT_CLIPLIST 0x00000002
57
#define VIDEO_OVERLAID_IMAGES 0x00000004
58
#define VIDEO_OVERLAID_STILLS 0x00000008
59
#define VIDEO_CLIP_TO_VIEWPORT 0x00000010
65
unsigned char guid[16];
70
/* for RGB formats only */
72
unsigned int red_mask;
73
unsigned int green_mask;
74
unsigned int blue_mask;
76
/* for YUV formats only */
77
unsigned int y_sample_bits;
78
unsigned int u_sample_bits;
79
unsigned int v_sample_bits;
80
unsigned int horz_y_period;
81
unsigned int horz_u_period;
82
unsigned int horz_v_period;
83
unsigned int vert_y_period;
84
unsigned int vert_u_period;
85
unsigned int vert_v_period;
86
char component_order[32];
88
} KdImageRec, *KdImagePtr;
92
KdScreenInfo * screen;
94
unsigned short width, height;
95
int *pitches; /* bytes */
96
int *offsets; /* in bytes from start of framebuffer */
98
} KdSurfaceRec, *KdSurfacePtr;
101
typedef int (* PutVideoFuncPtr)( KdScreenInfo * screen, DrawablePtr pDraw,
102
short vid_x, short vid_y, short drw_x, short drw_y,
103
short vid_w, short vid_h, short drw_w, short drw_h,
104
RegionPtr clipBoxes, pointer data );
105
typedef int (* PutStillFuncPtr)( KdScreenInfo * screen, DrawablePtr pDraw,
106
short vid_x, short vid_y, short drw_x, short drw_y,
107
short vid_w, short vid_h, short drw_w, short drw_h,
108
RegionPtr clipBoxes, pointer data );
109
typedef int (* GetVideoFuncPtr)( KdScreenInfo * screen, DrawablePtr pDraw,
110
short vid_x, short vid_y, short drw_x, short drw_y,
111
short vid_w, short vid_h, short drw_w, short drw_h,
112
RegionPtr clipBoxes, pointer data );
113
typedef int (* GetStillFuncPtr)( KdScreenInfo * screen, DrawablePtr pDraw,
114
short vid_x, short vid_y, short drw_x, short drw_y,
115
short vid_w, short vid_h, short drw_w, short drw_h,
116
RegionPtr clipBoxes, pointer data );
117
typedef void (* StopVideoFuncPtr)(KdScreenInfo * screen, pointer data, Bool Exit);
118
typedef int (* SetPortAttributeFuncPtr)(KdScreenInfo * screen, Atom attribute,
119
int value, pointer data);
120
typedef int (* GetPortAttributeFuncPtr)(KdScreenInfo * screen, Atom attribute,
121
int *value, pointer data);
122
typedef void (* QueryBestSizeFuncPtr)(KdScreenInfo * screen, Bool motion,
123
short vid_w, short vid_h, short drw_w, short drw_h,
124
unsigned int *p_w, unsigned int *p_h, pointer data);
125
typedef int (* PutImageFuncPtr)( KdScreenInfo * screen, DrawablePtr pDraw,
126
short src_x, short src_y, short drw_x, short drw_y,
127
short src_w, short src_h, short drw_w, short drw_h,
128
int image, unsigned char* buf, short width, short height, Bool Sync,
129
RegionPtr clipBoxes, pointer data );
130
typedef int (* ReputImageFuncPtr)( KdScreenInfo * screen, DrawablePtr pDraw,
131
short drw_x, short drw_y,
132
RegionPtr clipBoxes, pointer data );
133
typedef int (*QueryImageAttributesFuncPtr)(KdScreenInfo * screen,
134
int image, unsigned short *width, unsigned short *height,
135
int *pitches, int *offsets);
143
/*** this is what the driver needs to fill out ***/
148
unsigned short width, height;
150
} KdVideoEncodingRec, *KdVideoEncodingPtr;
155
} KdVideoFormatRec, *KdVideoFormatPtr;
162
} KdAttributeRec, *KdAttributePtr;
169
KdVideoEncodingPtr pEncodings;
171
KdVideoFormatPtr pFormats;
173
DevUnion *pPortPrivates;
175
KdAttributePtr pAttributes;
178
PutVideoFuncPtr PutVideo;
179
PutStillFuncPtr PutStill;
180
GetVideoFuncPtr GetVideo;
181
GetStillFuncPtr GetStill;
182
StopVideoFuncPtr StopVideo;
183
SetPortAttributeFuncPtr SetPortAttribute;
184
GetPortAttributeFuncPtr GetPortAttribute;
185
QueryBestSizeFuncPtr QueryBestSize;
186
PutImageFuncPtr PutImage;
187
ReputImageFuncPtr ReputImage;
188
QueryImageAttributesFuncPtr QueryImageAttributes;
189
} KdVideoAdaptorRec, *KdVideoAdaptorPtr;
194
int (*alloc_surface)(KdScreenInfo * screen,
196
unsigned short width,
197
unsigned short height,
198
KdSurfacePtr surface);
199
int (*free_surface)(KdSurfacePtr surface);
200
int (*display) (KdSurfacePtr surface,
201
short vid_x, short vid_y,
202
short drw_x, short drw_y,
203
short vid_w, short vid_h,
204
short drw_w, short drw_h,
205
RegionPtr clipBoxes);
206
int (*stop) (KdSurfacePtr surface);
207
int (*getAttribute) (KdScreenInfo * screen, Atom attr, INT32 *value);
208
int (*setAttribute) (KdScreenInfo * screen, Atom attr, INT32 value);
212
KdAttributePtr attributes;
213
} KdOffscreenImageRec, *KdOffscreenImagePtr;
218
KdVideoAdaptorPtr *Adaptors,
222
typedef int (* KdXVInitGenericAdaptorPtr)(KdScreenInfo * screen,
223
KdVideoAdaptorPtr **Adaptors);
226
KdXVRegisterGenericAdaptorDriver(
227
KdXVInitGenericAdaptorPtr InitFunc
231
KdXVListGenericAdaptors(
232
KdScreenInfo * screen,
233
KdVideoAdaptorPtr **Adaptors
237
KdXVRegisterOffscreenImages(
239
KdOffscreenImagePtr images,
244
KdXVQueryOffscreenImages(
250
KdXVCopyPackedData(KdScreenInfo *screen, CARD8 *src, CARD8 *dst, int randr,
251
int srcPitch, int dstPitch, int srcW, int srcH, int top, int left,
255
KdXVCopyPlanarData(KdScreenInfo *screen, CARD8 *src, CARD8 *dst, int randr,
256
int srcPitch, int srcPitch2, int dstPitch, int srcW, int srcH, int height,
257
int top, int left, int h, int w, int id);
260
KXVPaintRegion (DrawablePtr pDraw, RegionPtr pRgn, Pixel fg);
262
KdVideoAdaptorPtr KdXVAllocateVideoAdaptorRec(KdScreenInfo * screen);
264
void KdXVFreeVideoAdaptorRec(KdVideoAdaptorPtr ptr);
266
/* Must be called from KdCardInfo functions, can be called without Xv enabled */
267
Bool KdXVEnable(ScreenPtr);
268
void KdXVDisable(ScreenPtr);
270
/*** These are DDX layer privates ***/
274
CreateWindowProcPtr CreateWindow;
275
DestroyWindowProcPtr DestroyWindow;
276
ClipNotifyProcPtr ClipNotify;
277
WindowExposuresProcPtr WindowExposures;
278
} KdXVScreenRec, *KdXVScreenPtr;
282
PutVideoFuncPtr PutVideo;
283
PutStillFuncPtr PutStill;
284
GetVideoFuncPtr GetVideo;
285
GetStillFuncPtr GetStill;
286
StopVideoFuncPtr StopVideo;
287
SetPortAttributeFuncPtr SetPortAttribute;
288
GetPortAttributeFuncPtr GetPortAttribute;
289
QueryBestSizeFuncPtr QueryBestSize;
290
PutImageFuncPtr PutImage;
291
ReputImageFuncPtr ReputImage;
292
QueryImageAttributesFuncPtr QueryImageAttributes;
293
} XvAdaptorRecPrivate, *XvAdaptorRecPrivatePtr;
296
KdScreenInfo * screen;
299
unsigned int subWindowMode;
301
RegionPtr clientClip;
302
RegionPtr pCompositeClip;
303
Bool FreeCompositeClip;
304
XvAdaptorRecPrivatePtr AdaptorRec;
307
int vid_x, vid_y, vid_w, vid_h;
308
int drw_x, drw_y, drw_w, drw_h;
310
} XvPortRecPrivate, *XvPortRecPrivatePtr;
312
typedef struct _KdXVWindowRec{
313
XvPortRecPrivatePtr PortRec;
314
struct _KdXVWindowRec *next;
315
} KdXVWindowRec, *KdXVWindowPtr;
317
#endif /* _XVDIX_H_ */