comparison src/video/Xext/extensions/Xvlib.h @ 1895:c121d94672cb

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