comparison src/video/Xext/extensions/Xvlib.h @ 1662:782fd950bd46 SDL-1.3

Revamp of the video system in progress - adding support for multiple displays, multiple windows, and a full video mode selection API. WARNING: None of the video drivers have been updated for the new API yet! The API is still under design and very fluid. The code is now run through a consistent indent format: indent -i4 -nut -nsc -br -ce The headers are being converted to automatically generate doxygen documentation.
author Sam Lantinga <slouken@libsdl.org>
date Sun, 28 May 2006 13:04:16 +0000
parents 19418e4422cb
children 4da1ee79c9af
comparison
equal deleted inserted replaced
1661:281d3f4870e5 1662:782fd950bd46
55 55
56 #include <X11/Xfuncproto.h> 56 #include <X11/Xfuncproto.h>
57 #include "Xv.h" 57 #include "Xv.h"
58 #include "SDL_name.h" 58 #include "SDL_name.h"
59 59
60 typedef struct { 60 typedef struct
61 int numerator; 61 {
62 int denominator; 62 int numerator;
63 } SDL_NAME(XvRational); 63 int denominator;
64 64 } SDL_NAME (XvRational);
65 typedef struct { 65
66 int flags; /* XvGettable, XvSettable */ 66 typedef struct
67 int min_value; 67 {
68 int max_value; 68 int flags; /* XvGettable, XvSettable */
69 char *name; 69 int min_value;
70 } SDL_NAME(XvAttribute); 70 int max_value;
71 71 char *name;
72 typedef struct { 72 } SDL_NAME (XvAttribute);
73 XvEncodingID encoding_id; 73
74 char *name; 74 typedef struct
75 unsigned long width; 75 {
76 unsigned long height; 76 XvEncodingID encoding_id;
77 SDL_NAME(XvRational) rate; 77 char *name;
78 unsigned long num_encodings; 78 unsigned long width;
79 } SDL_NAME(XvEncodingInfo); 79 unsigned long height;
80 80 SDL_NAME (XvRational) rate;
81 typedef struct { 81 unsigned long num_encodings;
82 char depth; 82 } SDL_NAME (XvEncodingInfo);
83 unsigned long visual_id; 83
84 } SDL_NAME(XvFormat); 84 typedef struct
85 85 {
86 typedef struct { 86 char depth;
87 XvPortID base_id; 87 unsigned long visual_id;
88 unsigned long num_ports; 88 } SDL_NAME (XvFormat);
89 char type; 89
90 char *name; 90 typedef struct
91 unsigned long num_formats; 91 {
92 SDL_NAME(XvFormat) *formats; 92 XvPortID base_id;
93 unsigned long num_adaptors; 93 unsigned long num_ports;
94 } SDL_NAME(XvAdaptorInfo); 94 char type;
95 95 char *name;
96 typedef struct { 96 unsigned long num_formats;
97 int type; 97 SDL_NAME (XvFormat) * formats;
98 unsigned long serial; /* # of last request processed by server */ 98 unsigned long num_adaptors;
99 Bool send_event; /* true if this came from a SendEvent request */ 99 } SDL_NAME (XvAdaptorInfo);
100 Display *display; /* Display the event was read from */ 100
101 Drawable drawable; /* drawable */ 101 typedef struct
102 unsigned long reason; /* what generated this event */ 102 {
103 XvPortID port_id; /* what port */ 103 int type;
104 Time time; /* milliseconds */ 104 unsigned long serial; /* # of last request processed by server */
105 } SDL_NAME(XvVideoNotifyEvent); 105 Bool send_event; /* true if this came from a SendEvent request */
106 106 Display *display; /* Display the event was read from */
107 typedef struct { 107 Drawable drawable; /* drawable */
108 int type; 108 unsigned long reason; /* what generated this event */
109 unsigned long serial; /* # of last request processed by server */ 109 XvPortID port_id; /* what port */
110 Bool send_event; /* true if this came from a SendEvent request */ 110 Time time; /* milliseconds */
111 Display *display; /* Display the event was read from */ 111 } SDL_NAME (XvVideoNotifyEvent);
112 XvPortID port_id; /* what port */ 112
113 Time time; /* milliseconds */ 113 typedef struct
114 Atom attribute; /* atom that identifies attribute */ 114 {
115 long value; /* value of attribute */ 115 int type;
116 } SDL_NAME(XvPortNotifyEvent); 116 unsigned long serial; /* # of last request processed by server */
117 117 Bool send_event; /* true if this came from a SendEvent request */
118 typedef union { 118 Display *display; /* Display the event was read from */
119 int type; 119 XvPortID port_id; /* what port */
120 SDL_NAME(XvVideoNotifyEvent) xvvideo; 120 Time time; /* milliseconds */
121 SDL_NAME(XvPortNotifyEvent) xvport; 121 Atom attribute; /* atom that identifies attribute */
122 long pad[24]; 122 long value; /* value of attribute */
123 } SDL_NAME(XvEvent); 123 } SDL_NAME (XvPortNotifyEvent);
124 124
125 typedef struct { 125 typedef union
126 int id; /* Unique descriptor for the format */ 126 {
127 int type; /* XvRGB, XvYUV */ 127 int type;
128 int byte_order; /* LSBFirst, MSBFirst */ 128 SDL_NAME (XvVideoNotifyEvent) xvvideo;
129 char guid[16]; /* Globally Unique IDentifier */ 129 SDL_NAME (XvPortNotifyEvent) xvport;
130 int bits_per_pixel; 130 long pad[24];
131 int format; /* XvPacked, XvPlanar */ 131 } SDL_NAME (XvEvent);
132 int num_planes; 132
133 133 typedef struct
134 /* for RGB formats only */ 134 {
135 int depth; 135 int id; /* Unique descriptor for the format */
136 unsigned int red_mask; 136 int type; /* XvRGB, XvYUV */
137 unsigned int green_mask; 137 int byte_order; /* LSBFirst, MSBFirst */
138 unsigned int blue_mask; 138 char guid[16]; /* Globally Unique IDentifier */
139 139 int bits_per_pixel;
140 /* for YUV formats only */ 140 int format; /* XvPacked, XvPlanar */
141 unsigned int y_sample_bits; 141 int num_planes;
142 unsigned int u_sample_bits; 142
143 unsigned int v_sample_bits; 143 /* for RGB formats only */
144 unsigned int horz_y_period; 144 int depth;
145 unsigned int horz_u_period; 145 unsigned int red_mask;
146 unsigned int horz_v_period; 146 unsigned int green_mask;
147 unsigned int vert_y_period; 147 unsigned int blue_mask;
148 unsigned int vert_u_period; 148
149 unsigned int vert_v_period; 149 /* for YUV formats only */
150 char component_order[32]; /* eg. UYVY */ 150 unsigned int y_sample_bits;
151 int scanline_order; /* XvTopToBottom, XvBottomToTop */ 151 unsigned int u_sample_bits;
152 } SDL_NAME(XvImageFormatValues); 152 unsigned int v_sample_bits;
153 153 unsigned int horz_y_period;
154 typedef struct { 154 unsigned int horz_u_period;
155 int id; 155 unsigned int horz_v_period;
156 int width, height; 156 unsigned int vert_y_period;
157 int data_size; /* bytes */ 157 unsigned int vert_u_period;
158 int num_planes; 158 unsigned int vert_v_period;
159 int *pitches; /* bytes */ 159 char component_order[32]; /* eg. UYVY */
160 int *offsets; /* bytes */ 160 int scanline_order; /* XvTopToBottom, XvBottomToTop */
161 char *data; 161 } SDL_NAME (XvImageFormatValues);
162 XPointer obdata; 162
163 } SDL_NAME(XvImage); 163 typedef struct
164 164 {
165 _XFUNCPROTOBEGIN 165 int id;
166 166 int width, height;
167 extern int SDL_NAME(XvQueryExtension)( 167 int data_size; /* bytes */
168 #if NeedFunctionPrototypes 168 int num_planes;
169 Display* /* display */, 169 int *pitches; /* bytes */
170 unsigned int* /* p_version */, 170 int *offsets; /* bytes */
171 unsigned int* /* p_revision */, 171 char *data;
172 unsigned int* /* p_requestBase */, 172 XPointer obdata;
173 unsigned int* /* p_eventBase */, 173 } SDL_NAME (XvImage);
174 unsigned int* /* p_errorBase */ 174
175 #endif 175 _XFUNCPROTOBEGIN extern int SDL_NAME (XvQueryExtension) (
176 ); 176 #if NeedFunctionPrototypes
177 177 Display *
178 extern int SDL_NAME(XvQueryAdaptors)( 178 /* display */ ,
179 #if NeedFunctionPrototypes 179 unsigned int *
180 Display* /* display */, 180 /* p_version */ ,
181 Window /* window */, 181 unsigned int *
182 unsigned int* /* p_nAdaptors */, 182 /* p_revision */ ,
183 SDL_NAME(XvAdaptorInfo)** /* p_pAdaptors */ 183 unsigned int *
184 #endif 184 /* p_requestBase */
185 ); 185 , unsigned int *
186 186 /* p_eventBase */
187 extern int SDL_NAME(XvQueryEncodings)( 187 , unsigned int * /* p_errorBase */
188 #if NeedFunctionPrototypes 188 #endif
189 Display* /* display */, 189 );
190 XvPortID /* port */, 190
191 unsigned int* /* p_nEncoding */, 191 extern int SDL_NAME (XvQueryAdaptors) (
192 SDL_NAME(XvEncodingInfo)** /* p_pEncoding */ 192 #if NeedFunctionPrototypes
193 #endif 193 Display * /* display */ ,
194 ); 194 Window /* window */ ,
195 195 unsigned int * /* p_nAdaptors */ ,
196 extern int SDL_NAME(XvPutVideo)( 196 SDL_NAME (XvAdaptorInfo) ** /* p_pAdaptors */
197 #if NeedFunctionPrototypes 197 #endif
198 Display* /* display */, 198 );
199 XvPortID /* port */, 199
200 Drawable /* d */, 200 extern int SDL_NAME (XvQueryEncodings) (
201 GC /* gc */, 201 #if NeedFunctionPrototypes
202 int /* vx */, 202 Display * /* display */ ,
203 int /* vy */, 203 XvPortID /* port */ ,
204 unsigned int /* vw */, 204 unsigned int * /* p_nEncoding */ ,
205 unsigned int /* vh */, 205 SDL_NAME (XvEncodingInfo) ** /* p_pEncoding */
206 int /* dx */, 206 #endif
207 int /* dy */, 207 );
208 unsigned int /* dw */, 208
209 unsigned int /* dh */ 209 extern int SDL_NAME (XvPutVideo) (
210 #endif 210 #if NeedFunctionPrototypes
211 ); 211 Display * /* display */ ,
212 212 XvPortID /* port */ ,
213 extern int SDL_NAME(XvPutStill)( 213 Drawable /* d */ ,
214 #if NeedFunctionPrototypes 214 GC /* gc */ ,
215 Display* /* display */, 215 int /* vx */ ,
216 XvPortID /* port */, 216 int /* vy */ ,
217 Drawable /* d */, 217 unsigned int /* vw */ ,
218 GC /* gc */, 218 unsigned int /* vh */ ,
219 int /* vx */, 219 int /* dx */ ,
220 int /* vy */, 220 int /* dy */ ,
221 unsigned int /* vw */, 221 unsigned int /* dw */ ,
222 unsigned int /* vh */, 222 unsigned int /* dh */
223 int /* dx */, 223 #endif
224 int /* dy */, 224 );
225 unsigned int /* dw */, 225
226 unsigned int /* dh */ 226 extern int SDL_NAME (XvPutStill) (
227 #endif 227 #if NeedFunctionPrototypes
228 ); 228 Display * /* display */ ,
229 229 XvPortID /* port */ ,
230 extern int SDL_NAME(XvGetVideo)( 230 Drawable /* d */ ,
231 #if NeedFunctionPrototypes 231 GC /* gc */ ,
232 Display* /* display */, 232 int /* vx */ ,
233 XvPortID /* port */, 233 int /* vy */ ,
234 Drawable /* d */, 234 unsigned int /* vw */ ,
235 GC /* gc */, 235 unsigned int /* vh */ ,
236 int /* vx */, 236 int /* dx */ ,
237 int /* vy */, 237 int /* dy */ ,
238 unsigned int /* vw */, 238 unsigned int /* dw */ ,
239 unsigned int /* vh */, 239 unsigned int /* dh */
240 int /* dx */, 240 #endif
241 int /* dy */, 241 );
242 unsigned int /* dw */, 242
243 unsigned int /* dh */ 243 extern int SDL_NAME (XvGetVideo) (
244 #endif 244 #if NeedFunctionPrototypes
245 ); 245 Display * /* display */ ,
246 246 XvPortID /* port */ ,
247 extern int SDL_NAME(XvGetStill)( 247 Drawable /* d */ ,
248 #if NeedFunctionPrototypes 248 GC /* gc */ ,
249 Display* /* display */, 249 int /* vx */ ,
250 XvPortID /* port */, 250 int /* vy */ ,
251 Drawable /* d */, 251 unsigned int /* vw */ ,
252 GC /* gc */, 252 unsigned int /* vh */ ,
253 int /* vx */, 253 int /* dx */ ,
254 int /* vy */, 254 int /* dy */ ,
255 unsigned int /* vw */, 255 unsigned int /* dw */ ,
256 unsigned int /* vh */, 256 unsigned int /* dh */
257 int /* dx */, 257 #endif
258 int /* dy */, 258 );
259 unsigned int /* dw */, 259
260 unsigned int /* dh */ 260 extern int SDL_NAME (XvGetStill) (
261 #endif 261 #if NeedFunctionPrototypes
262 ); 262 Display * /* display */ ,
263 263 XvPortID /* port */ ,
264 extern int SDL_NAME(XvStopVideo)( 264 Drawable /* d */ ,
265 #if NeedFunctionPrototypes 265 GC /* gc */ ,
266 Display* /* display */, 266 int /* vx */ ,
267 XvPortID /* port */, 267 int /* vy */ ,
268 Drawable /* drawable */ 268 unsigned int /* vw */ ,
269 #endif 269 unsigned int /* vh */ ,
270 ); 270 int /* dx */ ,
271 271 int /* dy */ ,
272 extern int SDL_NAME(XvGrabPort)( 272 unsigned int /* dw */ ,
273 #if NeedFunctionPrototypes 273 unsigned int /* dh */
274 Display* /* display */, 274 #endif
275 XvPortID /* port */, 275 );
276 Time /* time */ 276
277 #endif 277 extern int SDL_NAME (XvStopVideo) (
278 ); 278 #if NeedFunctionPrototypes
279 279 Display * /* display */ ,
280 extern int SDL_NAME(XvUngrabPort)( 280 XvPortID /* port */ ,
281 #if NeedFunctionPrototypes 281 Drawable /* drawable */
282 Display* /* display */, 282 #endif
283 XvPortID /* port */, 283 );
284 Time /* time */ 284
285 #endif 285 extern int SDL_NAME (XvGrabPort) (
286 ); 286 #if NeedFunctionPrototypes
287 287 Display * /* display */ ,
288 extern int SDL_NAME(XvSelectVideoNotify)( 288 XvPortID /* port */ ,
289 #if NeedFunctionPrototypes 289 Time /* time */
290 Display* /* display */, 290 #endif
291 Drawable /* drawable */, 291 );
292 Bool /* onoff */ 292
293 #endif 293 extern int SDL_NAME (XvUngrabPort) (
294 ); 294 #if NeedFunctionPrototypes
295 295 Display * /* display */ ,
296 extern int SDL_NAME(XvSelectPortNotify)( 296 XvPortID /* port */ ,
297 #if NeedFunctionPrototypes 297 Time /* time */
298 Display* /* display */, 298 #endif
299 XvPortID /* port */, 299 );
300 Bool /* onoff */ 300
301 #endif 301 extern int SDL_NAME (XvSelectVideoNotify) (
302 ); 302 #if NeedFunctionPrototypes
303 303 Display * /* display */ ,
304 extern int SDL_NAME(XvSetPortAttribute)( 304 Drawable /* drawable */ ,
305 #if NeedFunctionPrototypes 305 Bool /* onoff */
306 Display* /* display */, 306 #endif
307 XvPortID /* port */, 307 );
308 Atom /* attribute */, 308
309 int /* value */ 309 extern int SDL_NAME (XvSelectPortNotify) (
310 #endif 310 #if NeedFunctionPrototypes
311 ); 311 Display * /* display */ ,
312 312 XvPortID /* port */ ,
313 extern int SDL_NAME(XvGetPortAttribute)( 313 Bool /* onoff */
314 #if NeedFunctionPrototypes 314 #endif
315 Display* /* display */, 315 );
316 XvPortID /* port */, 316
317 Atom /* attribute */, 317 extern int SDL_NAME (XvSetPortAttribute) (
318 int* /* p_value */ 318 #if NeedFunctionPrototypes
319 #endif 319 Display * /* display */ ,
320 ); 320 XvPortID /* port */ ,
321 321 Atom /* attribute */ ,
322 extern int SDL_NAME(XvQueryBestSize)( 322 int /* value */
323 #if NeedFunctionPrototypes 323 #endif
324 Display* /* display */, 324 );
325 XvPortID /* port */, 325
326 Bool /* motion */, 326 extern int SDL_NAME (XvGetPortAttribute) (
327 unsigned int /* vid_w */, 327 #if NeedFunctionPrototypes
328 unsigned int /* vid_h */, 328 Display * /* display */ ,
329 unsigned int /* drw_w */, 329 XvPortID /* port */ ,
330 unsigned int /* drw_h */, 330 Atom /* attribute */ ,
331 unsigned int* /* p_actual_width */, 331 int * /* p_value */
332 unsigned int* /* p_actual_width */ 332 #endif
333 #endif 333 );
334 ); 334
335 335 extern int SDL_NAME (XvQueryBestSize) (
336 extern SDL_NAME(XvAttribute)* SDL_NAME(XvQueryPortAttributes)( 336 #if NeedFunctionPrototypes
337 #if NeedFunctionPrototypes 337 Display * /* display */ ,
338 Display* /* display */, 338 XvPortID /* port */ ,
339 XvPortID /* port */, 339 Bool /* motion */ ,
340 int* /* number */ 340 unsigned int /* vid_w */ ,
341 #endif 341 unsigned int /* vid_h */ ,
342 ); 342 unsigned int /* drw_w */ ,
343 343 unsigned int /* drw_h */ ,
344 344 unsigned int * /* p_actual_width */
345 extern void SDL_NAME(XvFreeAdaptorInfo)( 345 , unsigned int * /* p_actual_width */
346 #if NeedFunctionPrototypes 346 #endif
347 SDL_NAME(XvAdaptorInfo)* /* adaptors */ 347 );
348 #endif 348
349 ); 349 extern
350 350 SDL_NAME (XvAttribute) *
351 extern void SDL_NAME(XvFreeEncodingInfo)( 351 SDL_NAME (XvQueryPortAttributes) (
352 #if NeedFunctionPrototypes 352 #if NeedFunctionPrototypes
353 SDL_NAME(XvEncodingInfo)* /* encodings */ 353 Display * /* display */ ,
354 #endif 354 XvPortID /* port */ ,
355 ); 355 int * /* number */
356 356 #endif
357 357 );
358 extern SDL_NAME(XvImageFormatValues) * SDL_NAME(XvListImageFormats) ( 358
359 #if NeedFunctionPrototypes 359
360 Display *display, 360 extern void SDL_NAME (XvFreeAdaptorInfo) (
361 XvPortID port_id, 361 #if NeedFunctionPrototypes
362 int *count_return 362 SDL_NAME (XvAdaptorInfo) * /* adaptors */
363 #endif 363 #endif
364 ); 364 );
365 365
366 extern SDL_NAME(XvImage) * SDL_NAME(XvCreateImage) ( 366 extern void SDL_NAME (XvFreeEncodingInfo) (
367 #if NeedFunctionPrototypes 367 #if NeedFunctionPrototypes
368 Display *display, 368 SDL_NAME (XvEncodingInfo) * /* encodings */
369 XvPortID port, 369 #endif
370 int id, 370 );
371 char *data, 371
372 int width, 372
373 int height 373 extern SDL_NAME (XvImageFormatValues) * SDL_NAME (XvListImageFormats) (
374 #endif 374 #if NeedFunctionPrototypes
375 ); 375 Display
376 376 *
377 extern int SDL_NAME(XvPutImage) ( 377 display,
378 #if NeedFunctionPrototypes 378 XvPortID
379 Display *display, 379 port_id,
380 XvPortID id, 380 int
381 Drawable d, 381 *count_return
382 GC gc, 382 #endif
383 SDL_NAME(XvImage) *image, 383 );
384 int src_x, 384
385 int src_y, 385 extern SDL_NAME (XvImage) * SDL_NAME (XvCreateImage) (
386 unsigned int src_w, 386 #if NeedFunctionPrototypes
387 unsigned int src_h, 387 Display *
388 int dest_x, 388 display,
389 int dest_y, 389 XvPortID port,
390 unsigned int dest_w, 390 int id,
391 unsigned int dest_h 391 char *data,
392 #endif 392 int width,
393 ); 393 int height
394 394 #endif
395 extern int SDL_NAME(XvShmPutImage) ( 395 );
396 #if NeedFunctionPrototypes 396
397 Display *display, 397 extern int SDL_NAME (XvPutImage) (
398 XvPortID id, 398 #if NeedFunctionPrototypes
399 Drawable d, 399 Display * display,
400 GC gc, 400 XvPortID id,
401 SDL_NAME(XvImage) *image, 401 Drawable d,
402 int src_x, 402 GC gc,
403 int src_y, 403 SDL_NAME (XvImage) * image,
404 unsigned int src_w, 404 int src_x,
405 unsigned int src_h, 405 int src_y,
406 int dest_x, 406 unsigned int src_w,
407 int dest_y, 407 unsigned int src_h,
408 unsigned int dest_w, 408 int dest_x,
409 unsigned int dest_h, 409 int dest_y,
410 Bool send_event 410 unsigned int dest_w,
411 #endif 411 unsigned int dest_h
412 ); 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 );
413 433
414 #ifdef _XSHM_H_ 434 #ifdef _XSHM_H_
415 435
416 extern SDL_NAME(XvImage) * SDL_NAME(XvShmCreateImage) ( 436 extern SDL_NAME (XvImage) * SDL_NAME (XvShmCreateImage) (
417 #if NeedFunctionPrototypes 437 #if NeedFunctionPrototypes
418 Display *display, 438 Display *
419 XvPortID port, 439 display,
420 int id, 440 XvPortID
421 char* data, 441 port, int id,
422 int width, 442 char *data,
423 int height, 443 int width,
424 XShmSegmentInfo *shminfo 444 int height,
425 #endif 445 XShmSegmentInfo
426 ); 446 * shminfo
447 #endif
448 );
427 449
428 #endif 450 #endif
429 451
430 452
431 _XFUNCPROTOEND 453 _XFUNCPROTOEND
432
433 #endif /* XVLIB_H */ 454 #endif /* XVLIB_H */
455 /* vi: set ts=4 sw=4 expandtab: */