1 /* 2 * This file generated automatically from xv.xml by c_client.py. 3 * Edit at your peril. 4 */ 5 6 #ifdef HAVE_CONFIG_H 7 #include "config.h" 8 #endif 9 #include <stdlib.h> 10 #include <string.h> 11 #include <assert.h> 12 #include <stddef.h> /* for offsetof() */ 13 #include "xcbext.h" 14 #include "xv.h" 15 16 #define ALIGNOF(type) offsetof(struct { char dummy; type member; }, member) 17 #include "xproto.h" 18 #include "shm.h" 19 20 xcb_extension_t xcb_xv_id = { "XVideo", 0 }; 21 22 void 23 xcb_xv_port_next (xcb_xv_port_iterator_t *i /**< */) 24 { 25 --i->rem; 26 ++i->data; 27 i->index += sizeof(xcb_xv_port_t); 28 } 29 30 xcb_generic_iterator_t 31 xcb_xv_port_end (xcb_xv_port_iterator_t i /**< */) 32 { 33 xcb_generic_iterator_t ret; 34 ret.data = i.data + i.rem; 35 ret.index = i.index + ((char *) ret.data - (char *) i.data); 36 ret.rem = 0; 37 return ret; 38 } 39 40 void 41 xcb_xv_encoding_next (xcb_xv_encoding_iterator_t *i /**< */) 42 { 43 --i->rem; 44 ++i->data; 45 i->index += sizeof(xcb_xv_encoding_t); 46 } 47 48 xcb_generic_iterator_t 49 xcb_xv_encoding_end (xcb_xv_encoding_iterator_t i /**< */) 50 { 51 xcb_generic_iterator_t ret; 52 ret.data = i.data + i.rem; 53 ret.index = i.index + ((char *) ret.data - (char *) i.data); 54 ret.rem = 0; 55 return ret; 56 } 57 58 void 59 xcb_xv_rational_next (xcb_xv_rational_iterator_t *i /**< */) 60 { 61 --i->rem; 62 ++i->data; 63 i->index += sizeof(xcb_xv_rational_t); 64 } 65 66 xcb_generic_iterator_t 67 xcb_xv_rational_end (xcb_xv_rational_iterator_t i /**< */) 68 { 69 xcb_generic_iterator_t ret; 70 ret.data = i.data + i.rem; 71 ret.index = i.index + ((char *) ret.data - (char *) i.data); 72 ret.rem = 0; 73 return ret; 74 } 75 76 void 77 xcb_xv_format_next (xcb_xv_format_iterator_t *i /**< */) 78 { 79 --i->rem; 80 ++i->data; 81 i->index += sizeof(xcb_xv_format_t); 82 } 83 84 xcb_generic_iterator_t 85 xcb_xv_format_end (xcb_xv_format_iterator_t i /**< */) 86 { 87 xcb_generic_iterator_t ret; 88 ret.data = i.data + i.rem; 89 ret.index = i.index + ((char *) ret.data - (char *) i.data); 90 ret.rem = 0; 91 return ret; 92 } 93 94 int 95 xcb_xv_adaptor_info_sizeof (const void *_buffer /**< */) 96 { 97 char *xcb_tmp = (char *)_buffer; 98 const xcb_xv_adaptor_info_t *_aux = (xcb_xv_adaptor_info_t *)_buffer; 99 unsigned int xcb_buffer_len = 0; 100 unsigned int xcb_block_len = 0; 101 unsigned int xcb_pad = 0; 102 unsigned int xcb_align_to = 0; 103 104 105 xcb_block_len += sizeof(xcb_xv_adaptor_info_t); 106 xcb_tmp += xcb_block_len; 107 xcb_buffer_len += xcb_block_len; 108 xcb_block_len = 0; 109 /* name */ 110 xcb_block_len += _aux->name_size * sizeof(char); 111 xcb_tmp += xcb_block_len; 112 xcb_align_to = ALIGNOF(char); 113 xcb_align_to = 4; 114 /* insert padding */ 115 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 116 xcb_buffer_len += xcb_block_len + xcb_pad; 117 if (0 != xcb_pad) { 118 xcb_tmp += xcb_pad; 119 xcb_pad = 0; 120 } 121 xcb_block_len = 0; 122 /* insert padding */ 123 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 124 xcb_buffer_len += xcb_block_len + xcb_pad; 125 if (0 != xcb_pad) { 126 xcb_tmp += xcb_pad; 127 xcb_pad = 0; 128 } 129 xcb_block_len = 0; 130 /* formats */ 131 xcb_block_len += _aux->num_formats * sizeof(xcb_xv_format_t); 132 xcb_tmp += xcb_block_len; 133 xcb_align_to = ALIGNOF(xcb_xv_format_t); 134 /* insert padding */ 135 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 136 xcb_buffer_len += xcb_block_len + xcb_pad; 137 if (0 != xcb_pad) { 138 xcb_tmp += xcb_pad; 139 xcb_pad = 0; 140 } 141 xcb_block_len = 0; 142 143 return xcb_buffer_len; 144 } 145 146 char * 147 xcb_xv_adaptor_info_name (const xcb_xv_adaptor_info_t *R /**< */) 148 { 149 return (char *) (R + 1); 150 } 151 152 int 153 xcb_xv_adaptor_info_name_length (const xcb_xv_adaptor_info_t *R /**< */) 154 { 155 return R->name_size; 156 } 157 158 xcb_generic_iterator_t 159 xcb_xv_adaptor_info_name_end (const xcb_xv_adaptor_info_t *R /**< */) 160 { 161 xcb_generic_iterator_t i; 162 i.data = ((char *) (R + 1)) + (R->name_size); 163 i.rem = 0; 164 i.index = (char *) i.data - (char *) R; 165 return i; 166 } 167 168 xcb_xv_format_t * 169 xcb_xv_adaptor_info_formats (const xcb_xv_adaptor_info_t *R /**< */) 170 { 171 xcb_generic_iterator_t prev = xcb_xv_adaptor_info_name_end(R); 172 return (xcb_xv_format_t *) ((char *) prev.data + ((-prev.index) & (4 - 1)) + 0); 173 } 174 175 int 176 xcb_xv_adaptor_info_formats_length (const xcb_xv_adaptor_info_t *R /**< */) 177 { 178 return R->num_formats; 179 } 180 181 xcb_xv_format_iterator_t 182 xcb_xv_adaptor_info_formats_iterator (const xcb_xv_adaptor_info_t *R /**< */) 183 { 184 xcb_xv_format_iterator_t i; 185 xcb_generic_iterator_t prev = xcb_xv_adaptor_info_name_end(R); 186 i.data = (xcb_xv_format_t *) ((char *) prev.data + ((-prev.index) & (4 - 1))); 187 i.rem = R->num_formats; 188 i.index = (char *) i.data - (char *) R; 189 return i; 190 } 191 192 void 193 xcb_xv_adaptor_info_next (xcb_xv_adaptor_info_iterator_t *i /**< */) 194 { 195 xcb_xv_adaptor_info_t *R = i->data; 196 xcb_generic_iterator_t child; 197 child.data = (xcb_xv_adaptor_info_t *)(((char *)R) + xcb_xv_adaptor_info_sizeof(R)); 198 i->index = (char *) child.data - (char *) i->data; 199 --i->rem; 200 i->data = (xcb_xv_adaptor_info_t *) child.data; 201 } 202 203 xcb_generic_iterator_t 204 xcb_xv_adaptor_info_end (xcb_xv_adaptor_info_iterator_t i /**< */) 205 { 206 xcb_generic_iterator_t ret; 207 while(i.rem > 0) 208 xcb_xv_adaptor_info_next(&i); 209 ret.data = i.data; 210 ret.rem = i.rem; 211 ret.index = i.index; 212 return ret; 213 } 214 215 int 216 xcb_xv_encoding_info_sizeof (const void *_buffer /**< */) 217 { 218 char *xcb_tmp = (char *)_buffer; 219 const xcb_xv_encoding_info_t *_aux = (xcb_xv_encoding_info_t *)_buffer; 220 unsigned int xcb_buffer_len = 0; 221 unsigned int xcb_block_len = 0; 222 unsigned int xcb_pad = 0; 223 unsigned int xcb_align_to = 0; 224 225 226 xcb_block_len += sizeof(xcb_xv_encoding_info_t); 227 xcb_tmp += xcb_block_len; 228 xcb_buffer_len += xcb_block_len; 229 xcb_block_len = 0; 230 /* name */ 231 xcb_block_len += _aux->name_size * sizeof(char); 232 xcb_tmp += xcb_block_len; 233 xcb_align_to = ALIGNOF(char); 234 /* insert padding */ 235 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 236 xcb_buffer_len += xcb_block_len + xcb_pad; 237 if (0 != xcb_pad) { 238 xcb_tmp += xcb_pad; 239 xcb_pad = 0; 240 } 241 xcb_block_len = 0; 242 243 return xcb_buffer_len; 244 } 245 246 char * 247 xcb_xv_encoding_info_name (const xcb_xv_encoding_info_t *R /**< */) 248 { 249 return (char *) (R + 1); 250 } 251 252 int 253 xcb_xv_encoding_info_name_length (const xcb_xv_encoding_info_t *R /**< */) 254 { 255 return R->name_size; 256 } 257 258 xcb_generic_iterator_t 259 xcb_xv_encoding_info_name_end (const xcb_xv_encoding_info_t *R /**< */) 260 { 261 xcb_generic_iterator_t i; 262 i.data = ((char *) (R + 1)) + (R->name_size); 263 i.rem = 0; 264 i.index = (char *) i.data - (char *) R; 265 return i; 266 } 267 268 void 269 xcb_xv_encoding_info_next (xcb_xv_encoding_info_iterator_t *i /**< */) 270 { 271 xcb_xv_encoding_info_t *R = i->data; 272 xcb_generic_iterator_t child; 273 child.data = (xcb_xv_encoding_info_t *)(((char *)R) + xcb_xv_encoding_info_sizeof(R)); 274 i->index = (char *) child.data - (char *) i->data; 275 --i->rem; 276 i->data = (xcb_xv_encoding_info_t *) child.data; 277 } 278 279 xcb_generic_iterator_t 280 xcb_xv_encoding_info_end (xcb_xv_encoding_info_iterator_t i /**< */) 281 { 282 xcb_generic_iterator_t ret; 283 while(i.rem > 0) 284 xcb_xv_encoding_info_next(&i); 285 ret.data = i.data; 286 ret.rem = i.rem; 287 ret.index = i.index; 288 return ret; 289 } 290 291 int 292 xcb_xv_image_sizeof (const void *_buffer /**< */) 293 { 294 char *xcb_tmp = (char *)_buffer; 295 const xcb_xv_image_t *_aux = (xcb_xv_image_t *)_buffer; 296 unsigned int xcb_buffer_len = 0; 297 unsigned int xcb_block_len = 0; 298 unsigned int xcb_pad = 0; 299 unsigned int xcb_align_to = 0; 300 301 302 xcb_block_len += sizeof(xcb_xv_image_t); 303 xcb_tmp += xcb_block_len; 304 xcb_buffer_len += xcb_block_len; 305 xcb_block_len = 0; 306 /* pitches */ 307 xcb_block_len += _aux->num_planes * sizeof(uint32_t); 308 xcb_tmp += xcb_block_len; 309 xcb_align_to = ALIGNOF(uint32_t); 310 /* insert padding */ 311 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 312 xcb_buffer_len += xcb_block_len + xcb_pad; 313 if (0 != xcb_pad) { 314 xcb_tmp += xcb_pad; 315 xcb_pad = 0; 316 } 317 xcb_block_len = 0; 318 /* offsets */ 319 xcb_block_len += _aux->num_planes * sizeof(uint32_t); 320 xcb_tmp += xcb_block_len; 321 xcb_align_to = ALIGNOF(uint32_t); 322 /* insert padding */ 323 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 324 xcb_buffer_len += xcb_block_len + xcb_pad; 325 if (0 != xcb_pad) { 326 xcb_tmp += xcb_pad; 327 xcb_pad = 0; 328 } 329 xcb_block_len = 0; 330 /* data */ 331 xcb_block_len += _aux->data_size * sizeof(uint8_t); 332 xcb_tmp += xcb_block_len; 333 xcb_align_to = ALIGNOF(uint8_t); 334 /* insert padding */ 335 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 336 xcb_buffer_len += xcb_block_len + xcb_pad; 337 if (0 != xcb_pad) { 338 xcb_tmp += xcb_pad; 339 xcb_pad = 0; 340 } 341 xcb_block_len = 0; 342 343 return xcb_buffer_len; 344 } 345 346 uint32_t * 347 xcb_xv_image_pitches (const xcb_xv_image_t *R /**< */) 348 { 349 return (uint32_t *) (R + 1); 350 } 351 352 int 353 xcb_xv_image_pitches_length (const xcb_xv_image_t *R /**< */) 354 { 355 return R->num_planes; 356 } 357 358 xcb_generic_iterator_t 359 xcb_xv_image_pitches_end (const xcb_xv_image_t *R /**< */) 360 { 361 xcb_generic_iterator_t i; 362 i.data = ((uint32_t *) (R + 1)) + (R->num_planes); 363 i.rem = 0; 364 i.index = (char *) i.data - (char *) R; 365 return i; 366 } 367 368 uint32_t * 369 xcb_xv_image_offsets (const xcb_xv_image_t *R /**< */) 370 { 371 xcb_generic_iterator_t prev = xcb_xv_image_pitches_end(R); 372 return (uint32_t *) ((char *) prev.data + XCB_TYPE_PAD(uint32_t, prev.index) + 0); 373 } 374 375 int 376 xcb_xv_image_offsets_length (const xcb_xv_image_t *R /**< */) 377 { 378 return R->num_planes; 379 } 380 381 xcb_generic_iterator_t 382 xcb_xv_image_offsets_end (const xcb_xv_image_t *R /**< */) 383 { 384 xcb_generic_iterator_t i; 385 xcb_generic_iterator_t child = xcb_xv_image_pitches_end(R); 386 i.data = ((uint32_t *) child.data) + (R->num_planes); 387 i.rem = 0; 388 i.index = (char *) i.data - (char *) R; 389 return i; 390 } 391 392 uint8_t * 393 xcb_xv_image_data (const xcb_xv_image_t *R /**< */) 394 { 395 xcb_generic_iterator_t prev = xcb_xv_image_offsets_end(R); 396 return (uint8_t *) ((char *) prev.data + XCB_TYPE_PAD(uint8_t, prev.index) + 0); 397 } 398 399 int 400 xcb_xv_image_data_length (const xcb_xv_image_t *R /**< */) 401 { 402 return R->data_size; 403 } 404 405 xcb_generic_iterator_t 406 xcb_xv_image_data_end (const xcb_xv_image_t *R /**< */) 407 { 408 xcb_generic_iterator_t i; 409 xcb_generic_iterator_t child = xcb_xv_image_offsets_end(R); 410 i.data = ((uint8_t *) child.data) + (R->data_size); 411 i.rem = 0; 412 i.index = (char *) i.data - (char *) R; 413 return i; 414 } 415 416 void 417 xcb_xv_image_next (xcb_xv_image_iterator_t *i /**< */) 418 { 419 xcb_xv_image_t *R = i->data; 420 xcb_generic_iterator_t child; 421 child.data = (xcb_xv_image_t *)(((char *)R) + xcb_xv_image_sizeof(R)); 422 i->index = (char *) child.data - (char *) i->data; 423 --i->rem; 424 i->data = (xcb_xv_image_t *) child.data; 425 } 426 427 xcb_generic_iterator_t 428 xcb_xv_image_end (xcb_xv_image_iterator_t i /**< */) 429 { 430 xcb_generic_iterator_t ret; 431 while(i.rem > 0) 432 xcb_xv_image_next(&i); 433 ret.data = i.data; 434 ret.rem = i.rem; 435 ret.index = i.index; 436 return ret; 437 } 438 439 int 440 xcb_xv_attribute_info_sizeof (const void *_buffer /**< */) 441 { 442 char *xcb_tmp = (char *)_buffer; 443 const xcb_xv_attribute_info_t *_aux = (xcb_xv_attribute_info_t *)_buffer; 444 unsigned int xcb_buffer_len = 0; 445 unsigned int xcb_block_len = 0; 446 unsigned int xcb_pad = 0; 447 unsigned int xcb_align_to = 0; 448 449 450 xcb_block_len += sizeof(xcb_xv_attribute_info_t); 451 xcb_tmp += xcb_block_len; 452 xcb_buffer_len += xcb_block_len; 453 xcb_block_len = 0; 454 /* name */ 455 xcb_block_len += _aux->size * sizeof(char); 456 xcb_tmp += xcb_block_len; 457 xcb_align_to = ALIGNOF(char); 458 /* insert padding */ 459 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 460 xcb_buffer_len += xcb_block_len + xcb_pad; 461 if (0 != xcb_pad) { 462 xcb_tmp += xcb_pad; 463 xcb_pad = 0; 464 } 465 xcb_block_len = 0; 466 467 return xcb_buffer_len; 468 } 469 470 char * 471 xcb_xv_attribute_info_name (const xcb_xv_attribute_info_t *R /**< */) 472 { 473 return (char *) (R + 1); 474 } 475 476 int 477 xcb_xv_attribute_info_name_length (const xcb_xv_attribute_info_t *R /**< */) 478 { 479 return R->size; 480 } 481 482 xcb_generic_iterator_t 483 xcb_xv_attribute_info_name_end (const xcb_xv_attribute_info_t *R /**< */) 484 { 485 xcb_generic_iterator_t i; 486 i.data = ((char *) (R + 1)) + (R->size); 487 i.rem = 0; 488 i.index = (char *) i.data - (char *) R; 489 return i; 490 } 491 492 void 493 xcb_xv_attribute_info_next (xcb_xv_attribute_info_iterator_t *i /**< */) 494 { 495 xcb_xv_attribute_info_t *R = i->data; 496 xcb_generic_iterator_t child; 497 child.data = (xcb_xv_attribute_info_t *)(((char *)R) + xcb_xv_attribute_info_sizeof(R)); 498 i->index = (char *) child.data - (char *) i->data; 499 --i->rem; 500 i->data = (xcb_xv_attribute_info_t *) child.data; 501 } 502 503 xcb_generic_iterator_t 504 xcb_xv_attribute_info_end (xcb_xv_attribute_info_iterator_t i /**< */) 505 { 506 xcb_generic_iterator_t ret; 507 while(i.rem > 0) 508 xcb_xv_attribute_info_next(&i); 509 ret.data = i.data; 510 ret.rem = i.rem; 511 ret.index = i.index; 512 return ret; 513 } 514 515 void 516 xcb_xv_image_format_info_next (xcb_xv_image_format_info_iterator_t *i /**< */) 517 { 518 --i->rem; 519 ++i->data; 520 i->index += sizeof(xcb_xv_image_format_info_t); 521 } 522 523 xcb_generic_iterator_t 524 xcb_xv_image_format_info_end (xcb_xv_image_format_info_iterator_t i /**< */) 525 { 526 xcb_generic_iterator_t ret; 527 ret.data = i.data + i.rem; 528 ret.index = i.index + ((char *) ret.data - (char *) i.data); 529 ret.rem = 0; 530 return ret; 531 } 532 533 xcb_xv_query_extension_cookie_t 534 xcb_xv_query_extension (xcb_connection_t *c /**< */) 535 { 536 static const xcb_protocol_request_t xcb_req = { 537 /* count */ 2, 538 /* ext */ &xcb_xv_id, 539 /* opcode */ XCB_XV_QUERY_EXTENSION, 540 /* isvoid */ 0 541 }; 542 543 struct iovec xcb_parts[4]; 544 xcb_xv_query_extension_cookie_t xcb_ret; 545 xcb_xv_query_extension_request_t xcb_out; 546 547 548 xcb_parts[2].iov_base = (char *) &xcb_out; 549 xcb_parts[2].iov_len = sizeof(xcb_out); 550 xcb_parts[3].iov_base = 0; 551 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 552 553 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 554 return xcb_ret; 555 } 556 557 xcb_xv_query_extension_cookie_t 558 xcb_xv_query_extension_unchecked (xcb_connection_t *c /**< */) 559 { 560 static const xcb_protocol_request_t xcb_req = { 561 /* count */ 2, 562 /* ext */ &xcb_xv_id, 563 /* opcode */ XCB_XV_QUERY_EXTENSION, 564 /* isvoid */ 0 565 }; 566 567 struct iovec xcb_parts[4]; 568 xcb_xv_query_extension_cookie_t xcb_ret; 569 xcb_xv_query_extension_request_t xcb_out; 570 571 572 xcb_parts[2].iov_base = (char *) &xcb_out; 573 xcb_parts[2].iov_len = sizeof(xcb_out); 574 xcb_parts[3].iov_base = 0; 575 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 576 577 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 578 return xcb_ret; 579 } 580 581 xcb_xv_query_extension_reply_t * 582 xcb_xv_query_extension_reply (xcb_connection_t *c /**< */, 583 xcb_xv_query_extension_cookie_t cookie /**< */, 584 xcb_generic_error_t **e /**< */) 585 { 586 return (xcb_xv_query_extension_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 587 } 588 589 int 590 xcb_xv_query_adaptors_sizeof (const void *_buffer /**< */) 591 { 592 char *xcb_tmp = (char *)_buffer; 593 const xcb_xv_query_adaptors_reply_t *_aux = (xcb_xv_query_adaptors_reply_t *)_buffer; 594 unsigned int xcb_buffer_len = 0; 595 unsigned int xcb_block_len = 0; 596 unsigned int xcb_pad = 0; 597 unsigned int xcb_align_to = 0; 598 599 unsigned int i; 600 unsigned int xcb_tmp_len; 601 602 xcb_block_len += sizeof(xcb_xv_query_adaptors_reply_t); 603 xcb_tmp += xcb_block_len; 604 xcb_buffer_len += xcb_block_len; 605 xcb_block_len = 0; 606 /* info */ 607 for(i=0; i<_aux->num_adaptors; i++) { 608 xcb_tmp_len = xcb_xv_adaptor_info_sizeof(xcb_tmp); 609 xcb_block_len += xcb_tmp_len; 610 xcb_tmp += xcb_tmp_len; 611 } 612 xcb_align_to = ALIGNOF(xcb_xv_adaptor_info_t); 613 /* insert padding */ 614 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 615 xcb_buffer_len += xcb_block_len + xcb_pad; 616 if (0 != xcb_pad) { 617 xcb_tmp += xcb_pad; 618 xcb_pad = 0; 619 } 620 xcb_block_len = 0; 621 622 return xcb_buffer_len; 623 } 624 625 xcb_xv_query_adaptors_cookie_t 626 xcb_xv_query_adaptors (xcb_connection_t *c /**< */, 627 xcb_window_t window /**< */) 628 { 629 static const xcb_protocol_request_t xcb_req = { 630 /* count */ 2, 631 /* ext */ &xcb_xv_id, 632 /* opcode */ XCB_XV_QUERY_ADAPTORS, 633 /* isvoid */ 0 634 }; 635 636 struct iovec xcb_parts[4]; 637 xcb_xv_query_adaptors_cookie_t xcb_ret; 638 xcb_xv_query_adaptors_request_t xcb_out; 639 640 xcb_out.window = window; 641 642 xcb_parts[2].iov_base = (char *) &xcb_out; 643 xcb_parts[2].iov_len = sizeof(xcb_out); 644 xcb_parts[3].iov_base = 0; 645 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 646 647 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 648 return xcb_ret; 649 } 650 651 xcb_xv_query_adaptors_cookie_t 652 xcb_xv_query_adaptors_unchecked (xcb_connection_t *c /**< */, 653 xcb_window_t window /**< */) 654 { 655 static const xcb_protocol_request_t xcb_req = { 656 /* count */ 2, 657 /* ext */ &xcb_xv_id, 658 /* opcode */ XCB_XV_QUERY_ADAPTORS, 659 /* isvoid */ 0 660 }; 661 662 struct iovec xcb_parts[4]; 663 xcb_xv_query_adaptors_cookie_t xcb_ret; 664 xcb_xv_query_adaptors_request_t xcb_out; 665 666 xcb_out.window = window; 667 668 xcb_parts[2].iov_base = (char *) &xcb_out; 669 xcb_parts[2].iov_len = sizeof(xcb_out); 670 xcb_parts[3].iov_base = 0; 671 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 672 673 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 674 return xcb_ret; 675 } 676 677 int 678 xcb_xv_query_adaptors_info_length (const xcb_xv_query_adaptors_reply_t *R /**< */) 679 { 680 return R->num_adaptors; 681 } 682 683 xcb_xv_adaptor_info_iterator_t 684 xcb_xv_query_adaptors_info_iterator (const xcb_xv_query_adaptors_reply_t *R /**< */) 685 { 686 xcb_xv_adaptor_info_iterator_t i; 687 i.data = (xcb_xv_adaptor_info_t *) (R + 1); 688 i.rem = R->num_adaptors; 689 i.index = (char *) i.data - (char *) R; 690 return i; 691 } 692 693 xcb_xv_query_adaptors_reply_t * 694 xcb_xv_query_adaptors_reply (xcb_connection_t *c /**< */, 695 xcb_xv_query_adaptors_cookie_t cookie /**< */, 696 xcb_generic_error_t **e /**< */) 697 { 698 return (xcb_xv_query_adaptors_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 699 } 700 701 int 702 xcb_xv_query_encodings_sizeof (const void *_buffer /**< */) 703 { 704 char *xcb_tmp = (char *)_buffer; 705 const xcb_xv_query_encodings_reply_t *_aux = (xcb_xv_query_encodings_reply_t *)_buffer; 706 unsigned int xcb_buffer_len = 0; 707 unsigned int xcb_block_len = 0; 708 unsigned int xcb_pad = 0; 709 unsigned int xcb_align_to = 0; 710 711 unsigned int i; 712 unsigned int xcb_tmp_len; 713 714 xcb_block_len += sizeof(xcb_xv_query_encodings_reply_t); 715 xcb_tmp += xcb_block_len; 716 xcb_buffer_len += xcb_block_len; 717 xcb_block_len = 0; 718 /* info */ 719 for(i=0; i<_aux->num_encodings; i++) { 720 xcb_tmp_len = xcb_xv_encoding_info_sizeof(xcb_tmp); 721 xcb_block_len += xcb_tmp_len; 722 xcb_tmp += xcb_tmp_len; 723 } 724 xcb_align_to = ALIGNOF(xcb_xv_encoding_info_t); 725 /* insert padding */ 726 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 727 xcb_buffer_len += xcb_block_len + xcb_pad; 728 if (0 != xcb_pad) { 729 xcb_tmp += xcb_pad; 730 xcb_pad = 0; 731 } 732 xcb_block_len = 0; 733 734 return xcb_buffer_len; 735 } 736 737 xcb_xv_query_encodings_cookie_t 738 xcb_xv_query_encodings (xcb_connection_t *c /**< */, 739 xcb_xv_port_t port /**< */) 740 { 741 static const xcb_protocol_request_t xcb_req = { 742 /* count */ 2, 743 /* ext */ &xcb_xv_id, 744 /* opcode */ XCB_XV_QUERY_ENCODINGS, 745 /* isvoid */ 0 746 }; 747 748 struct iovec xcb_parts[4]; 749 xcb_xv_query_encodings_cookie_t xcb_ret; 750 xcb_xv_query_encodings_request_t xcb_out; 751 752 xcb_out.port = port; 753 754 xcb_parts[2].iov_base = (char *) &xcb_out; 755 xcb_parts[2].iov_len = sizeof(xcb_out); 756 xcb_parts[3].iov_base = 0; 757 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 758 759 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 760 return xcb_ret; 761 } 762 763 xcb_xv_query_encodings_cookie_t 764 xcb_xv_query_encodings_unchecked (xcb_connection_t *c /**< */, 765 xcb_xv_port_t port /**< */) 766 { 767 static const xcb_protocol_request_t xcb_req = { 768 /* count */ 2, 769 /* ext */ &xcb_xv_id, 770 /* opcode */ XCB_XV_QUERY_ENCODINGS, 771 /* isvoid */ 0 772 }; 773 774 struct iovec xcb_parts[4]; 775 xcb_xv_query_encodings_cookie_t xcb_ret; 776 xcb_xv_query_encodings_request_t xcb_out; 777 778 xcb_out.port = port; 779 780 xcb_parts[2].iov_base = (char *) &xcb_out; 781 xcb_parts[2].iov_len = sizeof(xcb_out); 782 xcb_parts[3].iov_base = 0; 783 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 784 785 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 786 return xcb_ret; 787 } 788 789 int 790 xcb_xv_query_encodings_info_length (const xcb_xv_query_encodings_reply_t *R /**< */) 791 { 792 return R->num_encodings; 793 } 794 795 xcb_xv_encoding_info_iterator_t 796 xcb_xv_query_encodings_info_iterator (const xcb_xv_query_encodings_reply_t *R /**< */) 797 { 798 xcb_xv_encoding_info_iterator_t i; 799 i.data = (xcb_xv_encoding_info_t *) (R + 1); 800 i.rem = R->num_encodings; 801 i.index = (char *) i.data - (char *) R; 802 return i; 803 } 804 805 xcb_xv_query_encodings_reply_t * 806 xcb_xv_query_encodings_reply (xcb_connection_t *c /**< */, 807 xcb_xv_query_encodings_cookie_t cookie /**< */, 808 xcb_generic_error_t **e /**< */) 809 { 810 return (xcb_xv_query_encodings_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 811 } 812 813 xcb_xv_grab_port_cookie_t 814 xcb_xv_grab_port (xcb_connection_t *c /**< */, 815 xcb_xv_port_t port /**< */, 816 xcb_timestamp_t time /**< */) 817 { 818 static const xcb_protocol_request_t xcb_req = { 819 /* count */ 2, 820 /* ext */ &xcb_xv_id, 821 /* opcode */ XCB_XV_GRAB_PORT, 822 /* isvoid */ 0 823 }; 824 825 struct iovec xcb_parts[4]; 826 xcb_xv_grab_port_cookie_t xcb_ret; 827 xcb_xv_grab_port_request_t xcb_out; 828 829 xcb_out.port = port; 830 xcb_out.time = time; 831 832 xcb_parts[2].iov_base = (char *) &xcb_out; 833 xcb_parts[2].iov_len = sizeof(xcb_out); 834 xcb_parts[3].iov_base = 0; 835 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 836 837 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 838 return xcb_ret; 839 } 840 841 xcb_xv_grab_port_cookie_t 842 xcb_xv_grab_port_unchecked (xcb_connection_t *c /**< */, 843 xcb_xv_port_t port /**< */, 844 xcb_timestamp_t time /**< */) 845 { 846 static const xcb_protocol_request_t xcb_req = { 847 /* count */ 2, 848 /* ext */ &xcb_xv_id, 849 /* opcode */ XCB_XV_GRAB_PORT, 850 /* isvoid */ 0 851 }; 852 853 struct iovec xcb_parts[4]; 854 xcb_xv_grab_port_cookie_t xcb_ret; 855 xcb_xv_grab_port_request_t xcb_out; 856 857 xcb_out.port = port; 858 xcb_out.time = time; 859 860 xcb_parts[2].iov_base = (char *) &xcb_out; 861 xcb_parts[2].iov_len = sizeof(xcb_out); 862 xcb_parts[3].iov_base = 0; 863 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 864 865 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 866 return xcb_ret; 867 } 868 869 xcb_xv_grab_port_reply_t * 870 xcb_xv_grab_port_reply (xcb_connection_t *c /**< */, 871 xcb_xv_grab_port_cookie_t cookie /**< */, 872 xcb_generic_error_t **e /**< */) 873 { 874 return (xcb_xv_grab_port_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 875 } 876 877 xcb_void_cookie_t 878 xcb_xv_ungrab_port_checked (xcb_connection_t *c /**< */, 879 xcb_xv_port_t port /**< */, 880 xcb_timestamp_t time /**< */) 881 { 882 static const xcb_protocol_request_t xcb_req = { 883 /* count */ 2, 884 /* ext */ &xcb_xv_id, 885 /* opcode */ XCB_XV_UNGRAB_PORT, 886 /* isvoid */ 1 887 }; 888 889 struct iovec xcb_parts[4]; 890 xcb_void_cookie_t xcb_ret; 891 xcb_xv_ungrab_port_request_t xcb_out; 892 893 xcb_out.port = port; 894 xcb_out.time = time; 895 896 xcb_parts[2].iov_base = (char *) &xcb_out; 897 xcb_parts[2].iov_len = sizeof(xcb_out); 898 xcb_parts[3].iov_base = 0; 899 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 900 901 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 902 return xcb_ret; 903 } 904 905 xcb_void_cookie_t 906 xcb_xv_ungrab_port (xcb_connection_t *c /**< */, 907 xcb_xv_port_t port /**< */, 908 xcb_timestamp_t time /**< */) 909 { 910 static const xcb_protocol_request_t xcb_req = { 911 /* count */ 2, 912 /* ext */ &xcb_xv_id, 913 /* opcode */ XCB_XV_UNGRAB_PORT, 914 /* isvoid */ 1 915 }; 916 917 struct iovec xcb_parts[4]; 918 xcb_void_cookie_t xcb_ret; 919 xcb_xv_ungrab_port_request_t xcb_out; 920 921 xcb_out.port = port; 922 xcb_out.time = time; 923 924 xcb_parts[2].iov_base = (char *) &xcb_out; 925 xcb_parts[2].iov_len = sizeof(xcb_out); 926 xcb_parts[3].iov_base = 0; 927 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 928 929 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 930 return xcb_ret; 931 } 932 933 xcb_void_cookie_t 934 xcb_xv_put_video_checked (xcb_connection_t *c /**< */, 935 xcb_xv_port_t port /**< */, 936 xcb_drawable_t drawable /**< */, 937 xcb_gcontext_t gc /**< */, 938 int16_t vid_x /**< */, 939 int16_t vid_y /**< */, 940 uint16_t vid_w /**< */, 941 uint16_t vid_h /**< */, 942 int16_t drw_x /**< */, 943 int16_t drw_y /**< */, 944 uint16_t drw_w /**< */, 945 uint16_t drw_h /**< */) 946 { 947 static const xcb_protocol_request_t xcb_req = { 948 /* count */ 2, 949 /* ext */ &xcb_xv_id, 950 /* opcode */ XCB_XV_PUT_VIDEO, 951 /* isvoid */ 1 952 }; 953 954 struct iovec xcb_parts[4]; 955 xcb_void_cookie_t xcb_ret; 956 xcb_xv_put_video_request_t xcb_out; 957 958 xcb_out.port = port; 959 xcb_out.drawable = drawable; 960 xcb_out.gc = gc; 961 xcb_out.vid_x = vid_x; 962 xcb_out.vid_y = vid_y; 963 xcb_out.vid_w = vid_w; 964 xcb_out.vid_h = vid_h; 965 xcb_out.drw_x = drw_x; 966 xcb_out.drw_y = drw_y; 967 xcb_out.drw_w = drw_w; 968 xcb_out.drw_h = drw_h; 969 970 xcb_parts[2].iov_base = (char *) &xcb_out; 971 xcb_parts[2].iov_len = sizeof(xcb_out); 972 xcb_parts[3].iov_base = 0; 973 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 974 975 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 976 return xcb_ret; 977 } 978 979 xcb_void_cookie_t 980 xcb_xv_put_video (xcb_connection_t *c /**< */, 981 xcb_xv_port_t port /**< */, 982 xcb_drawable_t drawable /**< */, 983 xcb_gcontext_t gc /**< */, 984 int16_t vid_x /**< */, 985 int16_t vid_y /**< */, 986 uint16_t vid_w /**< */, 987 uint16_t vid_h /**< */, 988 int16_t drw_x /**< */, 989 int16_t drw_y /**< */, 990 uint16_t drw_w /**< */, 991 uint16_t drw_h /**< */) 992 { 993 static const xcb_protocol_request_t xcb_req = { 994 /* count */ 2, 995 /* ext */ &xcb_xv_id, 996 /* opcode */ XCB_XV_PUT_VIDEO, 997 /* isvoid */ 1 998 }; 999 1000 struct iovec xcb_parts[4]; 1001 xcb_void_cookie_t xcb_ret; 1002 xcb_xv_put_video_request_t xcb_out; 1003 1004 xcb_out.port = port; 1005 xcb_out.drawable = drawable; 1006 xcb_out.gc = gc; 1007 xcb_out.vid_x = vid_x; 1008 xcb_out.vid_y = vid_y; 1009 xcb_out.vid_w = vid_w; 1010 xcb_out.vid_h = vid_h; 1011 xcb_out.drw_x = drw_x; 1012 xcb_out.drw_y = drw_y; 1013 xcb_out.drw_w = drw_w; 1014 xcb_out.drw_h = drw_h; 1015 1016 xcb_parts[2].iov_base = (char *) &xcb_out; 1017 xcb_parts[2].iov_len = sizeof(xcb_out); 1018 xcb_parts[3].iov_base = 0; 1019 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1020 1021 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 1022 return xcb_ret; 1023 } 1024 1025 xcb_void_cookie_t 1026 xcb_xv_put_still_checked (xcb_connection_t *c /**< */, 1027 xcb_xv_port_t port /**< */, 1028 xcb_drawable_t drawable /**< */, 1029 xcb_gcontext_t gc /**< */, 1030 int16_t vid_x /**< */, 1031 int16_t vid_y /**< */, 1032 uint16_t vid_w /**< */, 1033 uint16_t vid_h /**< */, 1034 int16_t drw_x /**< */, 1035 int16_t drw_y /**< */, 1036 uint16_t drw_w /**< */, 1037 uint16_t drw_h /**< */) 1038 { 1039 static const xcb_protocol_request_t xcb_req = { 1040 /* count */ 2, 1041 /* ext */ &xcb_xv_id, 1042 /* opcode */ XCB_XV_PUT_STILL, 1043 /* isvoid */ 1 1044 }; 1045 1046 struct iovec xcb_parts[4]; 1047 xcb_void_cookie_t xcb_ret; 1048 xcb_xv_put_still_request_t xcb_out; 1049 1050 xcb_out.port = port; 1051 xcb_out.drawable = drawable; 1052 xcb_out.gc = gc; 1053 xcb_out.vid_x = vid_x; 1054 xcb_out.vid_y = vid_y; 1055 xcb_out.vid_w = vid_w; 1056 xcb_out.vid_h = vid_h; 1057 xcb_out.drw_x = drw_x; 1058 xcb_out.drw_y = drw_y; 1059 xcb_out.drw_w = drw_w; 1060 xcb_out.drw_h = drw_h; 1061 1062 xcb_parts[2].iov_base = (char *) &xcb_out; 1063 xcb_parts[2].iov_len = sizeof(xcb_out); 1064 xcb_parts[3].iov_base = 0; 1065 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1066 1067 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 1068 return xcb_ret; 1069 } 1070 1071 xcb_void_cookie_t 1072 xcb_xv_put_still (xcb_connection_t *c /**< */, 1073 xcb_xv_port_t port /**< */, 1074 xcb_drawable_t drawable /**< */, 1075 xcb_gcontext_t gc /**< */, 1076 int16_t vid_x /**< */, 1077 int16_t vid_y /**< */, 1078 uint16_t vid_w /**< */, 1079 uint16_t vid_h /**< */, 1080 int16_t drw_x /**< */, 1081 int16_t drw_y /**< */, 1082 uint16_t drw_w /**< */, 1083 uint16_t drw_h /**< */) 1084 { 1085 static const xcb_protocol_request_t xcb_req = { 1086 /* count */ 2, 1087 /* ext */ &xcb_xv_id, 1088 /* opcode */ XCB_XV_PUT_STILL, 1089 /* isvoid */ 1 1090 }; 1091 1092 struct iovec xcb_parts[4]; 1093 xcb_void_cookie_t xcb_ret; 1094 xcb_xv_put_still_request_t xcb_out; 1095 1096 xcb_out.port = port; 1097 xcb_out.drawable = drawable; 1098 xcb_out.gc = gc; 1099 xcb_out.vid_x = vid_x; 1100 xcb_out.vid_y = vid_y; 1101 xcb_out.vid_w = vid_w; 1102 xcb_out.vid_h = vid_h; 1103 xcb_out.drw_x = drw_x; 1104 xcb_out.drw_y = drw_y; 1105 xcb_out.drw_w = drw_w; 1106 xcb_out.drw_h = drw_h; 1107 1108 xcb_parts[2].iov_base = (char *) &xcb_out; 1109 xcb_parts[2].iov_len = sizeof(xcb_out); 1110 xcb_parts[3].iov_base = 0; 1111 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1112 1113 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 1114 return xcb_ret; 1115 } 1116 1117 xcb_void_cookie_t 1118 xcb_xv_get_video_checked (xcb_connection_t *c /**< */, 1119 xcb_xv_port_t port /**< */, 1120 xcb_drawable_t drawable /**< */, 1121 xcb_gcontext_t gc /**< */, 1122 int16_t vid_x /**< */, 1123 int16_t vid_y /**< */, 1124 uint16_t vid_w /**< */, 1125 uint16_t vid_h /**< */, 1126 int16_t drw_x /**< */, 1127 int16_t drw_y /**< */, 1128 uint16_t drw_w /**< */, 1129 uint16_t drw_h /**< */) 1130 { 1131 static const xcb_protocol_request_t xcb_req = { 1132 /* count */ 2, 1133 /* ext */ &xcb_xv_id, 1134 /* opcode */ XCB_XV_GET_VIDEO, 1135 /* isvoid */ 1 1136 }; 1137 1138 struct iovec xcb_parts[4]; 1139 xcb_void_cookie_t xcb_ret; 1140 xcb_xv_get_video_request_t xcb_out; 1141 1142 xcb_out.port = port; 1143 xcb_out.drawable = drawable; 1144 xcb_out.gc = gc; 1145 xcb_out.vid_x = vid_x; 1146 xcb_out.vid_y = vid_y; 1147 xcb_out.vid_w = vid_w; 1148 xcb_out.vid_h = vid_h; 1149 xcb_out.drw_x = drw_x; 1150 xcb_out.drw_y = drw_y; 1151 xcb_out.drw_w = drw_w; 1152 xcb_out.drw_h = drw_h; 1153 1154 xcb_parts[2].iov_base = (char *) &xcb_out; 1155 xcb_parts[2].iov_len = sizeof(xcb_out); 1156 xcb_parts[3].iov_base = 0; 1157 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1158 1159 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 1160 return xcb_ret; 1161 } 1162 1163 xcb_void_cookie_t 1164 xcb_xv_get_video (xcb_connection_t *c /**< */, 1165 xcb_xv_port_t port /**< */, 1166 xcb_drawable_t drawable /**< */, 1167 xcb_gcontext_t gc /**< */, 1168 int16_t vid_x /**< */, 1169 int16_t vid_y /**< */, 1170 uint16_t vid_w /**< */, 1171 uint16_t vid_h /**< */, 1172 int16_t drw_x /**< */, 1173 int16_t drw_y /**< */, 1174 uint16_t drw_w /**< */, 1175 uint16_t drw_h /**< */) 1176 { 1177 static const xcb_protocol_request_t xcb_req = { 1178 /* count */ 2, 1179 /* ext */ &xcb_xv_id, 1180 /* opcode */ XCB_XV_GET_VIDEO, 1181 /* isvoid */ 1 1182 }; 1183 1184 struct iovec xcb_parts[4]; 1185 xcb_void_cookie_t xcb_ret; 1186 xcb_xv_get_video_request_t xcb_out; 1187 1188 xcb_out.port = port; 1189 xcb_out.drawable = drawable; 1190 xcb_out.gc = gc; 1191 xcb_out.vid_x = vid_x; 1192 xcb_out.vid_y = vid_y; 1193 xcb_out.vid_w = vid_w; 1194 xcb_out.vid_h = vid_h; 1195 xcb_out.drw_x = drw_x; 1196 xcb_out.drw_y = drw_y; 1197 xcb_out.drw_w = drw_w; 1198 xcb_out.drw_h = drw_h; 1199 1200 xcb_parts[2].iov_base = (char *) &xcb_out; 1201 xcb_parts[2].iov_len = sizeof(xcb_out); 1202 xcb_parts[3].iov_base = 0; 1203 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1204 1205 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 1206 return xcb_ret; 1207 } 1208 1209 xcb_void_cookie_t 1210 xcb_xv_get_still_checked (xcb_connection_t *c /**< */, 1211 xcb_xv_port_t port /**< */, 1212 xcb_drawable_t drawable /**< */, 1213 xcb_gcontext_t gc /**< */, 1214 int16_t vid_x /**< */, 1215 int16_t vid_y /**< */, 1216 uint16_t vid_w /**< */, 1217 uint16_t vid_h /**< */, 1218 int16_t drw_x /**< */, 1219 int16_t drw_y /**< */, 1220 uint16_t drw_w /**< */, 1221 uint16_t drw_h /**< */) 1222 { 1223 static const xcb_protocol_request_t xcb_req = { 1224 /* count */ 2, 1225 /* ext */ &xcb_xv_id, 1226 /* opcode */ XCB_XV_GET_STILL, 1227 /* isvoid */ 1 1228 }; 1229 1230 struct iovec xcb_parts[4]; 1231 xcb_void_cookie_t xcb_ret; 1232 xcb_xv_get_still_request_t xcb_out; 1233 1234 xcb_out.port = port; 1235 xcb_out.drawable = drawable; 1236 xcb_out.gc = gc; 1237 xcb_out.vid_x = vid_x; 1238 xcb_out.vid_y = vid_y; 1239 xcb_out.vid_w = vid_w; 1240 xcb_out.vid_h = vid_h; 1241 xcb_out.drw_x = drw_x; 1242 xcb_out.drw_y = drw_y; 1243 xcb_out.drw_w = drw_w; 1244 xcb_out.drw_h = drw_h; 1245 1246 xcb_parts[2].iov_base = (char *) &xcb_out; 1247 xcb_parts[2].iov_len = sizeof(xcb_out); 1248 xcb_parts[3].iov_base = 0; 1249 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1250 1251 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 1252 return xcb_ret; 1253 } 1254 1255 xcb_void_cookie_t 1256 xcb_xv_get_still (xcb_connection_t *c /**< */, 1257 xcb_xv_port_t port /**< */, 1258 xcb_drawable_t drawable /**< */, 1259 xcb_gcontext_t gc /**< */, 1260 int16_t vid_x /**< */, 1261 int16_t vid_y /**< */, 1262 uint16_t vid_w /**< */, 1263 uint16_t vid_h /**< */, 1264 int16_t drw_x /**< */, 1265 int16_t drw_y /**< */, 1266 uint16_t drw_w /**< */, 1267 uint16_t drw_h /**< */) 1268 { 1269 static const xcb_protocol_request_t xcb_req = { 1270 /* count */ 2, 1271 /* ext */ &xcb_xv_id, 1272 /* opcode */ XCB_XV_GET_STILL, 1273 /* isvoid */ 1 1274 }; 1275 1276 struct iovec xcb_parts[4]; 1277 xcb_void_cookie_t xcb_ret; 1278 xcb_xv_get_still_request_t xcb_out; 1279 1280 xcb_out.port = port; 1281 xcb_out.drawable = drawable; 1282 xcb_out.gc = gc; 1283 xcb_out.vid_x = vid_x; 1284 xcb_out.vid_y = vid_y; 1285 xcb_out.vid_w = vid_w; 1286 xcb_out.vid_h = vid_h; 1287 xcb_out.drw_x = drw_x; 1288 xcb_out.drw_y = drw_y; 1289 xcb_out.drw_w = drw_w; 1290 xcb_out.drw_h = drw_h; 1291 1292 xcb_parts[2].iov_base = (char *) &xcb_out; 1293 xcb_parts[2].iov_len = sizeof(xcb_out); 1294 xcb_parts[3].iov_base = 0; 1295 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1296 1297 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 1298 return xcb_ret; 1299 } 1300 1301 xcb_void_cookie_t 1302 xcb_xv_stop_video_checked (xcb_connection_t *c /**< */, 1303 xcb_xv_port_t port /**< */, 1304 xcb_drawable_t drawable /**< */) 1305 { 1306 static const xcb_protocol_request_t xcb_req = { 1307 /* count */ 2, 1308 /* ext */ &xcb_xv_id, 1309 /* opcode */ XCB_XV_STOP_VIDEO, 1310 /* isvoid */ 1 1311 }; 1312 1313 struct iovec xcb_parts[4]; 1314 xcb_void_cookie_t xcb_ret; 1315 xcb_xv_stop_video_request_t xcb_out; 1316 1317 xcb_out.port = port; 1318 xcb_out.drawable = drawable; 1319 1320 xcb_parts[2].iov_base = (char *) &xcb_out; 1321 xcb_parts[2].iov_len = sizeof(xcb_out); 1322 xcb_parts[3].iov_base = 0; 1323 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1324 1325 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 1326 return xcb_ret; 1327 } 1328 1329 xcb_void_cookie_t 1330 xcb_xv_stop_video (xcb_connection_t *c /**< */, 1331 xcb_xv_port_t port /**< */, 1332 xcb_drawable_t drawable /**< */) 1333 { 1334 static const xcb_protocol_request_t xcb_req = { 1335 /* count */ 2, 1336 /* ext */ &xcb_xv_id, 1337 /* opcode */ XCB_XV_STOP_VIDEO, 1338 /* isvoid */ 1 1339 }; 1340 1341 struct iovec xcb_parts[4]; 1342 xcb_void_cookie_t xcb_ret; 1343 xcb_xv_stop_video_request_t xcb_out; 1344 1345 xcb_out.port = port; 1346 xcb_out.drawable = drawable; 1347 1348 xcb_parts[2].iov_base = (char *) &xcb_out; 1349 xcb_parts[2].iov_len = sizeof(xcb_out); 1350 xcb_parts[3].iov_base = 0; 1351 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1352 1353 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 1354 return xcb_ret; 1355 } 1356 1357 xcb_void_cookie_t 1358 xcb_xv_select_video_notify_checked (xcb_connection_t *c /**< */, 1359 xcb_drawable_t drawable /**< */, 1360 uint8_t onoff /**< */) 1361 { 1362 static const xcb_protocol_request_t xcb_req = { 1363 /* count */ 2, 1364 /* ext */ &xcb_xv_id, 1365 /* opcode */ XCB_XV_SELECT_VIDEO_NOTIFY, 1366 /* isvoid */ 1 1367 }; 1368 1369 struct iovec xcb_parts[4]; 1370 xcb_void_cookie_t xcb_ret; 1371 xcb_xv_select_video_notify_request_t xcb_out; 1372 1373 xcb_out.drawable = drawable; 1374 xcb_out.onoff = onoff; 1375 memset(xcb_out.pad0, 0, 3); 1376 1377 xcb_parts[2].iov_base = (char *) &xcb_out; 1378 xcb_parts[2].iov_len = sizeof(xcb_out); 1379 xcb_parts[3].iov_base = 0; 1380 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1381 1382 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 1383 return xcb_ret; 1384 } 1385 1386 xcb_void_cookie_t 1387 xcb_xv_select_video_notify (xcb_connection_t *c /**< */, 1388 xcb_drawable_t drawable /**< */, 1389 uint8_t onoff /**< */) 1390 { 1391 static const xcb_protocol_request_t xcb_req = { 1392 /* count */ 2, 1393 /* ext */ &xcb_xv_id, 1394 /* opcode */ XCB_XV_SELECT_VIDEO_NOTIFY, 1395 /* isvoid */ 1 1396 }; 1397 1398 struct iovec xcb_parts[4]; 1399 xcb_void_cookie_t xcb_ret; 1400 xcb_xv_select_video_notify_request_t xcb_out; 1401 1402 xcb_out.drawable = drawable; 1403 xcb_out.onoff = onoff; 1404 memset(xcb_out.pad0, 0, 3); 1405 1406 xcb_parts[2].iov_base = (char *) &xcb_out; 1407 xcb_parts[2].iov_len = sizeof(xcb_out); 1408 xcb_parts[3].iov_base = 0; 1409 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1410 1411 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 1412 return xcb_ret; 1413 } 1414 1415 xcb_void_cookie_t 1416 xcb_xv_select_port_notify_checked (xcb_connection_t *c /**< */, 1417 xcb_xv_port_t port /**< */, 1418 uint8_t onoff /**< */) 1419 { 1420 static const xcb_protocol_request_t xcb_req = { 1421 /* count */ 2, 1422 /* ext */ &xcb_xv_id, 1423 /* opcode */ XCB_XV_SELECT_PORT_NOTIFY, 1424 /* isvoid */ 1 1425 }; 1426 1427 struct iovec xcb_parts[4]; 1428 xcb_void_cookie_t xcb_ret; 1429 xcb_xv_select_port_notify_request_t xcb_out; 1430 1431 xcb_out.port = port; 1432 xcb_out.onoff = onoff; 1433 memset(xcb_out.pad0, 0, 3); 1434 1435 xcb_parts[2].iov_base = (char *) &xcb_out; 1436 xcb_parts[2].iov_len = sizeof(xcb_out); 1437 xcb_parts[3].iov_base = 0; 1438 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1439 1440 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 1441 return xcb_ret; 1442 } 1443 1444 xcb_void_cookie_t 1445 xcb_xv_select_port_notify (xcb_connection_t *c /**< */, 1446 xcb_xv_port_t port /**< */, 1447 uint8_t onoff /**< */) 1448 { 1449 static const xcb_protocol_request_t xcb_req = { 1450 /* count */ 2, 1451 /* ext */ &xcb_xv_id, 1452 /* opcode */ XCB_XV_SELECT_PORT_NOTIFY, 1453 /* isvoid */ 1 1454 }; 1455 1456 struct iovec xcb_parts[4]; 1457 xcb_void_cookie_t xcb_ret; 1458 xcb_xv_select_port_notify_request_t xcb_out; 1459 1460 xcb_out.port = port; 1461 xcb_out.onoff = onoff; 1462 memset(xcb_out.pad0, 0, 3); 1463 1464 xcb_parts[2].iov_base = (char *) &xcb_out; 1465 xcb_parts[2].iov_len = sizeof(xcb_out); 1466 xcb_parts[3].iov_base = 0; 1467 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1468 1469 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 1470 return xcb_ret; 1471 } 1472 1473 xcb_xv_query_best_size_cookie_t 1474 xcb_xv_query_best_size (xcb_connection_t *c /**< */, 1475 xcb_xv_port_t port /**< */, 1476 uint16_t vid_w /**< */, 1477 uint16_t vid_h /**< */, 1478 uint16_t drw_w /**< */, 1479 uint16_t drw_h /**< */, 1480 uint8_t motion /**< */) 1481 { 1482 static const xcb_protocol_request_t xcb_req = { 1483 /* count */ 2, 1484 /* ext */ &xcb_xv_id, 1485 /* opcode */ XCB_XV_QUERY_BEST_SIZE, 1486 /* isvoid */ 0 1487 }; 1488 1489 struct iovec xcb_parts[4]; 1490 xcb_xv_query_best_size_cookie_t xcb_ret; 1491 xcb_xv_query_best_size_request_t xcb_out; 1492 1493 xcb_out.port = port; 1494 xcb_out.vid_w = vid_w; 1495 xcb_out.vid_h = vid_h; 1496 xcb_out.drw_w = drw_w; 1497 xcb_out.drw_h = drw_h; 1498 xcb_out.motion = motion; 1499 memset(xcb_out.pad0, 0, 3); 1500 1501 xcb_parts[2].iov_base = (char *) &xcb_out; 1502 xcb_parts[2].iov_len = sizeof(xcb_out); 1503 xcb_parts[3].iov_base = 0; 1504 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1505 1506 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 1507 return xcb_ret; 1508 } 1509 1510 xcb_xv_query_best_size_cookie_t 1511 xcb_xv_query_best_size_unchecked (xcb_connection_t *c /**< */, 1512 xcb_xv_port_t port /**< */, 1513 uint16_t vid_w /**< */, 1514 uint16_t vid_h /**< */, 1515 uint16_t drw_w /**< */, 1516 uint16_t drw_h /**< */, 1517 uint8_t motion /**< */) 1518 { 1519 static const xcb_protocol_request_t xcb_req = { 1520 /* count */ 2, 1521 /* ext */ &xcb_xv_id, 1522 /* opcode */ XCB_XV_QUERY_BEST_SIZE, 1523 /* isvoid */ 0 1524 }; 1525 1526 struct iovec xcb_parts[4]; 1527 xcb_xv_query_best_size_cookie_t xcb_ret; 1528 xcb_xv_query_best_size_request_t xcb_out; 1529 1530 xcb_out.port = port; 1531 xcb_out.vid_w = vid_w; 1532 xcb_out.vid_h = vid_h; 1533 xcb_out.drw_w = drw_w; 1534 xcb_out.drw_h = drw_h; 1535 xcb_out.motion = motion; 1536 memset(xcb_out.pad0, 0, 3); 1537 1538 xcb_parts[2].iov_base = (char *) &xcb_out; 1539 xcb_parts[2].iov_len = sizeof(xcb_out); 1540 xcb_parts[3].iov_base = 0; 1541 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1542 1543 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 1544 return xcb_ret; 1545 } 1546 1547 xcb_xv_query_best_size_reply_t * 1548 xcb_xv_query_best_size_reply (xcb_connection_t *c /**< */, 1549 xcb_xv_query_best_size_cookie_t cookie /**< */, 1550 xcb_generic_error_t **e /**< */) 1551 { 1552 return (xcb_xv_query_best_size_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 1553 } 1554 1555 xcb_void_cookie_t 1556 xcb_xv_set_port_attribute_checked (xcb_connection_t *c /**< */, 1557 xcb_xv_port_t port /**< */, 1558 xcb_atom_t attribute /**< */, 1559 int32_t value /**< */) 1560 { 1561 static const xcb_protocol_request_t xcb_req = { 1562 /* count */ 2, 1563 /* ext */ &xcb_xv_id, 1564 /* opcode */ XCB_XV_SET_PORT_ATTRIBUTE, 1565 /* isvoid */ 1 1566 }; 1567 1568 struct iovec xcb_parts[4]; 1569 xcb_void_cookie_t xcb_ret; 1570 xcb_xv_set_port_attribute_request_t xcb_out; 1571 1572 xcb_out.port = port; 1573 xcb_out.attribute = attribute; 1574 xcb_out.value = value; 1575 1576 xcb_parts[2].iov_base = (char *) &xcb_out; 1577 xcb_parts[2].iov_len = sizeof(xcb_out); 1578 xcb_parts[3].iov_base = 0; 1579 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1580 1581 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 1582 return xcb_ret; 1583 } 1584 1585 xcb_void_cookie_t 1586 xcb_xv_set_port_attribute (xcb_connection_t *c /**< */, 1587 xcb_xv_port_t port /**< */, 1588 xcb_atom_t attribute /**< */, 1589 int32_t value /**< */) 1590 { 1591 static const xcb_protocol_request_t xcb_req = { 1592 /* count */ 2, 1593 /* ext */ &xcb_xv_id, 1594 /* opcode */ XCB_XV_SET_PORT_ATTRIBUTE, 1595 /* isvoid */ 1 1596 }; 1597 1598 struct iovec xcb_parts[4]; 1599 xcb_void_cookie_t xcb_ret; 1600 xcb_xv_set_port_attribute_request_t xcb_out; 1601 1602 xcb_out.port = port; 1603 xcb_out.attribute = attribute; 1604 xcb_out.value = value; 1605 1606 xcb_parts[2].iov_base = (char *) &xcb_out; 1607 xcb_parts[2].iov_len = sizeof(xcb_out); 1608 xcb_parts[3].iov_base = 0; 1609 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1610 1611 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 1612 return xcb_ret; 1613 } 1614 1615 xcb_xv_get_port_attribute_cookie_t 1616 xcb_xv_get_port_attribute (xcb_connection_t *c /**< */, 1617 xcb_xv_port_t port /**< */, 1618 xcb_atom_t attribute /**< */) 1619 { 1620 static const xcb_protocol_request_t xcb_req = { 1621 /* count */ 2, 1622 /* ext */ &xcb_xv_id, 1623 /* opcode */ XCB_XV_GET_PORT_ATTRIBUTE, 1624 /* isvoid */ 0 1625 }; 1626 1627 struct iovec xcb_parts[4]; 1628 xcb_xv_get_port_attribute_cookie_t xcb_ret; 1629 xcb_xv_get_port_attribute_request_t xcb_out; 1630 1631 xcb_out.port = port; 1632 xcb_out.attribute = attribute; 1633 1634 xcb_parts[2].iov_base = (char *) &xcb_out; 1635 xcb_parts[2].iov_len = sizeof(xcb_out); 1636 xcb_parts[3].iov_base = 0; 1637 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1638 1639 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 1640 return xcb_ret; 1641 } 1642 1643 xcb_xv_get_port_attribute_cookie_t 1644 xcb_xv_get_port_attribute_unchecked (xcb_connection_t *c /**< */, 1645 xcb_xv_port_t port /**< */, 1646 xcb_atom_t attribute /**< */) 1647 { 1648 static const xcb_protocol_request_t xcb_req = { 1649 /* count */ 2, 1650 /* ext */ &xcb_xv_id, 1651 /* opcode */ XCB_XV_GET_PORT_ATTRIBUTE, 1652 /* isvoid */ 0 1653 }; 1654 1655 struct iovec xcb_parts[4]; 1656 xcb_xv_get_port_attribute_cookie_t xcb_ret; 1657 xcb_xv_get_port_attribute_request_t xcb_out; 1658 1659 xcb_out.port = port; 1660 xcb_out.attribute = attribute; 1661 1662 xcb_parts[2].iov_base = (char *) &xcb_out; 1663 xcb_parts[2].iov_len = sizeof(xcb_out); 1664 xcb_parts[3].iov_base = 0; 1665 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1666 1667 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 1668 return xcb_ret; 1669 } 1670 1671 xcb_xv_get_port_attribute_reply_t * 1672 xcb_xv_get_port_attribute_reply (xcb_connection_t *c /**< */, 1673 xcb_xv_get_port_attribute_cookie_t cookie /**< */, 1674 xcb_generic_error_t **e /**< */) 1675 { 1676 return (xcb_xv_get_port_attribute_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 1677 } 1678 1679 int 1680 xcb_xv_query_port_attributes_sizeof (const void *_buffer /**< */) 1681 { 1682 char *xcb_tmp = (char *)_buffer; 1683 const xcb_xv_query_port_attributes_reply_t *_aux = (xcb_xv_query_port_attributes_reply_t *)_buffer; 1684 unsigned int xcb_buffer_len = 0; 1685 unsigned int xcb_block_len = 0; 1686 unsigned int xcb_pad = 0; 1687 unsigned int xcb_align_to = 0; 1688 1689 unsigned int i; 1690 unsigned int xcb_tmp_len; 1691 1692 xcb_block_len += sizeof(xcb_xv_query_port_attributes_reply_t); 1693 xcb_tmp += xcb_block_len; 1694 xcb_buffer_len += xcb_block_len; 1695 xcb_block_len = 0; 1696 /* attributes */ 1697 for(i=0; i<_aux->num_attributes; i++) { 1698 xcb_tmp_len = xcb_xv_attribute_info_sizeof(xcb_tmp); 1699 xcb_block_len += xcb_tmp_len; 1700 xcb_tmp += xcb_tmp_len; 1701 } 1702 xcb_align_to = ALIGNOF(xcb_xv_attribute_info_t); 1703 /* insert padding */ 1704 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 1705 xcb_buffer_len += xcb_block_len + xcb_pad; 1706 if (0 != xcb_pad) { 1707 xcb_tmp += xcb_pad; 1708 xcb_pad = 0; 1709 } 1710 xcb_block_len = 0; 1711 1712 return xcb_buffer_len; 1713 } 1714 1715 xcb_xv_query_port_attributes_cookie_t 1716 xcb_xv_query_port_attributes (xcb_connection_t *c /**< */, 1717 xcb_xv_port_t port /**< */) 1718 { 1719 static const xcb_protocol_request_t xcb_req = { 1720 /* count */ 2, 1721 /* ext */ &xcb_xv_id, 1722 /* opcode */ XCB_XV_QUERY_PORT_ATTRIBUTES, 1723 /* isvoid */ 0 1724 }; 1725 1726 struct iovec xcb_parts[4]; 1727 xcb_xv_query_port_attributes_cookie_t xcb_ret; 1728 xcb_xv_query_port_attributes_request_t xcb_out; 1729 1730 xcb_out.port = port; 1731 1732 xcb_parts[2].iov_base = (char *) &xcb_out; 1733 xcb_parts[2].iov_len = sizeof(xcb_out); 1734 xcb_parts[3].iov_base = 0; 1735 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1736 1737 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 1738 return xcb_ret; 1739 } 1740 1741 xcb_xv_query_port_attributes_cookie_t 1742 xcb_xv_query_port_attributes_unchecked (xcb_connection_t *c /**< */, 1743 xcb_xv_port_t port /**< */) 1744 { 1745 static const xcb_protocol_request_t xcb_req = { 1746 /* count */ 2, 1747 /* ext */ &xcb_xv_id, 1748 /* opcode */ XCB_XV_QUERY_PORT_ATTRIBUTES, 1749 /* isvoid */ 0 1750 }; 1751 1752 struct iovec xcb_parts[4]; 1753 xcb_xv_query_port_attributes_cookie_t xcb_ret; 1754 xcb_xv_query_port_attributes_request_t xcb_out; 1755 1756 xcb_out.port = port; 1757 1758 xcb_parts[2].iov_base = (char *) &xcb_out; 1759 xcb_parts[2].iov_len = sizeof(xcb_out); 1760 xcb_parts[3].iov_base = 0; 1761 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1762 1763 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 1764 return xcb_ret; 1765 } 1766 1767 int 1768 xcb_xv_query_port_attributes_attributes_length (const xcb_xv_query_port_attributes_reply_t *R /**< */) 1769 { 1770 return R->num_attributes; 1771 } 1772 1773 xcb_xv_attribute_info_iterator_t 1774 xcb_xv_query_port_attributes_attributes_iterator (const xcb_xv_query_port_attributes_reply_t *R /**< */) 1775 { 1776 xcb_xv_attribute_info_iterator_t i; 1777 i.data = (xcb_xv_attribute_info_t *) (R + 1); 1778 i.rem = R->num_attributes; 1779 i.index = (char *) i.data - (char *) R; 1780 return i; 1781 } 1782 1783 xcb_xv_query_port_attributes_reply_t * 1784 xcb_xv_query_port_attributes_reply (xcb_connection_t *c /**< */, 1785 xcb_xv_query_port_attributes_cookie_t cookie /**< */, 1786 xcb_generic_error_t **e /**< */) 1787 { 1788 return (xcb_xv_query_port_attributes_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 1789 } 1790 1791 int 1792 xcb_xv_list_image_formats_sizeof (const void *_buffer /**< */) 1793 { 1794 char *xcb_tmp = (char *)_buffer; 1795 const xcb_xv_list_image_formats_reply_t *_aux = (xcb_xv_list_image_formats_reply_t *)_buffer; 1796 unsigned int xcb_buffer_len = 0; 1797 unsigned int xcb_block_len = 0; 1798 unsigned int xcb_pad = 0; 1799 unsigned int xcb_align_to = 0; 1800 1801 1802 xcb_block_len += sizeof(xcb_xv_list_image_formats_reply_t); 1803 xcb_tmp += xcb_block_len; 1804 xcb_buffer_len += xcb_block_len; 1805 xcb_block_len = 0; 1806 /* format */ 1807 xcb_block_len += _aux->num_formats * sizeof(xcb_xv_image_format_info_t); 1808 xcb_tmp += xcb_block_len; 1809 xcb_align_to = ALIGNOF(xcb_xv_image_format_info_t); 1810 /* insert padding */ 1811 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 1812 xcb_buffer_len += xcb_block_len + xcb_pad; 1813 if (0 != xcb_pad) { 1814 xcb_tmp += xcb_pad; 1815 xcb_pad = 0; 1816 } 1817 xcb_block_len = 0; 1818 1819 return xcb_buffer_len; 1820 } 1821 1822 xcb_xv_list_image_formats_cookie_t 1823 xcb_xv_list_image_formats (xcb_connection_t *c /**< */, 1824 xcb_xv_port_t port /**< */) 1825 { 1826 static const xcb_protocol_request_t xcb_req = { 1827 /* count */ 2, 1828 /* ext */ &xcb_xv_id, 1829 /* opcode */ XCB_XV_LIST_IMAGE_FORMATS, 1830 /* isvoid */ 0 1831 }; 1832 1833 struct iovec xcb_parts[4]; 1834 xcb_xv_list_image_formats_cookie_t xcb_ret; 1835 xcb_xv_list_image_formats_request_t xcb_out; 1836 1837 xcb_out.port = port; 1838 1839 xcb_parts[2].iov_base = (char *) &xcb_out; 1840 xcb_parts[2].iov_len = sizeof(xcb_out); 1841 xcb_parts[3].iov_base = 0; 1842 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1843 1844 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 1845 return xcb_ret; 1846 } 1847 1848 xcb_xv_list_image_formats_cookie_t 1849 xcb_xv_list_image_formats_unchecked (xcb_connection_t *c /**< */, 1850 xcb_xv_port_t port /**< */) 1851 { 1852 static const xcb_protocol_request_t xcb_req = { 1853 /* count */ 2, 1854 /* ext */ &xcb_xv_id, 1855 /* opcode */ XCB_XV_LIST_IMAGE_FORMATS, 1856 /* isvoid */ 0 1857 }; 1858 1859 struct iovec xcb_parts[4]; 1860 xcb_xv_list_image_formats_cookie_t xcb_ret; 1861 xcb_xv_list_image_formats_request_t xcb_out; 1862 1863 xcb_out.port = port; 1864 1865 xcb_parts[2].iov_base = (char *) &xcb_out; 1866 xcb_parts[2].iov_len = sizeof(xcb_out); 1867 xcb_parts[3].iov_base = 0; 1868 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1869 1870 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 1871 return xcb_ret; 1872 } 1873 1874 xcb_xv_image_format_info_t * 1875 xcb_xv_list_image_formats_format (const xcb_xv_list_image_formats_reply_t *R /**< */) 1876 { 1877 return (xcb_xv_image_format_info_t *) (R + 1); 1878 } 1879 1880 int 1881 xcb_xv_list_image_formats_format_length (const xcb_xv_list_image_formats_reply_t *R /**< */) 1882 { 1883 return R->num_formats; 1884 } 1885 1886 xcb_xv_image_format_info_iterator_t 1887 xcb_xv_list_image_formats_format_iterator (const xcb_xv_list_image_formats_reply_t *R /**< */) 1888 { 1889 xcb_xv_image_format_info_iterator_t i; 1890 i.data = (xcb_xv_image_format_info_t *) (R + 1); 1891 i.rem = R->num_formats; 1892 i.index = (char *) i.data - (char *) R; 1893 return i; 1894 } 1895 1896 xcb_xv_list_image_formats_reply_t * 1897 xcb_xv_list_image_formats_reply (xcb_connection_t *c /**< */, 1898 xcb_xv_list_image_formats_cookie_t cookie /**< */, 1899 xcb_generic_error_t **e /**< */) 1900 { 1901 return (xcb_xv_list_image_formats_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 1902 } 1903 1904 int 1905 xcb_xv_query_image_attributes_sizeof (const void *_buffer /**< */) 1906 { 1907 char *xcb_tmp = (char *)_buffer; 1908 const xcb_xv_query_image_attributes_reply_t *_aux = (xcb_xv_query_image_attributes_reply_t *)_buffer; 1909 unsigned int xcb_buffer_len = 0; 1910 unsigned int xcb_block_len = 0; 1911 unsigned int xcb_pad = 0; 1912 unsigned int xcb_align_to = 0; 1913 1914 1915 xcb_block_len += sizeof(xcb_xv_query_image_attributes_reply_t); 1916 xcb_tmp += xcb_block_len; 1917 xcb_buffer_len += xcb_block_len; 1918 xcb_block_len = 0; 1919 /* pitches */ 1920 xcb_block_len += _aux->num_planes * sizeof(uint32_t); 1921 xcb_tmp += xcb_block_len; 1922 xcb_align_to = ALIGNOF(uint32_t); 1923 /* insert padding */ 1924 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 1925 xcb_buffer_len += xcb_block_len + xcb_pad; 1926 if (0 != xcb_pad) { 1927 xcb_tmp += xcb_pad; 1928 xcb_pad = 0; 1929 } 1930 xcb_block_len = 0; 1931 /* offsets */ 1932 xcb_block_len += _aux->num_planes * sizeof(uint32_t); 1933 xcb_tmp += xcb_block_len; 1934 xcb_align_to = ALIGNOF(uint32_t); 1935 /* insert padding */ 1936 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 1937 xcb_buffer_len += xcb_block_len + xcb_pad; 1938 if (0 != xcb_pad) { 1939 xcb_tmp += xcb_pad; 1940 xcb_pad = 0; 1941 } 1942 xcb_block_len = 0; 1943 1944 return xcb_buffer_len; 1945 } 1946 1947 xcb_xv_query_image_attributes_cookie_t 1948 xcb_xv_query_image_attributes (xcb_connection_t *c /**< */, 1949 xcb_xv_port_t port /**< */, 1950 uint32_t id /**< */, 1951 uint16_t width /**< */, 1952 uint16_t height /**< */) 1953 { 1954 static const xcb_protocol_request_t xcb_req = { 1955 /* count */ 2, 1956 /* ext */ &xcb_xv_id, 1957 /* opcode */ XCB_XV_QUERY_IMAGE_ATTRIBUTES, 1958 /* isvoid */ 0 1959 }; 1960 1961 struct iovec xcb_parts[4]; 1962 xcb_xv_query_image_attributes_cookie_t xcb_ret; 1963 xcb_xv_query_image_attributes_request_t xcb_out; 1964 1965 xcb_out.port = port; 1966 xcb_out.id = id; 1967 xcb_out.width = width; 1968 xcb_out.height = height; 1969 1970 xcb_parts[2].iov_base = (char *) &xcb_out; 1971 xcb_parts[2].iov_len = sizeof(xcb_out); 1972 xcb_parts[3].iov_base = 0; 1973 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1974 1975 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 1976 return xcb_ret; 1977 } 1978 1979 xcb_xv_query_image_attributes_cookie_t 1980 xcb_xv_query_image_attributes_unchecked (xcb_connection_t *c /**< */, 1981 xcb_xv_port_t port /**< */, 1982 uint32_t id /**< */, 1983 uint16_t width /**< */, 1984 uint16_t height /**< */) 1985 { 1986 static const xcb_protocol_request_t xcb_req = { 1987 /* count */ 2, 1988 /* ext */ &xcb_xv_id, 1989 /* opcode */ XCB_XV_QUERY_IMAGE_ATTRIBUTES, 1990 /* isvoid */ 0 1991 }; 1992 1993 struct iovec xcb_parts[4]; 1994 xcb_xv_query_image_attributes_cookie_t xcb_ret; 1995 xcb_xv_query_image_attributes_request_t xcb_out; 1996 1997 xcb_out.port = port; 1998 xcb_out.id = id; 1999 xcb_out.width = width; 2000 xcb_out.height = height; 2001 2002 xcb_parts[2].iov_base = (char *) &xcb_out; 2003 xcb_parts[2].iov_len = sizeof(xcb_out); 2004 xcb_parts[3].iov_base = 0; 2005 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 2006 2007 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 2008 return xcb_ret; 2009 } 2010 2011 uint32_t * 2012 xcb_xv_query_image_attributes_pitches (const xcb_xv_query_image_attributes_reply_t *R /**< */) 2013 { 2014 return (uint32_t *) (R + 1); 2015 } 2016 2017 int 2018 xcb_xv_query_image_attributes_pitches_length (const xcb_xv_query_image_attributes_reply_t *R /**< */) 2019 { 2020 return R->num_planes; 2021 } 2022 2023 xcb_generic_iterator_t 2024 xcb_xv_query_image_attributes_pitches_end (const xcb_xv_query_image_attributes_reply_t *R /**< */) 2025 { 2026 xcb_generic_iterator_t i; 2027 i.data = ((uint32_t *) (R + 1)) + (R->num_planes); 2028 i.rem = 0; 2029 i.index = (char *) i.data - (char *) R; 2030 return i; 2031 } 2032 2033 uint32_t * 2034 xcb_xv_query_image_attributes_offsets (const xcb_xv_query_image_attributes_reply_t *R /**< */) 2035 { 2036 xcb_generic_iterator_t prev = xcb_xv_query_image_attributes_pitches_end(R); 2037 return (uint32_t *) ((char *) prev.data + XCB_TYPE_PAD(uint32_t, prev.index) + 0); 2038 } 2039 2040 int 2041 xcb_xv_query_image_attributes_offsets_length (const xcb_xv_query_image_attributes_reply_t *R /**< */) 2042 { 2043 return R->num_planes; 2044 } 2045 2046 xcb_generic_iterator_t 2047 xcb_xv_query_image_attributes_offsets_end (const xcb_xv_query_image_attributes_reply_t *R /**< */) 2048 { 2049 xcb_generic_iterator_t i; 2050 xcb_generic_iterator_t child = xcb_xv_query_image_attributes_pitches_end(R); 2051 i.data = ((uint32_t *) child.data) + (R->num_planes); 2052 i.rem = 0; 2053 i.index = (char *) i.data - (char *) R; 2054 return i; 2055 } 2056 2057 xcb_xv_query_image_attributes_reply_t * 2058 xcb_xv_query_image_attributes_reply (xcb_connection_t *c /**< */, 2059 xcb_xv_query_image_attributes_cookie_t cookie /**< */, 2060 xcb_generic_error_t **e /**< */) 2061 { 2062 return (xcb_xv_query_image_attributes_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 2063 } 2064 2065 int 2066 xcb_xv_put_image_sizeof (const void *_buffer /**< */, 2067 uint32_t data_len /**< */) 2068 { 2069 char *xcb_tmp = (char *)_buffer; 2070 unsigned int xcb_buffer_len = 0; 2071 unsigned int xcb_block_len = 0; 2072 unsigned int xcb_pad = 0; 2073 unsigned int xcb_align_to = 0; 2074 2075 2076 xcb_block_len += sizeof(xcb_xv_put_image_request_t); 2077 xcb_tmp += xcb_block_len; 2078 xcb_buffer_len += xcb_block_len; 2079 xcb_block_len = 0; 2080 /* data */ 2081 xcb_block_len += data_len * sizeof(uint8_t); 2082 xcb_tmp += xcb_block_len; 2083 xcb_align_to = ALIGNOF(uint8_t); 2084 /* insert padding */ 2085 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 2086 xcb_buffer_len += xcb_block_len + xcb_pad; 2087 if (0 != xcb_pad) { 2088 xcb_tmp += xcb_pad; 2089 xcb_pad = 0; 2090 } 2091 xcb_block_len = 0; 2092 2093 return xcb_buffer_len; 2094 } 2095 2096 xcb_void_cookie_t 2097 xcb_xv_put_image_checked (xcb_connection_t *c /**< */, 2098 xcb_xv_port_t port /**< */, 2099 xcb_drawable_t drawable /**< */, 2100 xcb_gcontext_t gc /**< */, 2101 uint32_t id /**< */, 2102 int16_t src_x /**< */, 2103 int16_t src_y /**< */, 2104 uint16_t src_w /**< */, 2105 uint16_t src_h /**< */, 2106 int16_t drw_x /**< */, 2107 int16_t drw_y /**< */, 2108 uint16_t drw_w /**< */, 2109 uint16_t drw_h /**< */, 2110 uint16_t width /**< */, 2111 uint16_t height /**< */, 2112 uint32_t data_len /**< */, 2113 const uint8_t *data /**< */) 2114 { 2115 static const xcb_protocol_request_t xcb_req = { 2116 /* count */ 4, 2117 /* ext */ &xcb_xv_id, 2118 /* opcode */ XCB_XV_PUT_IMAGE, 2119 /* isvoid */ 1 2120 }; 2121 2122 struct iovec xcb_parts[6]; 2123 xcb_void_cookie_t xcb_ret; 2124 xcb_xv_put_image_request_t xcb_out; 2125 2126 xcb_out.port = port; 2127 xcb_out.drawable = drawable; 2128 xcb_out.gc = gc; 2129 xcb_out.id = id; 2130 xcb_out.src_x = src_x; 2131 xcb_out.src_y = src_y; 2132 xcb_out.src_w = src_w; 2133 xcb_out.src_h = src_h; 2134 xcb_out.drw_x = drw_x; 2135 xcb_out.drw_y = drw_y; 2136 xcb_out.drw_w = drw_w; 2137 xcb_out.drw_h = drw_h; 2138 xcb_out.width = width; 2139 xcb_out.height = height; 2140 2141 xcb_parts[2].iov_base = (char *) &xcb_out; 2142 xcb_parts[2].iov_len = sizeof(xcb_out); 2143 xcb_parts[3].iov_base = 0; 2144 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 2145 /* uint8_t data */ 2146 xcb_parts[4].iov_base = (char *) data; 2147 xcb_parts[4].iov_len = data_len * sizeof(uint8_t); 2148 xcb_parts[5].iov_base = 0; 2149 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; 2150 2151 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 2152 return xcb_ret; 2153 } 2154 2155 xcb_void_cookie_t 2156 xcb_xv_put_image (xcb_connection_t *c /**< */, 2157 xcb_xv_port_t port /**< */, 2158 xcb_drawable_t drawable /**< */, 2159 xcb_gcontext_t gc /**< */, 2160 uint32_t id /**< */, 2161 int16_t src_x /**< */, 2162 int16_t src_y /**< */, 2163 uint16_t src_w /**< */, 2164 uint16_t src_h /**< */, 2165 int16_t drw_x /**< */, 2166 int16_t drw_y /**< */, 2167 uint16_t drw_w /**< */, 2168 uint16_t drw_h /**< */, 2169 uint16_t width /**< */, 2170 uint16_t height /**< */, 2171 uint32_t data_len /**< */, 2172 const uint8_t *data /**< */) 2173 { 2174 static const xcb_protocol_request_t xcb_req = { 2175 /* count */ 4, 2176 /* ext */ &xcb_xv_id, 2177 /* opcode */ XCB_XV_PUT_IMAGE, 2178 /* isvoid */ 1 2179 }; 2180 2181 struct iovec xcb_parts[6]; 2182 xcb_void_cookie_t xcb_ret; 2183 xcb_xv_put_image_request_t xcb_out; 2184 2185 xcb_out.port = port; 2186 xcb_out.drawable = drawable; 2187 xcb_out.gc = gc; 2188 xcb_out.id = id; 2189 xcb_out.src_x = src_x; 2190 xcb_out.src_y = src_y; 2191 xcb_out.src_w = src_w; 2192 xcb_out.src_h = src_h; 2193 xcb_out.drw_x = drw_x; 2194 xcb_out.drw_y = drw_y; 2195 xcb_out.drw_w = drw_w; 2196 xcb_out.drw_h = drw_h; 2197 xcb_out.width = width; 2198 xcb_out.height = height; 2199 2200 xcb_parts[2].iov_base = (char *) &xcb_out; 2201 xcb_parts[2].iov_len = sizeof(xcb_out); 2202 xcb_parts[3].iov_base = 0; 2203 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 2204 /* uint8_t data */ 2205 xcb_parts[4].iov_base = (char *) data; 2206 xcb_parts[4].iov_len = data_len * sizeof(uint8_t); 2207 xcb_parts[5].iov_base = 0; 2208 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; 2209 2210 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 2211 return xcb_ret; 2212 } 2213 2214 xcb_void_cookie_t 2215 xcb_xv_shm_put_image_checked (xcb_connection_t *c /**< */, 2216 xcb_xv_port_t port /**< */, 2217 xcb_drawable_t drawable /**< */, 2218 xcb_gcontext_t gc /**< */, 2219 xcb_shm_seg_t shmseg /**< */, 2220 uint32_t id /**< */, 2221 uint32_t offset /**< */, 2222 int16_t src_x /**< */, 2223 int16_t src_y /**< */, 2224 uint16_t src_w /**< */, 2225 uint16_t src_h /**< */, 2226 int16_t drw_x /**< */, 2227 int16_t drw_y /**< */, 2228 uint16_t drw_w /**< */, 2229 uint16_t drw_h /**< */, 2230 uint16_t width /**< */, 2231 uint16_t height /**< */, 2232 uint8_t send_event /**< */) 2233 { 2234 static const xcb_protocol_request_t xcb_req = { 2235 /* count */ 2, 2236 /* ext */ &xcb_xv_id, 2237 /* opcode */ XCB_XV_SHM_PUT_IMAGE, 2238 /* isvoid */ 1 2239 }; 2240 2241 struct iovec xcb_parts[4]; 2242 xcb_void_cookie_t xcb_ret; 2243 xcb_xv_shm_put_image_request_t xcb_out; 2244 2245 xcb_out.port = port; 2246 xcb_out.drawable = drawable; 2247 xcb_out.gc = gc; 2248 xcb_out.shmseg = shmseg; 2249 xcb_out.id = id; 2250 xcb_out.offset = offset; 2251 xcb_out.src_x = src_x; 2252 xcb_out.src_y = src_y; 2253 xcb_out.src_w = src_w; 2254 xcb_out.src_h = src_h; 2255 xcb_out.drw_x = drw_x; 2256 xcb_out.drw_y = drw_y; 2257 xcb_out.drw_w = drw_w; 2258 xcb_out.drw_h = drw_h; 2259 xcb_out.width = width; 2260 xcb_out.height = height; 2261 xcb_out.send_event = send_event; 2262 memset(xcb_out.pad0, 0, 3); 2263 2264 xcb_parts[2].iov_base = (char *) &xcb_out; 2265 xcb_parts[2].iov_len = sizeof(xcb_out); 2266 xcb_parts[3].iov_base = 0; 2267 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 2268 2269 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 2270 return xcb_ret; 2271 } 2272 2273 xcb_void_cookie_t 2274 xcb_xv_shm_put_image (xcb_connection_t *c /**< */, 2275 xcb_xv_port_t port /**< */, 2276 xcb_drawable_t drawable /**< */, 2277 xcb_gcontext_t gc /**< */, 2278 xcb_shm_seg_t shmseg /**< */, 2279 uint32_t id /**< */, 2280 uint32_t offset /**< */, 2281 int16_t src_x /**< */, 2282 int16_t src_y /**< */, 2283 uint16_t src_w /**< */, 2284 uint16_t src_h /**< */, 2285 int16_t drw_x /**< */, 2286 int16_t drw_y /**< */, 2287 uint16_t drw_w /**< */, 2288 uint16_t drw_h /**< */, 2289 uint16_t width /**< */, 2290 uint16_t height /**< */, 2291 uint8_t send_event /**< */) 2292 { 2293 static const xcb_protocol_request_t xcb_req = { 2294 /* count */ 2, 2295 /* ext */ &xcb_xv_id, 2296 /* opcode */ XCB_XV_SHM_PUT_IMAGE, 2297 /* isvoid */ 1 2298 }; 2299 2300 struct iovec xcb_parts[4]; 2301 xcb_void_cookie_t xcb_ret; 2302 xcb_xv_shm_put_image_request_t xcb_out; 2303 2304 xcb_out.port = port; 2305 xcb_out.drawable = drawable; 2306 xcb_out.gc = gc; 2307 xcb_out.shmseg = shmseg; 2308 xcb_out.id = id; 2309 xcb_out.offset = offset; 2310 xcb_out.src_x = src_x; 2311 xcb_out.src_y = src_y; 2312 xcb_out.src_w = src_w; 2313 xcb_out.src_h = src_h; 2314 xcb_out.drw_x = drw_x; 2315 xcb_out.drw_y = drw_y; 2316 xcb_out.drw_w = drw_w; 2317 xcb_out.drw_h = drw_h; 2318 xcb_out.width = width; 2319 xcb_out.height = height; 2320 xcb_out.send_event = send_event; 2321 memset(xcb_out.pad0, 0, 3); 2322 2323 xcb_parts[2].iov_base = (char *) &xcb_out; 2324 xcb_parts[2].iov_len = sizeof(xcb_out); 2325 xcb_parts[3].iov_base = 0; 2326 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 2327 2328 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 2329 return xcb_ret; 2330 } 2331 2332