| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | #ifndef XVLIB_H |
| 26 | #define XVLIB_H |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | #include <X11/Xfuncproto.h> |
| 56 | #include <X11/extensions/Xv.h> |
| 57 | #include <X11/extensions/XShm.h> |
| 58 | |
| 59 | typedef struct { |
| 60 | int numerator; |
| 61 | int denominator; |
| 62 | } XvRational; |
| 63 | |
| 64 | typedef struct { |
| 65 | int flags; |
| 66 | int min_value; |
| 67 | int max_value; |
| 68 | char *name; |
| 69 | } XvAttribute; |
| 70 | |
| 71 | typedef struct { |
| 72 | XvEncodingID encoding_id; |
| 73 | char *name; |
| 74 | unsigned long width; |
| 75 | unsigned long height; |
| 76 | XvRational rate; |
| 77 | unsigned long num_encodings; |
| 78 | } XvEncodingInfo; |
| 79 | |
| 80 | typedef struct { |
| 81 | char depth; |
| 82 | unsigned long visual_id; |
| 83 | } XvFormat; |
| 84 | |
| 85 | typedef struct { |
| 86 | XvPortID base_id; |
| 87 | unsigned long num_ports; |
| 88 | char type; |
| 89 | char *name; |
| 90 | unsigned long num_formats; |
| 91 | XvFormat *formats; |
| 92 | unsigned long num_adaptors; |
| 93 | } XvAdaptorInfo; |
| 94 | |
| 95 | typedef struct { |
| 96 | int type; |
| 97 | unsigned long serial; |
| 98 | Bool send_event; |
| 99 | Display *display; |
| 100 | Drawable drawable; |
| 101 | unsigned long reason; |
| 102 | XvPortID port_id; |
| 103 | Time time; |
| 104 | } XvVideoNotifyEvent; |
| 105 | |
| 106 | typedef struct { |
| 107 | int type; |
| 108 | unsigned long serial; |
| 109 | Bool send_event; |
| 110 | Display *display; |
| 111 | XvPortID port_id; |
| 112 | Time time; |
| 113 | Atom attribute; |
| 114 | long value; |
| 115 | } XvPortNotifyEvent; |
| 116 | |
| 117 | typedef union { |
| 118 | int type; |
| 119 | XvVideoNotifyEvent xvvideo; |
| 120 | XvPortNotifyEvent xvport; |
| 121 | long pad[24]; |
| 122 | } XvEvent; |
| 123 | |
| 124 | typedef struct { |
| 125 | int id; |
| 126 | int type; |
| 127 | int byte_order; |
| 128 | char guid[16]; |
| 129 | int bits_per_pixel; |
| 130 | int format; |
| 131 | int num_planes; |
| 132 | |
| 133 | |
| 134 | int depth; |
| 135 | unsigned int red_mask; |
| 136 | unsigned int green_mask; |
| 137 | unsigned int blue_mask; |
| 138 | |
| 139 | |
| 140 | unsigned int y_sample_bits; |
| 141 | unsigned int u_sample_bits; |
| 142 | unsigned int v_sample_bits; |
| 143 | unsigned int horz_y_period; |
| 144 | unsigned int horz_u_period; |
| 145 | unsigned int horz_v_period; |
| 146 | unsigned int vert_y_period; |
| 147 | unsigned int vert_u_period; |
| 148 | unsigned int vert_v_period; |
| 149 | char component_order[32]; |
| 150 | int scanline_order; |
| 151 | } XvImageFormatValues; |
| 152 | |
| 153 | typedef struct { |
| 154 | int id; |
| 155 | int width, height; |
| 156 | int data_size; |
| 157 | int num_planes; |
| 158 | int *pitches; |
| 159 | int *offsets; |
| 160 | char *data; |
| 161 | XPointer obdata; |
| 162 | } XvImage; |
| 163 | |
| 164 | _XFUNCPROTOBEGIN |
| 165 | |
| 166 | extern int XvQueryExtension( |
| 167 | Display * , |
| 168 | unsigned int * , |
| 169 | unsigned int * , |
| 170 | unsigned int * , |
| 171 | unsigned int * , |
| 172 | unsigned int * |
| 173 | ); |
| 174 | |
| 175 | extern int XvQueryAdaptors( |
| 176 | Display * , |
| 177 | Window , |
| 178 | unsigned int * , |
| 179 | XvAdaptorInfo ** |
| 180 | ); |
| 181 | |
| 182 | extern int XvQueryEncodings( |
| 183 | Display * , |
| 184 | XvPortID , |
| 185 | unsigned int * , |
| 186 | XvEncodingInfo ** |
| 187 | ); |
| 188 | |
| 189 | extern int XvPutVideo( |
| 190 | Display * , |
| 191 | XvPortID , |
| 192 | Drawable , |
| 193 | GC , |
| 194 | int , |
| 195 | int , |
| 196 | unsigned int , |
| 197 | unsigned int , |
| 198 | int , |
| 199 | int , |
| 200 | unsigned int , |
| 201 | unsigned int |
| 202 | ); |
| 203 | |
| 204 | extern int XvPutStill( |
| 205 | Display * , |
| 206 | XvPortID , |
| 207 | Drawable , |
| 208 | GC , |
| 209 | int , |
| 210 | int , |
| 211 | unsigned int , |
| 212 | unsigned int , |
| 213 | int , |
| 214 | int , |
| 215 | unsigned int , |
| 216 | unsigned int |
| 217 | ); |
| 218 | |
| 219 | extern int XvGetVideo( |
| 220 | Display * , |
| 221 | XvPortID , |
| 222 | Drawable , |
| 223 | GC , |
| 224 | int , |
| 225 | int , |
| 226 | unsigned int , |
| 227 | unsigned int , |
| 228 | int , |
| 229 | int , |
| 230 | unsigned int , |
| 231 | unsigned int |
| 232 | ); |
| 233 | |
| 234 | extern int XvGetStill( |
| 235 | Display * , |
| 236 | XvPortID , |
| 237 | Drawable , |
| 238 | GC , |
| 239 | int , |
| 240 | int , |
| 241 | unsigned int , |
| 242 | unsigned int , |
| 243 | int , |
| 244 | int , |
| 245 | unsigned int , |
| 246 | unsigned int |
| 247 | ); |
| 248 | |
| 249 | extern int XvStopVideo( |
| 250 | Display * , |
| 251 | XvPortID , |
| 252 | Drawable |
| 253 | ); |
| 254 | |
| 255 | extern int XvGrabPort( |
| 256 | Display * , |
| 257 | XvPortID , |
| 258 | Time |
| 259 | ); |
| 260 | |
| 261 | extern int XvUngrabPort( |
| 262 | Display * , |
| 263 | XvPortID , |
| 264 | Time |
| 265 | ); |
| 266 | |
| 267 | extern int XvSelectVideoNotify( |
| 268 | Display * , |
| 269 | Drawable , |
| 270 | Bool |
| 271 | ); |
| 272 | |
| 273 | extern int XvSelectPortNotify( |
| 274 | Display * , |
| 275 | XvPortID , |
| 276 | Bool |
| 277 | ); |
| 278 | |
| 279 | extern int XvSetPortAttribute( |
| 280 | Display * , |
| 281 | XvPortID , |
| 282 | Atom , |
| 283 | int |
| 284 | ); |
| 285 | |
| 286 | extern int XvGetPortAttribute( |
| 287 | Display * , |
| 288 | XvPortID , |
| 289 | Atom , |
| 290 | int * |
| 291 | ); |
| 292 | |
| 293 | extern int XvQueryBestSize( |
| 294 | Display * , |
| 295 | XvPortID , |
| 296 | Bool , |
| 297 | unsigned int , |
| 298 | unsigned int , |
| 299 | unsigned int , |
| 300 | unsigned int , |
| 301 | unsigned int * , |
| 302 | unsigned int * |
| 303 | ); |
| 304 | |
| 305 | extern XvAttribute *XvQueryPortAttributes( |
| 306 | Display * , |
| 307 | XvPortID , |
| 308 | int * |
| 309 | ); |
| 310 | |
| 311 | |
| 312 | extern void XvFreeAdaptorInfo( |
| 313 | XvAdaptorInfo * |
| 314 | ); |
| 315 | |
| 316 | extern void XvFreeEncodingInfo( |
| 317 | XvEncodingInfo * |
| 318 | ); |
| 319 | |
| 320 | |
| 321 | extern XvImageFormatValues *XvListImageFormats ( |
| 322 | Display *display, |
| 323 | XvPortID port_id, |
| 324 | int *count_return |
| 325 | ); |
| 326 | |
| 327 | extern XvImage *XvCreateImage ( |
| 328 | Display *display, |
| 329 | XvPortID port, |
| 330 | int id, |
| 331 | char *data, |
| 332 | int width, |
| 333 | int height |
| 334 | ); |
| 335 | |
| 336 | extern int XvPutImage ( |
| 337 | Display *display, |
| 338 | XvPortID id, |
| 339 | Drawable d, |
| 340 | GC gc, |
| 341 | XvImage *image, |
| 342 | int src_x, |
| 343 | int src_y, |
| 344 | unsigned int src_w, |
| 345 | unsigned int src_h, |
| 346 | int dest_x, |
| 347 | int dest_y, |
| 348 | unsigned int dest_w, |
| 349 | unsigned int dest_h |
| 350 | ); |
| 351 | |
| 352 | extern int XvShmPutImage ( |
| 353 | Display *display, |
| 354 | XvPortID id, |
| 355 | Drawable d, |
| 356 | GC gc, |
| 357 | XvImage *image, |
| 358 | int src_x, |
| 359 | int src_y, |
| 360 | unsigned int src_w, |
| 361 | unsigned int src_h, |
| 362 | int dest_x, |
| 363 | int dest_y, |
| 364 | unsigned int dest_w, |
| 365 | unsigned int dest_h, |
| 366 | Bool send_event |
| 367 | ); |
| 368 | |
| 369 | extern XvImage *XvShmCreateImage ( |
| 370 | Display *display, |
| 371 | XvPortID port, |
| 372 | int id, |
| 373 | char *data, |
| 374 | int width, |
| 375 | int height, |
| 376 | XShmSegmentInfo *shminfo |
| 377 | ); |
| 378 | |
| 379 | |
| 380 | _XFUNCPROTOEND |
| 381 | |
| 382 | #endif |