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/programs/Xserver/Xext/xvdix.h,v 1.7 2001/05/07 21:37:51 tsi Exp $ */
|
---|
25 |
|
---|
26 | #ifndef XVDIX_H
|
---|
27 | #define XVDIX_H
|
---|
28 | /*
|
---|
29 | ** File:
|
---|
30 | **
|
---|
31 | ** xvdix.h --- Xv device independent header file
|
---|
32 | **
|
---|
33 | ** Author:
|
---|
34 | **
|
---|
35 | ** David Carver (Digital Workstation Engineering/Project Athena)
|
---|
36 | **
|
---|
37 | ** Revisions:
|
---|
38 | **
|
---|
39 | ** 29.08.91 Carver
|
---|
40 | ** - removed UnrealizeWindow wrapper unrealizing windows no longer
|
---|
41 | ** preempts video
|
---|
42 | **
|
---|
43 | ** 11.06.91 Carver
|
---|
44 | ** - changed SetPortControl to SetPortAttribute
|
---|
45 | ** - changed GetPortControl to GetPortAttribute
|
---|
46 | ** - changed QueryBestSize
|
---|
47 | **
|
---|
48 | ** 15.05.91 Carver
|
---|
49 | ** - version 2.0 upgrade
|
---|
50 | **
|
---|
51 | ** 24.01.91 Carver
|
---|
52 | ** - version 1.4 upgrade
|
---|
53 | **
|
---|
54 | */
|
---|
55 |
|
---|
56 | #include "scrnintstr.h"
|
---|
57 | #include <X11/extensions/Xvproto.h>
|
---|
58 |
|
---|
59 | extern int XvScreenIndex;
|
---|
60 | extern unsigned long XvExtensionGeneration;
|
---|
61 | extern unsigned long XvScreenGeneration;
|
---|
62 | extern unsigned long XvResourceGeneration;
|
---|
63 |
|
---|
64 | extern int XvReqCode;
|
---|
65 | extern int XvEventBase;
|
---|
66 | extern int XvErrorBase;
|
---|
67 |
|
---|
68 | extern unsigned long XvRTPort;
|
---|
69 | extern unsigned long XvRTEncoding;
|
---|
70 | extern unsigned long XvRTGrab;
|
---|
71 | extern unsigned long XvRTVideoNotify;
|
---|
72 | extern unsigned long XvRTVideoNotifyList;
|
---|
73 | extern unsigned long XvRTPortNotify;
|
---|
74 |
|
---|
75 | typedef struct {
|
---|
76 | int numerator;
|
---|
77 | int denominator;
|
---|
78 | } XvRationalRec, *XvRationalPtr;
|
---|
79 |
|
---|
80 | typedef struct {
|
---|
81 | char depth;
|
---|
82 | unsigned long visual;
|
---|
83 | } XvFormatRec, *XvFormatPtr;
|
---|
84 |
|
---|
85 | typedef struct {
|
---|
86 | unsigned long id;
|
---|
87 | ClientPtr client;
|
---|
88 | } XvGrabRec, *XvGrabPtr;
|
---|
89 |
|
---|
90 | typedef struct _XvVideoNotifyRec {
|
---|
91 | struct _XvVideoNotifyRec *next;
|
---|
92 | ClientPtr client;
|
---|
93 | unsigned long id;
|
---|
94 | unsigned long mask;
|
---|
95 | } XvVideoNotifyRec, *XvVideoNotifyPtr;
|
---|
96 |
|
---|
97 | typedef struct _XvPortNotifyRec {
|
---|
98 | struct _XvPortNotifyRec *next;
|
---|
99 | ClientPtr client;
|
---|
100 | unsigned long id;
|
---|
101 | } XvPortNotifyRec, *XvPortNotifyPtr;
|
---|
102 |
|
---|
103 | typedef struct {
|
---|
104 | int id;
|
---|
105 | ScreenPtr pScreen;
|
---|
106 | char *name;
|
---|
107 | unsigned short width, height;
|
---|
108 | XvRationalRec rate;
|
---|
109 | } XvEncodingRec, *XvEncodingPtr;
|
---|
110 |
|
---|
111 | typedef struct _XvAttributeRec {
|
---|
112 | int flags;
|
---|
113 | int min_value;
|
---|
114 | int max_value;
|
---|
115 | char *name;
|
---|
116 | } XvAttributeRec, *XvAttributePtr;
|
---|
117 |
|
---|
118 | typedef struct {
|
---|
119 | int id;
|
---|
120 | int type;
|
---|
121 | int byte_order;
|
---|
122 | char guid[16];
|
---|
123 | int bits_per_pixel;
|
---|
124 | int format;
|
---|
125 | int num_planes;
|
---|
126 |
|
---|
127 | /* for RGB formats only */
|
---|
128 | int depth;
|
---|
129 | unsigned int red_mask;
|
---|
130 | unsigned int green_mask;
|
---|
131 | unsigned int blue_mask;
|
---|
132 |
|
---|
133 | /* for YUV formats only */
|
---|
134 | unsigned int y_sample_bits;
|
---|
135 | unsigned int u_sample_bits;
|
---|
136 | unsigned int v_sample_bits;
|
---|
137 | unsigned int horz_y_period;
|
---|
138 | unsigned int horz_u_period;
|
---|
139 | unsigned int horz_v_period;
|
---|
140 | unsigned int vert_y_period;
|
---|
141 | unsigned int vert_u_period;
|
---|
142 | unsigned int vert_v_period;
|
---|
143 | char component_order[32];
|
---|
144 | int scanline_order;
|
---|
145 | } XvImageRec, *XvImagePtr;
|
---|
146 |
|
---|
147 | typedef struct {
|
---|
148 | unsigned long base_id;
|
---|
149 | unsigned char type;
|
---|
150 | char *name;
|
---|
151 | int nEncodings;
|
---|
152 | XvEncodingPtr pEncodings;
|
---|
153 | int nFormats;
|
---|
154 | XvFormatPtr pFormats;
|
---|
155 | int nAttributes;
|
---|
156 | XvAttributePtr pAttributes;
|
---|
157 | int nImages;
|
---|
158 | XvImagePtr pImages;
|
---|
159 | int nPorts;
|
---|
160 | struct _XvPortRec *pPorts;
|
---|
161 | ScreenPtr pScreen;
|
---|
162 | int (* ddAllocatePort)(unsigned long, struct _XvPortRec*,
|
---|
163 | struct _XvPortRec**);
|
---|
164 | int (* ddFreePort)(struct _XvPortRec*);
|
---|
165 | int (* ddPutVideo)(ClientPtr, DrawablePtr,struct _XvPortRec*, GCPtr,
|
---|
166 | INT16, INT16, CARD16, CARD16,
|
---|
167 | INT16, INT16, CARD16, CARD16);
|
---|
168 | int (* ddPutStill)(ClientPtr, DrawablePtr,struct _XvPortRec*, GCPtr,
|
---|
169 | INT16, INT16, CARD16, CARD16,
|
---|
170 | INT16, INT16, CARD16, CARD16);
|
---|
171 | int (* ddGetVideo)(ClientPtr, DrawablePtr,struct _XvPortRec*, GCPtr,
|
---|
172 | INT16, INT16, CARD16, CARD16,
|
---|
173 | INT16, INT16, CARD16, CARD16);
|
---|
174 | int (* ddGetStill)(ClientPtr, DrawablePtr,struct _XvPortRec*, GCPtr,
|
---|
175 | INT16, INT16, CARD16, CARD16,
|
---|
176 | INT16, INT16, CARD16, CARD16);
|
---|
177 | int (* ddStopVideo)(ClientPtr, struct _XvPortRec*, DrawablePtr);
|
---|
178 | int (* ddSetPortAttribute)(ClientPtr, struct _XvPortRec*, Atom, INT32);
|
---|
179 | int (* ddGetPortAttribute)(ClientPtr, struct _XvPortRec*, Atom, INT32*);
|
---|
180 | int (* ddQueryBestSize)(ClientPtr, struct _XvPortRec*, CARD8,
|
---|
181 | CARD16, CARD16,CARD16, CARD16,
|
---|
182 | unsigned int*, unsigned int*);
|
---|
183 | int (* ddPutImage)(ClientPtr, DrawablePtr, struct _XvPortRec*, GCPtr,
|
---|
184 | INT16, INT16, CARD16, CARD16,
|
---|
185 | INT16, INT16, CARD16, CARD16,
|
---|
186 | XvImagePtr, unsigned char*, Bool,
|
---|
187 | CARD16, CARD16);
|
---|
188 | int (* ddQueryImageAttributes)(ClientPtr, struct _XvPortRec*, XvImagePtr,
|
---|
189 | CARD16*, CARD16*, int*, int*);
|
---|
190 | DevUnion devPriv;
|
---|
191 | } XvAdaptorRec, *XvAdaptorPtr;
|
---|
192 |
|
---|
193 | typedef struct _XvPortRec {
|
---|
194 | unsigned long id;
|
---|
195 | XvAdaptorPtr pAdaptor;
|
---|
196 | XvPortNotifyPtr pNotify;
|
---|
197 | DrawablePtr pDraw;
|
---|
198 | ClientPtr client;
|
---|
199 | XvGrabRec grab;
|
---|
200 | TimeStamp time;
|
---|
201 | DevUnion devPriv;
|
---|
202 | } XvPortRec, *XvPortPtr;
|
---|
203 |
|
---|
204 | #define LOOKUP_PORT(_id, client)\
|
---|
205 | ((XvPortPtr)LookupIDByType(_id, XvRTPort))
|
---|
206 |
|
---|
207 | #define LOOKUP_ENCODING(_id, client)\
|
---|
208 | ((XvEncodingPtr)LookupIDByType(_id, XvRTEncoding))
|
---|
209 |
|
---|
210 | #define LOOKUP_VIDEONOTIFY_LIST(_id, client)\
|
---|
211 | ((XvVideoNotifyPtr)LookupIDByType(_id, XvRTVideoNotifyList))
|
---|
212 |
|
---|
213 | #define LOOKUP_PORTNOTIFY_LIST(_id, client)\
|
---|
214 | ((XvPortNotifyPtr)LookupIDByType(_id, XvRTPortNotifyList))
|
---|
215 |
|
---|
216 | typedef struct {
|
---|
217 | int version, revision;
|
---|
218 | int nAdaptors;
|
---|
219 | XvAdaptorPtr pAdaptors;
|
---|
220 | DestroyWindowProcPtr DestroyWindow;
|
---|
221 | DestroyPixmapProcPtr DestroyPixmap;
|
---|
222 | CloseScreenProcPtr CloseScreen;
|
---|
223 | Bool (* ddCloseScreen)(int, ScreenPtr);
|
---|
224 | int (* ddQueryAdaptors)(ScreenPtr, XvAdaptorPtr*, int*);
|
---|
225 | DevUnion devPriv;
|
---|
226 | } XvScreenRec, *XvScreenPtr;
|
---|
227 |
|
---|
228 | #define SCREEN_PROLOGUE(pScreen, field)\
|
---|
229 | ((pScreen)->field = \
|
---|
230 | ((XvScreenPtr) \
|
---|
231 | (pScreen)->devPrivates[XvScreenIndex].ptr)->field)
|
---|
232 |
|
---|
233 | #define SCREEN_EPILOGUE(pScreen, field, wrapper)\
|
---|
234 | ((pScreen)->field = wrapper)
|
---|
235 |
|
---|
236 | /* Errors */
|
---|
237 |
|
---|
238 | #define _XvBadPort (XvBadPort+XvErrorBase)
|
---|
239 | #define _XvBadEncoding (XvBadEncoding+XvErrorBase)
|
---|
240 |
|
---|
241 | extern int ProcXvDispatch(ClientPtr);
|
---|
242 | extern int SProcXvDispatch(ClientPtr);
|
---|
243 |
|
---|
244 | extern void XvExtensionInit(void);
|
---|
245 | extern int XvScreenInit(ScreenPtr);
|
---|
246 | extern int XvGetScreenIndex(void);
|
---|
247 | extern unsigned long XvGetRTPort(void);
|
---|
248 | extern int XvdiSendPortNotify(XvPortPtr, Atom, INT32);
|
---|
249 | extern int XvdiVideoStopped(XvPortPtr, int);
|
---|
250 |
|
---|
251 | extern int XvdiPutVideo(ClientPtr, DrawablePtr, XvPortPtr, GCPtr,
|
---|
252 | INT16, INT16, CARD16, CARD16,
|
---|
253 | INT16, INT16, CARD16, CARD16);
|
---|
254 | extern int XvdiPutStill(ClientPtr, DrawablePtr, XvPortPtr, GCPtr,
|
---|
255 | INT16, INT16, CARD16, CARD16,
|
---|
256 | INT16, INT16, CARD16, CARD16);
|
---|
257 | extern int XvdiGetVideo(ClientPtr, DrawablePtr, XvPortPtr, GCPtr,
|
---|
258 | INT16, INT16, CARD16, CARD16,
|
---|
259 | INT16, INT16, CARD16, CARD16);
|
---|
260 | extern int XvdiGetStill(ClientPtr, DrawablePtr, XvPortPtr, GCPtr,
|
---|
261 | INT16, INT16, CARD16, CARD16,
|
---|
262 | INT16, INT16, CARD16, CARD16);
|
---|
263 | extern int XvdiPutImage(ClientPtr, DrawablePtr, XvPortPtr, GCPtr,
|
---|
264 | INT16, INT16, CARD16, CARD16,
|
---|
265 | INT16, INT16, CARD16, CARD16,
|
---|
266 | XvImagePtr, unsigned char*, Bool,
|
---|
267 | CARD16, CARD16);
|
---|
268 | extern int XvdiSelectVideoNotify(ClientPtr, DrawablePtr, BOOL);
|
---|
269 | extern int XvdiSelectPortNotify(ClientPtr, XvPortPtr, BOOL);
|
---|
270 | extern int XvdiSetPortAttribute(ClientPtr, XvPortPtr, Atom, INT32);
|
---|
271 | extern int XvdiGetPortAttribute(ClientPtr, XvPortPtr, Atom, INT32*);
|
---|
272 | extern int XvdiStopVideo(ClientPtr, XvPortPtr, DrawablePtr);
|
---|
273 | extern int XvdiPreemptVideo(ClientPtr, XvPortPtr, DrawablePtr);
|
---|
274 | extern int XvdiMatchPort(XvPortPtr, DrawablePtr);
|
---|
275 | extern int XvdiGrabPort(ClientPtr, XvPortPtr, Time, int *);
|
---|
276 | extern int XvdiUngrabPort( ClientPtr, XvPortPtr, Time);
|
---|
277 |
|
---|
278 |
|
---|
279 | #if !defined(UNIXCPP)
|
---|
280 |
|
---|
281 | #define XVCALL(name) Xv##name
|
---|
282 |
|
---|
283 | #else
|
---|
284 |
|
---|
285 | #define XVCALL(name) Xv/**/name
|
---|
286 |
|
---|
287 | #endif
|
---|
288 |
|
---|
289 |
|
---|
290 | #endif /* XVDIX_H */
|
---|
291 |
|
---|