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 23 /***************************************************************************** 24 ** 25 ** void xcb_xv_port_next 26 ** 27 ** @param xcb_xv_port_iterator_t *i 28 ** @returns void 29 ** 30 *****************************************************************************/ 31 32 void 33 xcb_xv_port_next (xcb_xv_port_iterator_t *i /**< */) 34 { 35 --i->rem; 36 ++i->data; 37 i->index += sizeof(xcb_xv_port_t); 38 } 39 40 41 /***************************************************************************** 42 ** 43 ** xcb_generic_iterator_t xcb_xv_port_end 44 ** 45 ** @param xcb_xv_port_iterator_t i 46 ** @returns xcb_generic_iterator_t 47 ** 48 *****************************************************************************/ 49 50 xcb_generic_iterator_t 51 xcb_xv_port_end (xcb_xv_port_iterator_t i /**< */) 52 { 53 xcb_generic_iterator_t ret; 54 ret.data = i.data + i.rem; 55 ret.index = i.index + ((char *) ret.data - (char *) i.data); 56 ret.rem = 0; 57 return ret; 58 } 59 60 61 /***************************************************************************** 62 ** 63 ** void xcb_xv_encoding_next 64 ** 65 ** @param xcb_xv_encoding_iterator_t *i 66 ** @returns void 67 ** 68 *****************************************************************************/ 69 70 void 71 xcb_xv_encoding_next (xcb_xv_encoding_iterator_t *i /**< */) 72 { 73 --i->rem; 74 ++i->data; 75 i->index += sizeof(xcb_xv_encoding_t); 76 } 77 78 79 /***************************************************************************** 80 ** 81 ** xcb_generic_iterator_t xcb_xv_encoding_end 82 ** 83 ** @param xcb_xv_encoding_iterator_t i 84 ** @returns xcb_generic_iterator_t 85 ** 86 *****************************************************************************/ 87 88 xcb_generic_iterator_t 89 xcb_xv_encoding_end (xcb_xv_encoding_iterator_t i /**< */) 90 { 91 xcb_generic_iterator_t ret; 92 ret.data = i.data + i.rem; 93 ret.index = i.index + ((char *) ret.data - (char *) i.data); 94 ret.rem = 0; 95 return ret; 96 } 97 98 99 /***************************************************************************** 100 ** 101 ** void xcb_xv_rational_next 102 ** 103 ** @param xcb_xv_rational_iterator_t *i 104 ** @returns void 105 ** 106 *****************************************************************************/ 107 108 void 109 xcb_xv_rational_next (xcb_xv_rational_iterator_t *i /**< */) 110 { 111 --i->rem; 112 ++i->data; 113 i->index += sizeof(xcb_xv_rational_t); 114 } 115 116 117 /***************************************************************************** 118 ** 119 ** xcb_generic_iterator_t xcb_xv_rational_end 120 ** 121 ** @param xcb_xv_rational_iterator_t i 122 ** @returns xcb_generic_iterator_t 123 ** 124 *****************************************************************************/ 125 126 xcb_generic_iterator_t 127 xcb_xv_rational_end (xcb_xv_rational_iterator_t i /**< */) 128 { 129 xcb_generic_iterator_t ret; 130 ret.data = i.data + i.rem; 131 ret.index = i.index + ((char *) ret.data - (char *) i.data); 132 ret.rem = 0; 133 return ret; 134 } 135 136 137 /***************************************************************************** 138 ** 139 ** void xcb_xv_format_next 140 ** 141 ** @param xcb_xv_format_iterator_t *i 142 ** @returns void 143 ** 144 *****************************************************************************/ 145 146 void 147 xcb_xv_format_next (xcb_xv_format_iterator_t *i /**< */) 148 { 149 --i->rem; 150 ++i->data; 151 i->index += sizeof(xcb_xv_format_t); 152 } 153 154 155 /***************************************************************************** 156 ** 157 ** xcb_generic_iterator_t xcb_xv_format_end 158 ** 159 ** @param xcb_xv_format_iterator_t i 160 ** @returns xcb_generic_iterator_t 161 ** 162 *****************************************************************************/ 163 164 xcb_generic_iterator_t 165 xcb_xv_format_end (xcb_xv_format_iterator_t i /**< */) 166 { 167 xcb_generic_iterator_t ret; 168 ret.data = i.data + i.rem; 169 ret.index = i.index + ((char *) ret.data - (char *) i.data); 170 ret.rem = 0; 171 return ret; 172 } 173 174 int 175 xcb_xv_adaptor_info_sizeof (const void *_buffer /**< */) 176 { 177 char *xcb_tmp = (char *)_buffer; 178 const xcb_xv_adaptor_info_t *_aux = (xcb_xv_adaptor_info_t *)_buffer; 179 unsigned int xcb_buffer_len = 0; 180 unsigned int xcb_block_len = 0; 181 unsigned int xcb_pad = 0; 182 unsigned int xcb_align_to = 0; 183 184 185 xcb_block_len += sizeof(xcb_xv_adaptor_info_t); 186 xcb_tmp += xcb_block_len; 187 xcb_buffer_len += xcb_block_len; 188 xcb_block_len = 0; 189 /* name */ 190 xcb_block_len += _aux->name_size * sizeof(char); 191 xcb_tmp += xcb_block_len; 192 xcb_align_to = ALIGNOF(char); 193 /* insert padding */ 194 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 195 xcb_buffer_len += xcb_block_len + xcb_pad; 196 if (0 != xcb_pad) { 197 xcb_tmp += xcb_pad; 198 xcb_pad = 0; 199 } 200 xcb_block_len = 0; 201 /* formats */ 202 xcb_block_len += _aux->num_formats * sizeof(xcb_xv_format_t); 203 xcb_tmp += xcb_block_len; 204 xcb_align_to = ALIGNOF(xcb_xv_format_t); 205 /* insert padding */ 206 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 207 xcb_buffer_len += xcb_block_len + xcb_pad; 208 if (0 != xcb_pad) { 209 xcb_tmp += xcb_pad; 210 xcb_pad = 0; 211 } 212 xcb_block_len = 0; 213 214 return xcb_buffer_len; 215 } 216 217 218 /***************************************************************************** 219 ** 220 ** char * xcb_xv_adaptor_info_name 221 ** 222 ** @param const xcb_xv_adaptor_info_t *R 223 ** @returns char * 224 ** 225 *****************************************************************************/ 226 227 char * 228 xcb_xv_adaptor_info_name (const xcb_xv_adaptor_info_t *R /**< */) 229 { 230 return (char *) (R + 1); 231 } 232 233 234 /***************************************************************************** 235 ** 236 ** int xcb_xv_adaptor_info_name_length 237 ** 238 ** @param const xcb_xv_adaptor_info_t *R 239 ** @returns int 240 ** 241 *****************************************************************************/ 242 243 int 244 xcb_xv_adaptor_info_name_length (const xcb_xv_adaptor_info_t *R /**< */) 245 { 246 return R->name_size; 247 } 248 249 250 /***************************************************************************** 251 ** 252 ** xcb_generic_iterator_t xcb_xv_adaptor_info_name_end 253 ** 254 ** @param const xcb_xv_adaptor_info_t *R 255 ** @returns xcb_generic_iterator_t 256 ** 257 *****************************************************************************/ 258 259 xcb_generic_iterator_t 260 xcb_xv_adaptor_info_name_end (const xcb_xv_adaptor_info_t *R /**< */) 261 { 262 xcb_generic_iterator_t i; 263 i.data = ((char *) (R + 1)) + (R->name_size); 264 i.rem = 0; 265 i.index = (char *) i.data - (char *) R; 266 return i; 267 } 268 269 270 /***************************************************************************** 271 ** 272 ** xcb_xv_format_t * xcb_xv_adaptor_info_formats 273 ** 274 ** @param const xcb_xv_adaptor_info_t *R 275 ** @returns xcb_xv_format_t * 276 ** 277 *****************************************************************************/ 278 279 xcb_xv_format_t * 280 xcb_xv_adaptor_info_formats (const xcb_xv_adaptor_info_t *R /**< */) 281 { 282 xcb_generic_iterator_t prev = xcb_xv_adaptor_info_name_end(R); 283 return (xcb_xv_format_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_xv_format_t, prev.index) + 0); 284 } 285 286 287 /***************************************************************************** 288 ** 289 ** int xcb_xv_adaptor_info_formats_length 290 ** 291 ** @param const xcb_xv_adaptor_info_t *R 292 ** @returns int 293 ** 294 *****************************************************************************/ 295 296 int 297 xcb_xv_adaptor_info_formats_length (const xcb_xv_adaptor_info_t *R /**< */) 298 { 299 return R->num_formats; 300 } 301 302 303 /***************************************************************************** 304 ** 305 ** xcb_xv_format_iterator_t xcb_xv_adaptor_info_formats_iterator 306 ** 307 ** @param const xcb_xv_adaptor_info_t *R 308 ** @returns xcb_xv_format_iterator_t 309 ** 310 *****************************************************************************/ 311 312 xcb_xv_format_iterator_t 313 xcb_xv_adaptor_info_formats_iterator (const xcb_xv_adaptor_info_t *R /**< */) 314 { 315 xcb_xv_format_iterator_t i; 316 xcb_generic_iterator_t prev = xcb_xv_adaptor_info_name_end(R); 317 i.data = (xcb_xv_format_t *) ((char *) prev.data + XCB_TYPE_PAD(xcb_xv_format_t, prev.index)); 318 i.rem = R->num_formats; 319 i.index = (char *) i.data - (char *) R; 320 return i; 321 } 322 323 324 /***************************************************************************** 325 ** 326 ** void xcb_xv_adaptor_info_next 327 ** 328 ** @param xcb_xv_adaptor_info_iterator_t *i 329 ** @returns void 330 ** 331 *****************************************************************************/ 332 333 void 334 xcb_xv_adaptor_info_next (xcb_xv_adaptor_info_iterator_t *i /**< */) 335 { 336 xcb_xv_adaptor_info_t *R = i->data; 337 xcb_generic_iterator_t child; 338 child.data = (xcb_xv_adaptor_info_t *)(((char *)R) + xcb_xv_adaptor_info_sizeof(R)); 339 i->index = (char *) child.data - (char *) i->data; 340 --i->rem; 341 i->data = (xcb_xv_adaptor_info_t *) child.data; 342 } 343 344 345 /***************************************************************************** 346 ** 347 ** xcb_generic_iterator_t xcb_xv_adaptor_info_end 348 ** 349 ** @param xcb_xv_adaptor_info_iterator_t i 350 ** @returns xcb_generic_iterator_t 351 ** 352 *****************************************************************************/ 353 354 xcb_generic_iterator_t 355 xcb_xv_adaptor_info_end (xcb_xv_adaptor_info_iterator_t i /**< */) 356 { 357 xcb_generic_iterator_t ret; 358 while(i.rem > 0) 359 xcb_xv_adaptor_info_next(&i); 360 ret.data = i.data; 361 ret.rem = i.rem; 362 ret.index = i.index; 363 return ret; 364 } 365 366 int 367 xcb_xv_encoding_info_sizeof (const void *_buffer /**< */) 368 { 369 char *xcb_tmp = (char *)_buffer; 370 const xcb_xv_encoding_info_t *_aux = (xcb_xv_encoding_info_t *)_buffer; 371 unsigned int xcb_buffer_len = 0; 372 unsigned int xcb_block_len = 0; 373 unsigned int xcb_pad = 0; 374 unsigned int xcb_align_to = 0; 375 376 377 xcb_block_len += sizeof(xcb_xv_encoding_info_t); 378 xcb_tmp += xcb_block_len; 379 xcb_buffer_len += xcb_block_len; 380 xcb_block_len = 0; 381 /* name */ 382 xcb_block_len += _aux->name_size * sizeof(char); 383 xcb_tmp += xcb_block_len; 384 xcb_align_to = ALIGNOF(char); 385 /* insert padding */ 386 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 387 xcb_buffer_len += xcb_block_len + xcb_pad; 388 if (0 != xcb_pad) { 389 xcb_tmp += xcb_pad; 390 xcb_pad = 0; 391 } 392 xcb_block_len = 0; 393 394 return xcb_buffer_len; 395 } 396 397 398 /***************************************************************************** 399 ** 400 ** char * xcb_xv_encoding_info_name 401 ** 402 ** @param const xcb_xv_encoding_info_t *R 403 ** @returns char * 404 ** 405 *****************************************************************************/ 406 407 char * 408 xcb_xv_encoding_info_name (const xcb_xv_encoding_info_t *R /**< */) 409 { 410 return (char *) (R + 1); 411 } 412 413 414 /***************************************************************************** 415 ** 416 ** int xcb_xv_encoding_info_name_length 417 ** 418 ** @param const xcb_xv_encoding_info_t *R 419 ** @returns int 420 ** 421 *****************************************************************************/ 422 423 int 424 xcb_xv_encoding_info_name_length (const xcb_xv_encoding_info_t *R /**< */) 425 { 426 return R->name_size; 427 } 428 429 430 /***************************************************************************** 431 ** 432 ** xcb_generic_iterator_t xcb_xv_encoding_info_name_end 433 ** 434 ** @param const xcb_xv_encoding_info_t *R 435 ** @returns xcb_generic_iterator_t 436 ** 437 *****************************************************************************/ 438 439 xcb_generic_iterator_t 440 xcb_xv_encoding_info_name_end (const xcb_xv_encoding_info_t *R /**< */) 441 { 442 xcb_generic_iterator_t i; 443 i.data = ((char *) (R + 1)) + (R->name_size); 444 i.rem = 0; 445 i.index = (char *) i.data - (char *) R; 446 return i; 447 } 448 449 450 /***************************************************************************** 451 ** 452 ** void xcb_xv_encoding_info_next 453 ** 454 ** @param xcb_xv_encoding_info_iterator_t *i 455 ** @returns void 456 ** 457 *****************************************************************************/ 458 459 void 460 xcb_xv_encoding_info_next (xcb_xv_encoding_info_iterator_t *i /**< */) 461 { 462 xcb_xv_encoding_info_t *R = i->data; 463 xcb_generic_iterator_t child; 464 child.data = (xcb_xv_encoding_info_t *)(((char *)R) + xcb_xv_encoding_info_sizeof(R)); 465 i->index = (char *) child.data - (char *) i->data; 466 --i->rem; 467 i->data = (xcb_xv_encoding_info_t *) child.data; 468 } 469 470 471 /***************************************************************************** 472 ** 473 ** xcb_generic_iterator_t xcb_xv_encoding_info_end 474 ** 475 ** @param xcb_xv_encoding_info_iterator_t i 476 ** @returns xcb_generic_iterator_t 477 ** 478 *****************************************************************************/ 479 480 xcb_generic_iterator_t 481 xcb_xv_encoding_info_end (xcb_xv_encoding_info_iterator_t i /**< */) 482 { 483 xcb_generic_iterator_t ret; 484 while(i.rem > 0) 485 xcb_xv_encoding_info_next(&i); 486 ret.data = i.data; 487 ret.rem = i.rem; 488 ret.index = i.index; 489 return ret; 490 } 491 492 int 493 xcb_xv_image_sizeof (const void *_buffer /**< */) 494 { 495 char *xcb_tmp = (char *)_buffer; 496 const xcb_xv_image_t *_aux = (xcb_xv_image_t *)_buffer; 497 unsigned int xcb_buffer_len = 0; 498 unsigned int xcb_block_len = 0; 499 unsigned int xcb_pad = 0; 500 unsigned int xcb_align_to = 0; 501 502 503 xcb_block_len += sizeof(xcb_xv_image_t); 504 xcb_tmp += xcb_block_len; 505 xcb_buffer_len += xcb_block_len; 506 xcb_block_len = 0; 507 /* pitches */ 508 xcb_block_len += _aux->num_planes * sizeof(uint32_t); 509 xcb_tmp += xcb_block_len; 510 xcb_align_to = ALIGNOF(uint32_t); 511 /* insert padding */ 512 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 513 xcb_buffer_len += xcb_block_len + xcb_pad; 514 if (0 != xcb_pad) { 515 xcb_tmp += xcb_pad; 516 xcb_pad = 0; 517 } 518 xcb_block_len = 0; 519 /* offsets */ 520 xcb_block_len += _aux->num_planes * sizeof(uint32_t); 521 xcb_tmp += xcb_block_len; 522 xcb_align_to = ALIGNOF(uint32_t); 523 /* insert padding */ 524 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 525 xcb_buffer_len += xcb_block_len + xcb_pad; 526 if (0 != xcb_pad) { 527 xcb_tmp += xcb_pad; 528 xcb_pad = 0; 529 } 530 xcb_block_len = 0; 531 /* data */ 532 xcb_block_len += _aux->data_size * sizeof(uint8_t); 533 xcb_tmp += xcb_block_len; 534 xcb_align_to = ALIGNOF(uint8_t); 535 /* insert padding */ 536 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 537 xcb_buffer_len += xcb_block_len + xcb_pad; 538 if (0 != xcb_pad) { 539 xcb_tmp += xcb_pad; 540 xcb_pad = 0; 541 } 542 xcb_block_len = 0; 543 544 return xcb_buffer_len; 545 } 546 547 548 /***************************************************************************** 549 ** 550 ** uint32_t * xcb_xv_image_pitches 551 ** 552 ** @param const xcb_xv_image_t *R 553 ** @returns uint32_t * 554 ** 555 *****************************************************************************/ 556 557 uint32_t * 558 xcb_xv_image_pitches (const xcb_xv_image_t *R /**< */) 559 { 560 return (uint32_t *) (R + 1); 561 } 562 563 564 /***************************************************************************** 565 ** 566 ** int xcb_xv_image_pitches_length 567 ** 568 ** @param const xcb_xv_image_t *R 569 ** @returns int 570 ** 571 *****************************************************************************/ 572 573 int 574 xcb_xv_image_pitches_length (const xcb_xv_image_t *R /**< */) 575 { 576 return R->num_planes; 577 } 578 579 580 /***************************************************************************** 581 ** 582 ** xcb_generic_iterator_t xcb_xv_image_pitches_end 583 ** 584 ** @param const xcb_xv_image_t *R 585 ** @returns xcb_generic_iterator_t 586 ** 587 *****************************************************************************/ 588 589 xcb_generic_iterator_t 590 xcb_xv_image_pitches_end (const xcb_xv_image_t *R /**< */) 591 { 592 xcb_generic_iterator_t i; 593 i.data = ((uint32_t *) (R + 1)) + (R->num_planes); 594 i.rem = 0; 595 i.index = (char *) i.data - (char *) R; 596 return i; 597 } 598 599 600 /***************************************************************************** 601 ** 602 ** uint32_t * xcb_xv_image_offsets 603 ** 604 ** @param const xcb_xv_image_t *R 605 ** @returns uint32_t * 606 ** 607 *****************************************************************************/ 608 609 uint32_t * 610 xcb_xv_image_offsets (const xcb_xv_image_t *R /**< */) 611 { 612 xcb_generic_iterator_t prev = xcb_xv_image_pitches_end(R); 613 return (uint32_t *) ((char *) prev.data + XCB_TYPE_PAD(uint32_t, prev.index) + 0); 614 } 615 616 617 /***************************************************************************** 618 ** 619 ** int xcb_xv_image_offsets_length 620 ** 621 ** @param const xcb_xv_image_t *R 622 ** @returns int 623 ** 624 *****************************************************************************/ 625 626 int 627 xcb_xv_image_offsets_length (const xcb_xv_image_t *R /**< */) 628 { 629 return R->num_planes; 630 } 631 632 633 /***************************************************************************** 634 ** 635 ** xcb_generic_iterator_t xcb_xv_image_offsets_end 636 ** 637 ** @param const xcb_xv_image_t *R 638 ** @returns xcb_generic_iterator_t 639 ** 640 *****************************************************************************/ 641 642 xcb_generic_iterator_t 643 xcb_xv_image_offsets_end (const xcb_xv_image_t *R /**< */) 644 { 645 xcb_generic_iterator_t i; 646 xcb_generic_iterator_t child = xcb_xv_image_pitches_end(R); 647 i.data = ((uint32_t *) child.data) + (R->num_planes); 648 i.rem = 0; 649 i.index = (char *) i.data - (char *) R; 650 return i; 651 } 652 653 654 /***************************************************************************** 655 ** 656 ** uint8_t * xcb_xv_image_data 657 ** 658 ** @param const xcb_xv_image_t *R 659 ** @returns uint8_t * 660 ** 661 *****************************************************************************/ 662 663 uint8_t * 664 xcb_xv_image_data (const xcb_xv_image_t *R /**< */) 665 { 666 xcb_generic_iterator_t prev = xcb_xv_image_offsets_end(R); 667 return (uint8_t *) ((char *) prev.data + XCB_TYPE_PAD(uint8_t, prev.index) + 0); 668 } 669 670 671 /***************************************************************************** 672 ** 673 ** int xcb_xv_image_data_length 674 ** 675 ** @param const xcb_xv_image_t *R 676 ** @returns int 677 ** 678 *****************************************************************************/ 679 680 int 681 xcb_xv_image_data_length (const xcb_xv_image_t *R /**< */) 682 { 683 return R->data_size; 684 } 685 686 687 /***************************************************************************** 688 ** 689 ** xcb_generic_iterator_t xcb_xv_image_data_end 690 ** 691 ** @param const xcb_xv_image_t *R 692 ** @returns xcb_generic_iterator_t 693 ** 694 *****************************************************************************/ 695 696 xcb_generic_iterator_t 697 xcb_xv_image_data_end (const xcb_xv_image_t *R /**< */) 698 { 699 xcb_generic_iterator_t i; 700 xcb_generic_iterator_t child = xcb_xv_image_offsets_end(R); 701 i.data = ((uint8_t *) child.data) + (R->data_size); 702 i.rem = 0; 703 i.index = (char *) i.data - (char *) R; 704 return i; 705 } 706 707 708 /***************************************************************************** 709 ** 710 ** void xcb_xv_image_next 711 ** 712 ** @param xcb_xv_image_iterator_t *i 713 ** @returns void 714 ** 715 *****************************************************************************/ 716 717 void 718 xcb_xv_image_next (xcb_xv_image_iterator_t *i /**< */) 719 { 720 xcb_xv_image_t *R = i->data; 721 xcb_generic_iterator_t child; 722 child.data = (xcb_xv_image_t *)(((char *)R) + xcb_xv_image_sizeof(R)); 723 i->index = (char *) child.data - (char *) i->data; 724 --i->rem; 725 i->data = (xcb_xv_image_t *) child.data; 726 } 727 728 729 /***************************************************************************** 730 ** 731 ** xcb_generic_iterator_t xcb_xv_image_end 732 ** 733 ** @param xcb_xv_image_iterator_t i 734 ** @returns xcb_generic_iterator_t 735 ** 736 *****************************************************************************/ 737 738 xcb_generic_iterator_t 739 xcb_xv_image_end (xcb_xv_image_iterator_t i /**< */) 740 { 741 xcb_generic_iterator_t ret; 742 while(i.rem > 0) 743 xcb_xv_image_next(&i); 744 ret.data = i.data; 745 ret.rem = i.rem; 746 ret.index = i.index; 747 return ret; 748 } 749 750 int 751 xcb_xv_attribute_info_sizeof (const void *_buffer /**< */) 752 { 753 char *xcb_tmp = (char *)_buffer; 754 const xcb_xv_attribute_info_t *_aux = (xcb_xv_attribute_info_t *)_buffer; 755 unsigned int xcb_buffer_len = 0; 756 unsigned int xcb_block_len = 0; 757 unsigned int xcb_pad = 0; 758 unsigned int xcb_align_to = 0; 759 760 761 xcb_block_len += sizeof(xcb_xv_attribute_info_t); 762 xcb_tmp += xcb_block_len; 763 xcb_buffer_len += xcb_block_len; 764 xcb_block_len = 0; 765 /* name */ 766 xcb_block_len += _aux->size * sizeof(char); 767 xcb_tmp += xcb_block_len; 768 xcb_align_to = ALIGNOF(char); 769 /* insert padding */ 770 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 771 xcb_buffer_len += xcb_block_len + xcb_pad; 772 if (0 != xcb_pad) { 773 xcb_tmp += xcb_pad; 774 xcb_pad = 0; 775 } 776 xcb_block_len = 0; 777 778 return xcb_buffer_len; 779 } 780 781 782 /***************************************************************************** 783 ** 784 ** char * xcb_xv_attribute_info_name 785 ** 786 ** @param const xcb_xv_attribute_info_t *R 787 ** @returns char * 788 ** 789 *****************************************************************************/ 790 791 char * 792 xcb_xv_attribute_info_name (const xcb_xv_attribute_info_t *R /**< */) 793 { 794 return (char *) (R + 1); 795 } 796 797 798 /***************************************************************************** 799 ** 800 ** int xcb_xv_attribute_info_name_length 801 ** 802 ** @param const xcb_xv_attribute_info_t *R 803 ** @returns int 804 ** 805 *****************************************************************************/ 806 807 int 808 xcb_xv_attribute_info_name_length (const xcb_xv_attribute_info_t *R /**< */) 809 { 810 return R->size; 811 } 812 813 814 /***************************************************************************** 815 ** 816 ** xcb_generic_iterator_t xcb_xv_attribute_info_name_end 817 ** 818 ** @param const xcb_xv_attribute_info_t *R 819 ** @returns xcb_generic_iterator_t 820 ** 821 *****************************************************************************/ 822 823 xcb_generic_iterator_t 824 xcb_xv_attribute_info_name_end (const xcb_xv_attribute_info_t *R /**< */) 825 { 826 xcb_generic_iterator_t i; 827 i.data = ((char *) (R + 1)) + (R->size); 828 i.rem = 0; 829 i.index = (char *) i.data - (char *) R; 830 return i; 831 } 832 833 834 /***************************************************************************** 835 ** 836 ** void xcb_xv_attribute_info_next 837 ** 838 ** @param xcb_xv_attribute_info_iterator_t *i 839 ** @returns void 840 ** 841 *****************************************************************************/ 842 843 void 844 xcb_xv_attribute_info_next (xcb_xv_attribute_info_iterator_t *i /**< */) 845 { 846 xcb_xv_attribute_info_t *R = i->data; 847 xcb_generic_iterator_t child; 848 child.data = (xcb_xv_attribute_info_t *)(((char *)R) + xcb_xv_attribute_info_sizeof(R)); 849 i->index = (char *) child.data - (char *) i->data; 850 --i->rem; 851 i->data = (xcb_xv_attribute_info_t *) child.data; 852 } 853 854 855 /***************************************************************************** 856 ** 857 ** xcb_generic_iterator_t xcb_xv_attribute_info_end 858 ** 859 ** @param xcb_xv_attribute_info_iterator_t i 860 ** @returns xcb_generic_iterator_t 861 ** 862 *****************************************************************************/ 863 864 xcb_generic_iterator_t 865 xcb_xv_attribute_info_end (xcb_xv_attribute_info_iterator_t i /**< */) 866 { 867 xcb_generic_iterator_t ret; 868 while(i.rem > 0) 869 xcb_xv_attribute_info_next(&i); 870 ret.data = i.data; 871 ret.rem = i.rem; 872 ret.index = i.index; 873 return ret; 874 } 875 876 877 /***************************************************************************** 878 ** 879 ** void xcb_xv_image_format_info_next 880 ** 881 ** @param xcb_xv_image_format_info_iterator_t *i 882 ** @returns void 883 ** 884 *****************************************************************************/ 885 886 void 887 xcb_xv_image_format_info_next (xcb_xv_image_format_info_iterator_t *i /**< */) 888 { 889 --i->rem; 890 ++i->data; 891 i->index += sizeof(xcb_xv_image_format_info_t); 892 } 893 894 895 /***************************************************************************** 896 ** 897 ** xcb_generic_iterator_t xcb_xv_image_format_info_end 898 ** 899 ** @param xcb_xv_image_format_info_iterator_t i 900 ** @returns xcb_generic_iterator_t 901 ** 902 *****************************************************************************/ 903 904 xcb_generic_iterator_t 905 xcb_xv_image_format_info_end (xcb_xv_image_format_info_iterator_t i /**< */) 906 { 907 xcb_generic_iterator_t ret; 908 ret.data = i.data + i.rem; 909 ret.index = i.index + ((char *) ret.data - (char *) i.data); 910 ret.rem = 0; 911 return ret; 912 } 913 914 915 /***************************************************************************** 916 ** 917 ** xcb_xv_query_extension_cookie_t xcb_xv_query_extension 918 ** 919 ** @param xcb_connection_t *c 920 ** @returns xcb_xv_query_extension_cookie_t 921 ** 922 *****************************************************************************/ 923 924 xcb_xv_query_extension_cookie_t 925 xcb_xv_query_extension (xcb_connection_t *c /**< */) 926 { 927 static const xcb_protocol_request_t xcb_req = { 928 /* count */ 2, 929 /* ext */ &xcb_xv_id, 930 /* opcode */ XCB_XV_QUERY_EXTENSION, 931 /* isvoid */ 0 932 }; 933 934 struct iovec xcb_parts[4]; 935 xcb_xv_query_extension_cookie_t xcb_ret; 936 xcb_xv_query_extension_request_t xcb_out; 937 938 939 xcb_parts[2].iov_base = (char *) &xcb_out; 940 xcb_parts[2].iov_len = sizeof(xcb_out); 941 xcb_parts[3].iov_base = 0; 942 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 943 944 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 945 return xcb_ret; 946 } 947 948 949 /***************************************************************************** 950 ** 951 ** xcb_xv_query_extension_cookie_t xcb_xv_query_extension_unchecked 952 ** 953 ** @param xcb_connection_t *c 954 ** @returns xcb_xv_query_extension_cookie_t 955 ** 956 *****************************************************************************/ 957 958 xcb_xv_query_extension_cookie_t 959 xcb_xv_query_extension_unchecked (xcb_connection_t *c /**< */) 960 { 961 static const xcb_protocol_request_t xcb_req = { 962 /* count */ 2, 963 /* ext */ &xcb_xv_id, 964 /* opcode */ XCB_XV_QUERY_EXTENSION, 965 /* isvoid */ 0 966 }; 967 968 struct iovec xcb_parts[4]; 969 xcb_xv_query_extension_cookie_t xcb_ret; 970 xcb_xv_query_extension_request_t xcb_out; 971 972 973 xcb_parts[2].iov_base = (char *) &xcb_out; 974 xcb_parts[2].iov_len = sizeof(xcb_out); 975 xcb_parts[3].iov_base = 0; 976 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 977 978 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 979 return xcb_ret; 980 } 981 982 983 /***************************************************************************** 984 ** 985 ** xcb_xv_query_extension_reply_t * xcb_xv_query_extension_reply 986 ** 987 ** @param xcb_connection_t *c 988 ** @param xcb_xv_query_extension_cookie_t cookie 989 ** @param xcb_generic_error_t **e 990 ** @returns xcb_xv_query_extension_reply_t * 991 ** 992 *****************************************************************************/ 993 994 xcb_xv_query_extension_reply_t * 995 xcb_xv_query_extension_reply (xcb_connection_t *c /**< */, 996 xcb_xv_query_extension_cookie_t cookie /**< */, 997 xcb_generic_error_t **e /**< */) 998 { 999 return (xcb_xv_query_extension_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 1000 } 1001 1002 int 1003 xcb_xv_query_adaptors_sizeof (const void *_buffer /**< */) 1004 { 1005 char *xcb_tmp = (char *)_buffer; 1006 const xcb_xv_query_adaptors_reply_t *_aux = (xcb_xv_query_adaptors_reply_t *)_buffer; 1007 unsigned int xcb_buffer_len = 0; 1008 unsigned int xcb_block_len = 0; 1009 unsigned int xcb_pad = 0; 1010 unsigned int xcb_align_to = 0; 1011 1012 unsigned int i; 1013 unsigned int xcb_tmp_len; 1014 1015 xcb_block_len += sizeof(xcb_xv_query_adaptors_reply_t); 1016 xcb_tmp += xcb_block_len; 1017 xcb_buffer_len += xcb_block_len; 1018 xcb_block_len = 0; 1019 /* info */ 1020 for(i=0; i<_aux->num_adaptors; i++) { 1021 xcb_tmp_len = xcb_xv_adaptor_info_sizeof(xcb_tmp); 1022 xcb_block_len += xcb_tmp_len; 1023 xcb_tmp += xcb_tmp_len; 1024 } 1025 xcb_align_to = ALIGNOF(xcb_xv_adaptor_info_t); 1026 /* insert padding */ 1027 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 1028 xcb_buffer_len += xcb_block_len + xcb_pad; 1029 if (0 != xcb_pad) { 1030 xcb_tmp += xcb_pad; 1031 xcb_pad = 0; 1032 } 1033 xcb_block_len = 0; 1034 1035 return xcb_buffer_len; 1036 } 1037 1038 1039 /***************************************************************************** 1040 ** 1041 ** xcb_xv_query_adaptors_cookie_t xcb_xv_query_adaptors 1042 ** 1043 ** @param xcb_connection_t *c 1044 ** @param xcb_window_t window 1045 ** @returns xcb_xv_query_adaptors_cookie_t 1046 ** 1047 *****************************************************************************/ 1048 1049 xcb_xv_query_adaptors_cookie_t 1050 xcb_xv_query_adaptors (xcb_connection_t *c /**< */, 1051 xcb_window_t window /**< */) 1052 { 1053 static const xcb_protocol_request_t xcb_req = { 1054 /* count */ 2, 1055 /* ext */ &xcb_xv_id, 1056 /* opcode */ XCB_XV_QUERY_ADAPTORS, 1057 /* isvoid */ 0 1058 }; 1059 1060 struct iovec xcb_parts[4]; 1061 xcb_xv_query_adaptors_cookie_t xcb_ret; 1062 xcb_xv_query_adaptors_request_t xcb_out; 1063 1064 xcb_out.window = window; 1065 1066 xcb_parts[2].iov_base = (char *) &xcb_out; 1067 xcb_parts[2].iov_len = sizeof(xcb_out); 1068 xcb_parts[3].iov_base = 0; 1069 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1070 1071 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 1072 return xcb_ret; 1073 } 1074 1075 1076 /***************************************************************************** 1077 ** 1078 ** xcb_xv_query_adaptors_cookie_t xcb_xv_query_adaptors_unchecked 1079 ** 1080 ** @param xcb_connection_t *c 1081 ** @param xcb_window_t window 1082 ** @returns xcb_xv_query_adaptors_cookie_t 1083 ** 1084 *****************************************************************************/ 1085 1086 xcb_xv_query_adaptors_cookie_t 1087 xcb_xv_query_adaptors_unchecked (xcb_connection_t *c /**< */, 1088 xcb_window_t window /**< */) 1089 { 1090 static const xcb_protocol_request_t xcb_req = { 1091 /* count */ 2, 1092 /* ext */ &xcb_xv_id, 1093 /* opcode */ XCB_XV_QUERY_ADAPTORS, 1094 /* isvoid */ 0 1095 }; 1096 1097 struct iovec xcb_parts[4]; 1098 xcb_xv_query_adaptors_cookie_t xcb_ret; 1099 xcb_xv_query_adaptors_request_t xcb_out; 1100 1101 xcb_out.window = window; 1102 1103 xcb_parts[2].iov_base = (char *) &xcb_out; 1104 xcb_parts[2].iov_len = sizeof(xcb_out); 1105 xcb_parts[3].iov_base = 0; 1106 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1107 1108 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 1109 return xcb_ret; 1110 } 1111 1112 1113 /***************************************************************************** 1114 ** 1115 ** int xcb_xv_query_adaptors_info_length 1116 ** 1117 ** @param const xcb_xv_query_adaptors_reply_t *R 1118 ** @returns int 1119 ** 1120 *****************************************************************************/ 1121 1122 int 1123 xcb_xv_query_adaptors_info_length (const xcb_xv_query_adaptors_reply_t *R /**< */) 1124 { 1125 return R->num_adaptors; 1126 } 1127 1128 1129 /***************************************************************************** 1130 ** 1131 ** xcb_xv_adaptor_info_iterator_t xcb_xv_query_adaptors_info_iterator 1132 ** 1133 ** @param const xcb_xv_query_adaptors_reply_t *R 1134 ** @returns xcb_xv_adaptor_info_iterator_t 1135 ** 1136 *****************************************************************************/ 1137 1138 xcb_xv_adaptor_info_iterator_t 1139 xcb_xv_query_adaptors_info_iterator (const xcb_xv_query_adaptors_reply_t *R /**< */) 1140 { 1141 xcb_xv_adaptor_info_iterator_t i; 1142 i.data = (xcb_xv_adaptor_info_t *) (R + 1); 1143 i.rem = R->num_adaptors; 1144 i.index = (char *) i.data - (char *) R; 1145 return i; 1146 } 1147 1148 1149 /***************************************************************************** 1150 ** 1151 ** xcb_xv_query_adaptors_reply_t * xcb_xv_query_adaptors_reply 1152 ** 1153 ** @param xcb_connection_t *c 1154 ** @param xcb_xv_query_adaptors_cookie_t cookie 1155 ** @param xcb_generic_error_t **e 1156 ** @returns xcb_xv_query_adaptors_reply_t * 1157 ** 1158 *****************************************************************************/ 1159 1160 xcb_xv_query_adaptors_reply_t * 1161 xcb_xv_query_adaptors_reply (xcb_connection_t *c /**< */, 1162 xcb_xv_query_adaptors_cookie_t cookie /**< */, 1163 xcb_generic_error_t **e /**< */) 1164 { 1165 return (xcb_xv_query_adaptors_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 1166 } 1167 1168 int 1169 xcb_xv_query_encodings_sizeof (const void *_buffer /**< */) 1170 { 1171 char *xcb_tmp = (char *)_buffer; 1172 const xcb_xv_query_encodings_reply_t *_aux = (xcb_xv_query_encodings_reply_t *)_buffer; 1173 unsigned int xcb_buffer_len = 0; 1174 unsigned int xcb_block_len = 0; 1175 unsigned int xcb_pad = 0; 1176 unsigned int xcb_align_to = 0; 1177 1178 unsigned int i; 1179 unsigned int xcb_tmp_len; 1180 1181 xcb_block_len += sizeof(xcb_xv_query_encodings_reply_t); 1182 xcb_tmp += xcb_block_len; 1183 xcb_buffer_len += xcb_block_len; 1184 xcb_block_len = 0; 1185 /* info */ 1186 for(i=0; i<_aux->num_encodings; i++) { 1187 xcb_tmp_len = xcb_xv_encoding_info_sizeof(xcb_tmp); 1188 xcb_block_len += xcb_tmp_len; 1189 xcb_tmp += xcb_tmp_len; 1190 } 1191 xcb_align_to = ALIGNOF(xcb_xv_encoding_info_t); 1192 /* insert padding */ 1193 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 1194 xcb_buffer_len += xcb_block_len + xcb_pad; 1195 if (0 != xcb_pad) { 1196 xcb_tmp += xcb_pad; 1197 xcb_pad = 0; 1198 } 1199 xcb_block_len = 0; 1200 1201 return xcb_buffer_len; 1202 } 1203 1204 1205 /***************************************************************************** 1206 ** 1207 ** xcb_xv_query_encodings_cookie_t xcb_xv_query_encodings 1208 ** 1209 ** @param xcb_connection_t *c 1210 ** @param xcb_xv_port_t port 1211 ** @returns xcb_xv_query_encodings_cookie_t 1212 ** 1213 *****************************************************************************/ 1214 1215 xcb_xv_query_encodings_cookie_t 1216 xcb_xv_query_encodings (xcb_connection_t *c /**< */, 1217 xcb_xv_port_t port /**< */) 1218 { 1219 static const xcb_protocol_request_t xcb_req = { 1220 /* count */ 2, 1221 /* ext */ &xcb_xv_id, 1222 /* opcode */ XCB_XV_QUERY_ENCODINGS, 1223 /* isvoid */ 0 1224 }; 1225 1226 struct iovec xcb_parts[4]; 1227 xcb_xv_query_encodings_cookie_t xcb_ret; 1228 xcb_xv_query_encodings_request_t xcb_out; 1229 1230 xcb_out.port = port; 1231 1232 xcb_parts[2].iov_base = (char *) &xcb_out; 1233 xcb_parts[2].iov_len = sizeof(xcb_out); 1234 xcb_parts[3].iov_base = 0; 1235 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1236 1237 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 1238 return xcb_ret; 1239 } 1240 1241 1242 /***************************************************************************** 1243 ** 1244 ** xcb_xv_query_encodings_cookie_t xcb_xv_query_encodings_unchecked 1245 ** 1246 ** @param xcb_connection_t *c 1247 ** @param xcb_xv_port_t port 1248 ** @returns xcb_xv_query_encodings_cookie_t 1249 ** 1250 *****************************************************************************/ 1251 1252 xcb_xv_query_encodings_cookie_t 1253 xcb_xv_query_encodings_unchecked (xcb_connection_t *c /**< */, 1254 xcb_xv_port_t port /**< */) 1255 { 1256 static const xcb_protocol_request_t xcb_req = { 1257 /* count */ 2, 1258 /* ext */ &xcb_xv_id, 1259 /* opcode */ XCB_XV_QUERY_ENCODINGS, 1260 /* isvoid */ 0 1261 }; 1262 1263 struct iovec xcb_parts[4]; 1264 xcb_xv_query_encodings_cookie_t xcb_ret; 1265 xcb_xv_query_encodings_request_t xcb_out; 1266 1267 xcb_out.port = port; 1268 1269 xcb_parts[2].iov_base = (char *) &xcb_out; 1270 xcb_parts[2].iov_len = sizeof(xcb_out); 1271 xcb_parts[3].iov_base = 0; 1272 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1273 1274 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 1275 return xcb_ret; 1276 } 1277 1278 1279 /***************************************************************************** 1280 ** 1281 ** int xcb_xv_query_encodings_info_length 1282 ** 1283 ** @param const xcb_xv_query_encodings_reply_t *R 1284 ** @returns int 1285 ** 1286 *****************************************************************************/ 1287 1288 int 1289 xcb_xv_query_encodings_info_length (const xcb_xv_query_encodings_reply_t *R /**< */) 1290 { 1291 return R->num_encodings; 1292 } 1293 1294 1295 /***************************************************************************** 1296 ** 1297 ** xcb_xv_encoding_info_iterator_t xcb_xv_query_encodings_info_iterator 1298 ** 1299 ** @param const xcb_xv_query_encodings_reply_t *R 1300 ** @returns xcb_xv_encoding_info_iterator_t 1301 ** 1302 *****************************************************************************/ 1303 1304 xcb_xv_encoding_info_iterator_t 1305 xcb_xv_query_encodings_info_iterator (const xcb_xv_query_encodings_reply_t *R /**< */) 1306 { 1307 xcb_xv_encoding_info_iterator_t i; 1308 i.data = (xcb_xv_encoding_info_t *) (R + 1); 1309 i.rem = R->num_encodings; 1310 i.index = (char *) i.data - (char *) R; 1311 return i; 1312 } 1313 1314 1315 /***************************************************************************** 1316 ** 1317 ** xcb_xv_query_encodings_reply_t * xcb_xv_query_encodings_reply 1318 ** 1319 ** @param xcb_connection_t *c 1320 ** @param xcb_xv_query_encodings_cookie_t cookie 1321 ** @param xcb_generic_error_t **e 1322 ** @returns xcb_xv_query_encodings_reply_t * 1323 ** 1324 *****************************************************************************/ 1325 1326 xcb_xv_query_encodings_reply_t * 1327 xcb_xv_query_encodings_reply (xcb_connection_t *c /**< */, 1328 xcb_xv_query_encodings_cookie_t cookie /**< */, 1329 xcb_generic_error_t **e /**< */) 1330 { 1331 return (xcb_xv_query_encodings_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 1332 } 1333 1334 1335 /***************************************************************************** 1336 ** 1337 ** xcb_xv_grab_port_cookie_t xcb_xv_grab_port 1338 ** 1339 ** @param xcb_connection_t *c 1340 ** @param xcb_xv_port_t port 1341 ** @param xcb_timestamp_t time 1342 ** @returns xcb_xv_grab_port_cookie_t 1343 ** 1344 *****************************************************************************/ 1345 1346 xcb_xv_grab_port_cookie_t 1347 xcb_xv_grab_port (xcb_connection_t *c /**< */, 1348 xcb_xv_port_t port /**< */, 1349 xcb_timestamp_t time /**< */) 1350 { 1351 static const xcb_protocol_request_t xcb_req = { 1352 /* count */ 2, 1353 /* ext */ &xcb_xv_id, 1354 /* opcode */ XCB_XV_GRAB_PORT, 1355 /* isvoid */ 0 1356 }; 1357 1358 struct iovec xcb_parts[4]; 1359 xcb_xv_grab_port_cookie_t xcb_ret; 1360 xcb_xv_grab_port_request_t xcb_out; 1361 1362 xcb_out.port = port; 1363 xcb_out.time = time; 1364 1365 xcb_parts[2].iov_base = (char *) &xcb_out; 1366 xcb_parts[2].iov_len = sizeof(xcb_out); 1367 xcb_parts[3].iov_base = 0; 1368 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1369 1370 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 1371 return xcb_ret; 1372 } 1373 1374 1375 /***************************************************************************** 1376 ** 1377 ** xcb_xv_grab_port_cookie_t xcb_xv_grab_port_unchecked 1378 ** 1379 ** @param xcb_connection_t *c 1380 ** @param xcb_xv_port_t port 1381 ** @param xcb_timestamp_t time 1382 ** @returns xcb_xv_grab_port_cookie_t 1383 ** 1384 *****************************************************************************/ 1385 1386 xcb_xv_grab_port_cookie_t 1387 xcb_xv_grab_port_unchecked (xcb_connection_t *c /**< */, 1388 xcb_xv_port_t port /**< */, 1389 xcb_timestamp_t time /**< */) 1390 { 1391 static const xcb_protocol_request_t xcb_req = { 1392 /* count */ 2, 1393 /* ext */ &xcb_xv_id, 1394 /* opcode */ XCB_XV_GRAB_PORT, 1395 /* isvoid */ 0 1396 }; 1397 1398 struct iovec xcb_parts[4]; 1399 xcb_xv_grab_port_cookie_t xcb_ret; 1400 xcb_xv_grab_port_request_t xcb_out; 1401 1402 xcb_out.port = port; 1403 xcb_out.time = time; 1404 1405 xcb_parts[2].iov_base = (char *) &xcb_out; 1406 xcb_parts[2].iov_len = sizeof(xcb_out); 1407 xcb_parts[3].iov_base = 0; 1408 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1409 1410 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 1411 return xcb_ret; 1412 } 1413 1414 1415 /***************************************************************************** 1416 ** 1417 ** xcb_xv_grab_port_reply_t * xcb_xv_grab_port_reply 1418 ** 1419 ** @param xcb_connection_t *c 1420 ** @param xcb_xv_grab_port_cookie_t cookie 1421 ** @param xcb_generic_error_t **e 1422 ** @returns xcb_xv_grab_port_reply_t * 1423 ** 1424 *****************************************************************************/ 1425 1426 xcb_xv_grab_port_reply_t * 1427 xcb_xv_grab_port_reply (xcb_connection_t *c /**< */, 1428 xcb_xv_grab_port_cookie_t cookie /**< */, 1429 xcb_generic_error_t **e /**< */) 1430 { 1431 return (xcb_xv_grab_port_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 1432 } 1433 1434 1435 /***************************************************************************** 1436 ** 1437 ** xcb_void_cookie_t xcb_xv_ungrab_port_checked 1438 ** 1439 ** @param xcb_connection_t *c 1440 ** @param xcb_xv_port_t port 1441 ** @param xcb_timestamp_t time 1442 ** @returns xcb_void_cookie_t 1443 ** 1444 *****************************************************************************/ 1445 1446 xcb_void_cookie_t 1447 xcb_xv_ungrab_port_checked (xcb_connection_t *c /**< */, 1448 xcb_xv_port_t port /**< */, 1449 xcb_timestamp_t time /**< */) 1450 { 1451 static const xcb_protocol_request_t xcb_req = { 1452 /* count */ 2, 1453 /* ext */ &xcb_xv_id, 1454 /* opcode */ XCB_XV_UNGRAB_PORT, 1455 /* isvoid */ 1 1456 }; 1457 1458 struct iovec xcb_parts[4]; 1459 xcb_void_cookie_t xcb_ret; 1460 xcb_xv_ungrab_port_request_t xcb_out; 1461 1462 xcb_out.port = port; 1463 xcb_out.time = time; 1464 1465 xcb_parts[2].iov_base = (char *) &xcb_out; 1466 xcb_parts[2].iov_len = sizeof(xcb_out); 1467 xcb_parts[3].iov_base = 0; 1468 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1469 1470 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 1471 return xcb_ret; 1472 } 1473 1474 1475 /***************************************************************************** 1476 ** 1477 ** xcb_void_cookie_t xcb_xv_ungrab_port 1478 ** 1479 ** @param xcb_connection_t *c 1480 ** @param xcb_xv_port_t port 1481 ** @param xcb_timestamp_t time 1482 ** @returns xcb_void_cookie_t 1483 ** 1484 *****************************************************************************/ 1485 1486 xcb_void_cookie_t 1487 xcb_xv_ungrab_port (xcb_connection_t *c /**< */, 1488 xcb_xv_port_t port /**< */, 1489 xcb_timestamp_t time /**< */) 1490 { 1491 static const xcb_protocol_request_t xcb_req = { 1492 /* count */ 2, 1493 /* ext */ &xcb_xv_id, 1494 /* opcode */ XCB_XV_UNGRAB_PORT, 1495 /* isvoid */ 1 1496 }; 1497 1498 struct iovec xcb_parts[4]; 1499 xcb_void_cookie_t xcb_ret; 1500 xcb_xv_ungrab_port_request_t xcb_out; 1501 1502 xcb_out.port = port; 1503 xcb_out.time = time; 1504 1505 xcb_parts[2].iov_base = (char *) &xcb_out; 1506 xcb_parts[2].iov_len = sizeof(xcb_out); 1507 xcb_parts[3].iov_base = 0; 1508 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1509 1510 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 1511 return xcb_ret; 1512 } 1513 1514 1515 /***************************************************************************** 1516 ** 1517 ** xcb_void_cookie_t xcb_xv_put_video_checked 1518 ** 1519 ** @param xcb_connection_t *c 1520 ** @param xcb_xv_port_t port 1521 ** @param xcb_drawable_t drawable 1522 ** @param xcb_gcontext_t gc 1523 ** @param int16_t vid_x 1524 ** @param int16_t vid_y 1525 ** @param uint16_t vid_w 1526 ** @param uint16_t vid_h 1527 ** @param int16_t drw_x 1528 ** @param int16_t drw_y 1529 ** @param uint16_t drw_w 1530 ** @param uint16_t drw_h 1531 ** @returns xcb_void_cookie_t 1532 ** 1533 *****************************************************************************/ 1534 1535 xcb_void_cookie_t 1536 xcb_xv_put_video_checked (xcb_connection_t *c /**< */, 1537 xcb_xv_port_t port /**< */, 1538 xcb_drawable_t drawable /**< */, 1539 xcb_gcontext_t gc /**< */, 1540 int16_t vid_x /**< */, 1541 int16_t vid_y /**< */, 1542 uint16_t vid_w /**< */, 1543 uint16_t vid_h /**< */, 1544 int16_t drw_x /**< */, 1545 int16_t drw_y /**< */, 1546 uint16_t drw_w /**< */, 1547 uint16_t drw_h /**< */) 1548 { 1549 static const xcb_protocol_request_t xcb_req = { 1550 /* count */ 2, 1551 /* ext */ &xcb_xv_id, 1552 /* opcode */ XCB_XV_PUT_VIDEO, 1553 /* isvoid */ 1 1554 }; 1555 1556 struct iovec xcb_parts[4]; 1557 xcb_void_cookie_t xcb_ret; 1558 xcb_xv_put_video_request_t xcb_out; 1559 1560 xcb_out.port = port; 1561 xcb_out.drawable = drawable; 1562 xcb_out.gc = gc; 1563 xcb_out.vid_x = vid_x; 1564 xcb_out.vid_y = vid_y; 1565 xcb_out.vid_w = vid_w; 1566 xcb_out.vid_h = vid_h; 1567 xcb_out.drw_x = drw_x; 1568 xcb_out.drw_y = drw_y; 1569 xcb_out.drw_w = drw_w; 1570 xcb_out.drw_h = drw_h; 1571 1572 xcb_parts[2].iov_base = (char *) &xcb_out; 1573 xcb_parts[2].iov_len = sizeof(xcb_out); 1574 xcb_parts[3].iov_base = 0; 1575 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1576 1577 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 1578 return xcb_ret; 1579 } 1580 1581 1582 /***************************************************************************** 1583 ** 1584 ** xcb_void_cookie_t xcb_xv_put_video 1585 ** 1586 ** @param xcb_connection_t *c 1587 ** @param xcb_xv_port_t port 1588 ** @param xcb_drawable_t drawable 1589 ** @param xcb_gcontext_t gc 1590 ** @param int16_t vid_x 1591 ** @param int16_t vid_y 1592 ** @param uint16_t vid_w 1593 ** @param uint16_t vid_h 1594 ** @param int16_t drw_x 1595 ** @param int16_t drw_y 1596 ** @param uint16_t drw_w 1597 ** @param uint16_t drw_h 1598 ** @returns xcb_void_cookie_t 1599 ** 1600 *****************************************************************************/ 1601 1602 xcb_void_cookie_t 1603 xcb_xv_put_video (xcb_connection_t *c /**< */, 1604 xcb_xv_port_t port /**< */, 1605 xcb_drawable_t drawable /**< */, 1606 xcb_gcontext_t gc /**< */, 1607 int16_t vid_x /**< */, 1608 int16_t vid_y /**< */, 1609 uint16_t vid_w /**< */, 1610 uint16_t vid_h /**< */, 1611 int16_t drw_x /**< */, 1612 int16_t drw_y /**< */, 1613 uint16_t drw_w /**< */, 1614 uint16_t drw_h /**< */) 1615 { 1616 static const xcb_protocol_request_t xcb_req = { 1617 /* count */ 2, 1618 /* ext */ &xcb_xv_id, 1619 /* opcode */ XCB_XV_PUT_VIDEO, 1620 /* isvoid */ 1 1621 }; 1622 1623 struct iovec xcb_parts[4]; 1624 xcb_void_cookie_t xcb_ret; 1625 xcb_xv_put_video_request_t xcb_out; 1626 1627 xcb_out.port = port; 1628 xcb_out.drawable = drawable; 1629 xcb_out.gc = gc; 1630 xcb_out.vid_x = vid_x; 1631 xcb_out.vid_y = vid_y; 1632 xcb_out.vid_w = vid_w; 1633 xcb_out.vid_h = vid_h; 1634 xcb_out.drw_x = drw_x; 1635 xcb_out.drw_y = drw_y; 1636 xcb_out.drw_w = drw_w; 1637 xcb_out.drw_h = drw_h; 1638 1639 xcb_parts[2].iov_base = (char *) &xcb_out; 1640 xcb_parts[2].iov_len = sizeof(xcb_out); 1641 xcb_parts[3].iov_base = 0; 1642 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1643 1644 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 1645 return xcb_ret; 1646 } 1647 1648 1649 /***************************************************************************** 1650 ** 1651 ** xcb_void_cookie_t xcb_xv_put_still_checked 1652 ** 1653 ** @param xcb_connection_t *c 1654 ** @param xcb_xv_port_t port 1655 ** @param xcb_drawable_t drawable 1656 ** @param xcb_gcontext_t gc 1657 ** @param int16_t vid_x 1658 ** @param int16_t vid_y 1659 ** @param uint16_t vid_w 1660 ** @param uint16_t vid_h 1661 ** @param int16_t drw_x 1662 ** @param int16_t drw_y 1663 ** @param uint16_t drw_w 1664 ** @param uint16_t drw_h 1665 ** @returns xcb_void_cookie_t 1666 ** 1667 *****************************************************************************/ 1668 1669 xcb_void_cookie_t 1670 xcb_xv_put_still_checked (xcb_connection_t *c /**< */, 1671 xcb_xv_port_t port /**< */, 1672 xcb_drawable_t drawable /**< */, 1673 xcb_gcontext_t gc /**< */, 1674 int16_t vid_x /**< */, 1675 int16_t vid_y /**< */, 1676 uint16_t vid_w /**< */, 1677 uint16_t vid_h /**< */, 1678 int16_t drw_x /**< */, 1679 int16_t drw_y /**< */, 1680 uint16_t drw_w /**< */, 1681 uint16_t drw_h /**< */) 1682 { 1683 static const xcb_protocol_request_t xcb_req = { 1684 /* count */ 2, 1685 /* ext */ &xcb_xv_id, 1686 /* opcode */ XCB_XV_PUT_STILL, 1687 /* isvoid */ 1 1688 }; 1689 1690 struct iovec xcb_parts[4]; 1691 xcb_void_cookie_t xcb_ret; 1692 xcb_xv_put_still_request_t xcb_out; 1693 1694 xcb_out.port = port; 1695 xcb_out.drawable = drawable; 1696 xcb_out.gc = gc; 1697 xcb_out.vid_x = vid_x; 1698 xcb_out.vid_y = vid_y; 1699 xcb_out.vid_w = vid_w; 1700 xcb_out.vid_h = vid_h; 1701 xcb_out.drw_x = drw_x; 1702 xcb_out.drw_y = drw_y; 1703 xcb_out.drw_w = drw_w; 1704 xcb_out.drw_h = drw_h; 1705 1706 xcb_parts[2].iov_base = (char *) &xcb_out; 1707 xcb_parts[2].iov_len = sizeof(xcb_out); 1708 xcb_parts[3].iov_base = 0; 1709 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1710 1711 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 1712 return xcb_ret; 1713 } 1714 1715 1716 /***************************************************************************** 1717 ** 1718 ** xcb_void_cookie_t xcb_xv_put_still 1719 ** 1720 ** @param xcb_connection_t *c 1721 ** @param xcb_xv_port_t port 1722 ** @param xcb_drawable_t drawable 1723 ** @param xcb_gcontext_t gc 1724 ** @param int16_t vid_x 1725 ** @param int16_t vid_y 1726 ** @param uint16_t vid_w 1727 ** @param uint16_t vid_h 1728 ** @param int16_t drw_x 1729 ** @param int16_t drw_y 1730 ** @param uint16_t drw_w 1731 ** @param uint16_t drw_h 1732 ** @returns xcb_void_cookie_t 1733 ** 1734 *****************************************************************************/ 1735 1736 xcb_void_cookie_t 1737 xcb_xv_put_still (xcb_connection_t *c /**< */, 1738 xcb_xv_port_t port /**< */, 1739 xcb_drawable_t drawable /**< */, 1740 xcb_gcontext_t gc /**< */, 1741 int16_t vid_x /**< */, 1742 int16_t vid_y /**< */, 1743 uint16_t vid_w /**< */, 1744 uint16_t vid_h /**< */, 1745 int16_t drw_x /**< */, 1746 int16_t drw_y /**< */, 1747 uint16_t drw_w /**< */, 1748 uint16_t drw_h /**< */) 1749 { 1750 static const xcb_protocol_request_t xcb_req = { 1751 /* count */ 2, 1752 /* ext */ &xcb_xv_id, 1753 /* opcode */ XCB_XV_PUT_STILL, 1754 /* isvoid */ 1 1755 }; 1756 1757 struct iovec xcb_parts[4]; 1758 xcb_void_cookie_t xcb_ret; 1759 xcb_xv_put_still_request_t xcb_out; 1760 1761 xcb_out.port = port; 1762 xcb_out.drawable = drawable; 1763 xcb_out.gc = gc; 1764 xcb_out.vid_x = vid_x; 1765 xcb_out.vid_y = vid_y; 1766 xcb_out.vid_w = vid_w; 1767 xcb_out.vid_h = vid_h; 1768 xcb_out.drw_x = drw_x; 1769 xcb_out.drw_y = drw_y; 1770 xcb_out.drw_w = drw_w; 1771 xcb_out.drw_h = drw_h; 1772 1773 xcb_parts[2].iov_base = (char *) &xcb_out; 1774 xcb_parts[2].iov_len = sizeof(xcb_out); 1775 xcb_parts[3].iov_base = 0; 1776 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1777 1778 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 1779 return xcb_ret; 1780 } 1781 1782 1783 /***************************************************************************** 1784 ** 1785 ** xcb_void_cookie_t xcb_xv_get_video_checked 1786 ** 1787 ** @param xcb_connection_t *c 1788 ** @param xcb_xv_port_t port 1789 ** @param xcb_drawable_t drawable 1790 ** @param xcb_gcontext_t gc 1791 ** @param int16_t vid_x 1792 ** @param int16_t vid_y 1793 ** @param uint16_t vid_w 1794 ** @param uint16_t vid_h 1795 ** @param int16_t drw_x 1796 ** @param int16_t drw_y 1797 ** @param uint16_t drw_w 1798 ** @param uint16_t drw_h 1799 ** @returns xcb_void_cookie_t 1800 ** 1801 *****************************************************************************/ 1802 1803 xcb_void_cookie_t 1804 xcb_xv_get_video_checked (xcb_connection_t *c /**< */, 1805 xcb_xv_port_t port /**< */, 1806 xcb_drawable_t drawable /**< */, 1807 xcb_gcontext_t gc /**< */, 1808 int16_t vid_x /**< */, 1809 int16_t vid_y /**< */, 1810 uint16_t vid_w /**< */, 1811 uint16_t vid_h /**< */, 1812 int16_t drw_x /**< */, 1813 int16_t drw_y /**< */, 1814 uint16_t drw_w /**< */, 1815 uint16_t drw_h /**< */) 1816 { 1817 static const xcb_protocol_request_t xcb_req = { 1818 /* count */ 2, 1819 /* ext */ &xcb_xv_id, 1820 /* opcode */ XCB_XV_GET_VIDEO, 1821 /* isvoid */ 1 1822 }; 1823 1824 struct iovec xcb_parts[4]; 1825 xcb_void_cookie_t xcb_ret; 1826 xcb_xv_get_video_request_t xcb_out; 1827 1828 xcb_out.port = port; 1829 xcb_out.drawable = drawable; 1830 xcb_out.gc = gc; 1831 xcb_out.vid_x = vid_x; 1832 xcb_out.vid_y = vid_y; 1833 xcb_out.vid_w = vid_w; 1834 xcb_out.vid_h = vid_h; 1835 xcb_out.drw_x = drw_x; 1836 xcb_out.drw_y = drw_y; 1837 xcb_out.drw_w = drw_w; 1838 xcb_out.drw_h = drw_h; 1839 1840 xcb_parts[2].iov_base = (char *) &xcb_out; 1841 xcb_parts[2].iov_len = sizeof(xcb_out); 1842 xcb_parts[3].iov_base = 0; 1843 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1844 1845 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 1846 return xcb_ret; 1847 } 1848 1849 1850 /***************************************************************************** 1851 ** 1852 ** xcb_void_cookie_t xcb_xv_get_video 1853 ** 1854 ** @param xcb_connection_t *c 1855 ** @param xcb_xv_port_t port 1856 ** @param xcb_drawable_t drawable 1857 ** @param xcb_gcontext_t gc 1858 ** @param int16_t vid_x 1859 ** @param int16_t vid_y 1860 ** @param uint16_t vid_w 1861 ** @param uint16_t vid_h 1862 ** @param int16_t drw_x 1863 ** @param int16_t drw_y 1864 ** @param uint16_t drw_w 1865 ** @param uint16_t drw_h 1866 ** @returns xcb_void_cookie_t 1867 ** 1868 *****************************************************************************/ 1869 1870 xcb_void_cookie_t 1871 xcb_xv_get_video (xcb_connection_t *c /**< */, 1872 xcb_xv_port_t port /**< */, 1873 xcb_drawable_t drawable /**< */, 1874 xcb_gcontext_t gc /**< */, 1875 int16_t vid_x /**< */, 1876 int16_t vid_y /**< */, 1877 uint16_t vid_w /**< */, 1878 uint16_t vid_h /**< */, 1879 int16_t drw_x /**< */, 1880 int16_t drw_y /**< */, 1881 uint16_t drw_w /**< */, 1882 uint16_t drw_h /**< */) 1883 { 1884 static const xcb_protocol_request_t xcb_req = { 1885 /* count */ 2, 1886 /* ext */ &xcb_xv_id, 1887 /* opcode */ XCB_XV_GET_VIDEO, 1888 /* isvoid */ 1 1889 }; 1890 1891 struct iovec xcb_parts[4]; 1892 xcb_void_cookie_t xcb_ret; 1893 xcb_xv_get_video_request_t xcb_out; 1894 1895 xcb_out.port = port; 1896 xcb_out.drawable = drawable; 1897 xcb_out.gc = gc; 1898 xcb_out.vid_x = vid_x; 1899 xcb_out.vid_y = vid_y; 1900 xcb_out.vid_w = vid_w; 1901 xcb_out.vid_h = vid_h; 1902 xcb_out.drw_x = drw_x; 1903 xcb_out.drw_y = drw_y; 1904 xcb_out.drw_w = drw_w; 1905 xcb_out.drw_h = drw_h; 1906 1907 xcb_parts[2].iov_base = (char *) &xcb_out; 1908 xcb_parts[2].iov_len = sizeof(xcb_out); 1909 xcb_parts[3].iov_base = 0; 1910 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1911 1912 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 1913 return xcb_ret; 1914 } 1915 1916 1917 /***************************************************************************** 1918 ** 1919 ** xcb_void_cookie_t xcb_xv_get_still_checked 1920 ** 1921 ** @param xcb_connection_t *c 1922 ** @param xcb_xv_port_t port 1923 ** @param xcb_drawable_t drawable 1924 ** @param xcb_gcontext_t gc 1925 ** @param int16_t vid_x 1926 ** @param int16_t vid_y 1927 ** @param uint16_t vid_w 1928 ** @param uint16_t vid_h 1929 ** @param int16_t drw_x 1930 ** @param int16_t drw_y 1931 ** @param uint16_t drw_w 1932 ** @param uint16_t drw_h 1933 ** @returns xcb_void_cookie_t 1934 ** 1935 *****************************************************************************/ 1936 1937 xcb_void_cookie_t 1938 xcb_xv_get_still_checked (xcb_connection_t *c /**< */, 1939 xcb_xv_port_t port /**< */, 1940 xcb_drawable_t drawable /**< */, 1941 xcb_gcontext_t gc /**< */, 1942 int16_t vid_x /**< */, 1943 int16_t vid_y /**< */, 1944 uint16_t vid_w /**< */, 1945 uint16_t vid_h /**< */, 1946 int16_t drw_x /**< */, 1947 int16_t drw_y /**< */, 1948 uint16_t drw_w /**< */, 1949 uint16_t drw_h /**< */) 1950 { 1951 static const xcb_protocol_request_t xcb_req = { 1952 /* count */ 2, 1953 /* ext */ &xcb_xv_id, 1954 /* opcode */ XCB_XV_GET_STILL, 1955 /* isvoid */ 1 1956 }; 1957 1958 struct iovec xcb_parts[4]; 1959 xcb_void_cookie_t xcb_ret; 1960 xcb_xv_get_still_request_t xcb_out; 1961 1962 xcb_out.port = port; 1963 xcb_out.drawable = drawable; 1964 xcb_out.gc = gc; 1965 xcb_out.vid_x = vid_x; 1966 xcb_out.vid_y = vid_y; 1967 xcb_out.vid_w = vid_w; 1968 xcb_out.vid_h = vid_h; 1969 xcb_out.drw_x = drw_x; 1970 xcb_out.drw_y = drw_y; 1971 xcb_out.drw_w = drw_w; 1972 xcb_out.drw_h = drw_h; 1973 1974 xcb_parts[2].iov_base = (char *) &xcb_out; 1975 xcb_parts[2].iov_len = sizeof(xcb_out); 1976 xcb_parts[3].iov_base = 0; 1977 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 1978 1979 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 1980 return xcb_ret; 1981 } 1982 1983 1984 /***************************************************************************** 1985 ** 1986 ** xcb_void_cookie_t xcb_xv_get_still 1987 ** 1988 ** @param xcb_connection_t *c 1989 ** @param xcb_xv_port_t port 1990 ** @param xcb_drawable_t drawable 1991 ** @param xcb_gcontext_t gc 1992 ** @param int16_t vid_x 1993 ** @param int16_t vid_y 1994 ** @param uint16_t vid_w 1995 ** @param uint16_t vid_h 1996 ** @param int16_t drw_x 1997 ** @param int16_t drw_y 1998 ** @param uint16_t drw_w 1999 ** @param uint16_t drw_h 2000 ** @returns xcb_void_cookie_t 2001 ** 2002 *****************************************************************************/ 2003 2004 xcb_void_cookie_t 2005 xcb_xv_get_still (xcb_connection_t *c /**< */, 2006 xcb_xv_port_t port /**< */, 2007 xcb_drawable_t drawable /**< */, 2008 xcb_gcontext_t gc /**< */, 2009 int16_t vid_x /**< */, 2010 int16_t vid_y /**< */, 2011 uint16_t vid_w /**< */, 2012 uint16_t vid_h /**< */, 2013 int16_t drw_x /**< */, 2014 int16_t drw_y /**< */, 2015 uint16_t drw_w /**< */, 2016 uint16_t drw_h /**< */) 2017 { 2018 static const xcb_protocol_request_t xcb_req = { 2019 /* count */ 2, 2020 /* ext */ &xcb_xv_id, 2021 /* opcode */ XCB_XV_GET_STILL, 2022 /* isvoid */ 1 2023 }; 2024 2025 struct iovec xcb_parts[4]; 2026 xcb_void_cookie_t xcb_ret; 2027 xcb_xv_get_still_request_t xcb_out; 2028 2029 xcb_out.port = port; 2030 xcb_out.drawable = drawable; 2031 xcb_out.gc = gc; 2032 xcb_out.vid_x = vid_x; 2033 xcb_out.vid_y = vid_y; 2034 xcb_out.vid_w = vid_w; 2035 xcb_out.vid_h = vid_h; 2036 xcb_out.drw_x = drw_x; 2037 xcb_out.drw_y = drw_y; 2038 xcb_out.drw_w = drw_w; 2039 xcb_out.drw_h = drw_h; 2040 2041 xcb_parts[2].iov_base = (char *) &xcb_out; 2042 xcb_parts[2].iov_len = sizeof(xcb_out); 2043 xcb_parts[3].iov_base = 0; 2044 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 2045 2046 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 2047 return xcb_ret; 2048 } 2049 2050 2051 /***************************************************************************** 2052 ** 2053 ** xcb_void_cookie_t xcb_xv_stop_video_checked 2054 ** 2055 ** @param xcb_connection_t *c 2056 ** @param xcb_xv_port_t port 2057 ** @param xcb_drawable_t drawable 2058 ** @returns xcb_void_cookie_t 2059 ** 2060 *****************************************************************************/ 2061 2062 xcb_void_cookie_t 2063 xcb_xv_stop_video_checked (xcb_connection_t *c /**< */, 2064 xcb_xv_port_t port /**< */, 2065 xcb_drawable_t drawable /**< */) 2066 { 2067 static const xcb_protocol_request_t xcb_req = { 2068 /* count */ 2, 2069 /* ext */ &xcb_xv_id, 2070 /* opcode */ XCB_XV_STOP_VIDEO, 2071 /* isvoid */ 1 2072 }; 2073 2074 struct iovec xcb_parts[4]; 2075 xcb_void_cookie_t xcb_ret; 2076 xcb_xv_stop_video_request_t xcb_out; 2077 2078 xcb_out.port = port; 2079 xcb_out.drawable = drawable; 2080 2081 xcb_parts[2].iov_base = (char *) &xcb_out; 2082 xcb_parts[2].iov_len = sizeof(xcb_out); 2083 xcb_parts[3].iov_base = 0; 2084 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 2085 2086 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 2087 return xcb_ret; 2088 } 2089 2090 2091 /***************************************************************************** 2092 ** 2093 ** xcb_void_cookie_t xcb_xv_stop_video 2094 ** 2095 ** @param xcb_connection_t *c 2096 ** @param xcb_xv_port_t port 2097 ** @param xcb_drawable_t drawable 2098 ** @returns xcb_void_cookie_t 2099 ** 2100 *****************************************************************************/ 2101 2102 xcb_void_cookie_t 2103 xcb_xv_stop_video (xcb_connection_t *c /**< */, 2104 xcb_xv_port_t port /**< */, 2105 xcb_drawable_t drawable /**< */) 2106 { 2107 static const xcb_protocol_request_t xcb_req = { 2108 /* count */ 2, 2109 /* ext */ &xcb_xv_id, 2110 /* opcode */ XCB_XV_STOP_VIDEO, 2111 /* isvoid */ 1 2112 }; 2113 2114 struct iovec xcb_parts[4]; 2115 xcb_void_cookie_t xcb_ret; 2116 xcb_xv_stop_video_request_t xcb_out; 2117 2118 xcb_out.port = port; 2119 xcb_out.drawable = drawable; 2120 2121 xcb_parts[2].iov_base = (char *) &xcb_out; 2122 xcb_parts[2].iov_len = sizeof(xcb_out); 2123 xcb_parts[3].iov_base = 0; 2124 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 2125 2126 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 2127 return xcb_ret; 2128 } 2129 2130 2131 /***************************************************************************** 2132 ** 2133 ** xcb_void_cookie_t xcb_xv_select_video_notify_checked 2134 ** 2135 ** @param xcb_connection_t *c 2136 ** @param xcb_drawable_t drawable 2137 ** @param uint8_t onoff 2138 ** @returns xcb_void_cookie_t 2139 ** 2140 *****************************************************************************/ 2141 2142 xcb_void_cookie_t 2143 xcb_xv_select_video_notify_checked (xcb_connection_t *c /**< */, 2144 xcb_drawable_t drawable /**< */, 2145 uint8_t onoff /**< */) 2146 { 2147 static const xcb_protocol_request_t xcb_req = { 2148 /* count */ 2, 2149 /* ext */ &xcb_xv_id, 2150 /* opcode */ XCB_XV_SELECT_VIDEO_NOTIFY, 2151 /* isvoid */ 1 2152 }; 2153 2154 struct iovec xcb_parts[4]; 2155 xcb_void_cookie_t xcb_ret; 2156 xcb_xv_select_video_notify_request_t xcb_out; 2157 2158 xcb_out.drawable = drawable; 2159 xcb_out.onoff = onoff; 2160 memset(xcb_out.pad0, 0, 3); 2161 2162 xcb_parts[2].iov_base = (char *) &xcb_out; 2163 xcb_parts[2].iov_len = sizeof(xcb_out); 2164 xcb_parts[3].iov_base = 0; 2165 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 2166 2167 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 2168 return xcb_ret; 2169 } 2170 2171 2172 /***************************************************************************** 2173 ** 2174 ** xcb_void_cookie_t xcb_xv_select_video_notify 2175 ** 2176 ** @param xcb_connection_t *c 2177 ** @param xcb_drawable_t drawable 2178 ** @param uint8_t onoff 2179 ** @returns xcb_void_cookie_t 2180 ** 2181 *****************************************************************************/ 2182 2183 xcb_void_cookie_t 2184 xcb_xv_select_video_notify (xcb_connection_t *c /**< */, 2185 xcb_drawable_t drawable /**< */, 2186 uint8_t onoff /**< */) 2187 { 2188 static const xcb_protocol_request_t xcb_req = { 2189 /* count */ 2, 2190 /* ext */ &xcb_xv_id, 2191 /* opcode */ XCB_XV_SELECT_VIDEO_NOTIFY, 2192 /* isvoid */ 1 2193 }; 2194 2195 struct iovec xcb_parts[4]; 2196 xcb_void_cookie_t xcb_ret; 2197 xcb_xv_select_video_notify_request_t xcb_out; 2198 2199 xcb_out.drawable = drawable; 2200 xcb_out.onoff = onoff; 2201 memset(xcb_out.pad0, 0, 3); 2202 2203 xcb_parts[2].iov_base = (char *) &xcb_out; 2204 xcb_parts[2].iov_len = sizeof(xcb_out); 2205 xcb_parts[3].iov_base = 0; 2206 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 2207 2208 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 2209 return xcb_ret; 2210 } 2211 2212 2213 /***************************************************************************** 2214 ** 2215 ** xcb_void_cookie_t xcb_xv_select_port_notify_checked 2216 ** 2217 ** @param xcb_connection_t *c 2218 ** @param xcb_xv_port_t port 2219 ** @param uint8_t onoff 2220 ** @returns xcb_void_cookie_t 2221 ** 2222 *****************************************************************************/ 2223 2224 xcb_void_cookie_t 2225 xcb_xv_select_port_notify_checked (xcb_connection_t *c /**< */, 2226 xcb_xv_port_t port /**< */, 2227 uint8_t onoff /**< */) 2228 { 2229 static const xcb_protocol_request_t xcb_req = { 2230 /* count */ 2, 2231 /* ext */ &xcb_xv_id, 2232 /* opcode */ XCB_XV_SELECT_PORT_NOTIFY, 2233 /* isvoid */ 1 2234 }; 2235 2236 struct iovec xcb_parts[4]; 2237 xcb_void_cookie_t xcb_ret; 2238 xcb_xv_select_port_notify_request_t xcb_out; 2239 2240 xcb_out.port = port; 2241 xcb_out.onoff = onoff; 2242 memset(xcb_out.pad0, 0, 3); 2243 2244 xcb_parts[2].iov_base = (char *) &xcb_out; 2245 xcb_parts[2].iov_len = sizeof(xcb_out); 2246 xcb_parts[3].iov_base = 0; 2247 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 2248 2249 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 2250 return xcb_ret; 2251 } 2252 2253 2254 /***************************************************************************** 2255 ** 2256 ** xcb_void_cookie_t xcb_xv_select_port_notify 2257 ** 2258 ** @param xcb_connection_t *c 2259 ** @param xcb_xv_port_t port 2260 ** @param uint8_t onoff 2261 ** @returns xcb_void_cookie_t 2262 ** 2263 *****************************************************************************/ 2264 2265 xcb_void_cookie_t 2266 xcb_xv_select_port_notify (xcb_connection_t *c /**< */, 2267 xcb_xv_port_t port /**< */, 2268 uint8_t onoff /**< */) 2269 { 2270 static const xcb_protocol_request_t xcb_req = { 2271 /* count */ 2, 2272 /* ext */ &xcb_xv_id, 2273 /* opcode */ XCB_XV_SELECT_PORT_NOTIFY, 2274 /* isvoid */ 1 2275 }; 2276 2277 struct iovec xcb_parts[4]; 2278 xcb_void_cookie_t xcb_ret; 2279 xcb_xv_select_port_notify_request_t xcb_out; 2280 2281 xcb_out.port = port; 2282 xcb_out.onoff = onoff; 2283 memset(xcb_out.pad0, 0, 3); 2284 2285 xcb_parts[2].iov_base = (char *) &xcb_out; 2286 xcb_parts[2].iov_len = sizeof(xcb_out); 2287 xcb_parts[3].iov_base = 0; 2288 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 2289 2290 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 2291 return xcb_ret; 2292 } 2293 2294 2295 /***************************************************************************** 2296 ** 2297 ** xcb_xv_query_best_size_cookie_t xcb_xv_query_best_size 2298 ** 2299 ** @param xcb_connection_t *c 2300 ** @param xcb_xv_port_t port 2301 ** @param uint16_t vid_w 2302 ** @param uint16_t vid_h 2303 ** @param uint16_t drw_w 2304 ** @param uint16_t drw_h 2305 ** @param uint8_t motion 2306 ** @returns xcb_xv_query_best_size_cookie_t 2307 ** 2308 *****************************************************************************/ 2309 2310 xcb_xv_query_best_size_cookie_t 2311 xcb_xv_query_best_size (xcb_connection_t *c /**< */, 2312 xcb_xv_port_t port /**< */, 2313 uint16_t vid_w /**< */, 2314 uint16_t vid_h /**< */, 2315 uint16_t drw_w /**< */, 2316 uint16_t drw_h /**< */, 2317 uint8_t motion /**< */) 2318 { 2319 static const xcb_protocol_request_t xcb_req = { 2320 /* count */ 2, 2321 /* ext */ &xcb_xv_id, 2322 /* opcode */ XCB_XV_QUERY_BEST_SIZE, 2323 /* isvoid */ 0 2324 }; 2325 2326 struct iovec xcb_parts[4]; 2327 xcb_xv_query_best_size_cookie_t xcb_ret; 2328 xcb_xv_query_best_size_request_t xcb_out; 2329 2330 xcb_out.port = port; 2331 xcb_out.vid_w = vid_w; 2332 xcb_out.vid_h = vid_h; 2333 xcb_out.drw_w = drw_w; 2334 xcb_out.drw_h = drw_h; 2335 xcb_out.motion = motion; 2336 memset(xcb_out.pad0, 0, 3); 2337 2338 xcb_parts[2].iov_base = (char *) &xcb_out; 2339 xcb_parts[2].iov_len = sizeof(xcb_out); 2340 xcb_parts[3].iov_base = 0; 2341 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 2342 2343 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 2344 return xcb_ret; 2345 } 2346 2347 2348 /***************************************************************************** 2349 ** 2350 ** xcb_xv_query_best_size_cookie_t xcb_xv_query_best_size_unchecked 2351 ** 2352 ** @param xcb_connection_t *c 2353 ** @param xcb_xv_port_t port 2354 ** @param uint16_t vid_w 2355 ** @param uint16_t vid_h 2356 ** @param uint16_t drw_w 2357 ** @param uint16_t drw_h 2358 ** @param uint8_t motion 2359 ** @returns xcb_xv_query_best_size_cookie_t 2360 ** 2361 *****************************************************************************/ 2362 2363 xcb_xv_query_best_size_cookie_t 2364 xcb_xv_query_best_size_unchecked (xcb_connection_t *c /**< */, 2365 xcb_xv_port_t port /**< */, 2366 uint16_t vid_w /**< */, 2367 uint16_t vid_h /**< */, 2368 uint16_t drw_w /**< */, 2369 uint16_t drw_h /**< */, 2370 uint8_t motion /**< */) 2371 { 2372 static const xcb_protocol_request_t xcb_req = { 2373 /* count */ 2, 2374 /* ext */ &xcb_xv_id, 2375 /* opcode */ XCB_XV_QUERY_BEST_SIZE, 2376 /* isvoid */ 0 2377 }; 2378 2379 struct iovec xcb_parts[4]; 2380 xcb_xv_query_best_size_cookie_t xcb_ret; 2381 xcb_xv_query_best_size_request_t xcb_out; 2382 2383 xcb_out.port = port; 2384 xcb_out.vid_w = vid_w; 2385 xcb_out.vid_h = vid_h; 2386 xcb_out.drw_w = drw_w; 2387 xcb_out.drw_h = drw_h; 2388 xcb_out.motion = motion; 2389 memset(xcb_out.pad0, 0, 3); 2390 2391 xcb_parts[2].iov_base = (char *) &xcb_out; 2392 xcb_parts[2].iov_len = sizeof(xcb_out); 2393 xcb_parts[3].iov_base = 0; 2394 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 2395 2396 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 2397 return xcb_ret; 2398 } 2399 2400 2401 /***************************************************************************** 2402 ** 2403 ** xcb_xv_query_best_size_reply_t * xcb_xv_query_best_size_reply 2404 ** 2405 ** @param xcb_connection_t *c 2406 ** @param xcb_xv_query_best_size_cookie_t cookie 2407 ** @param xcb_generic_error_t **e 2408 ** @returns xcb_xv_query_best_size_reply_t * 2409 ** 2410 *****************************************************************************/ 2411 2412 xcb_xv_query_best_size_reply_t * 2413 xcb_xv_query_best_size_reply (xcb_connection_t *c /**< */, 2414 xcb_xv_query_best_size_cookie_t cookie /**< */, 2415 xcb_generic_error_t **e /**< */) 2416 { 2417 return (xcb_xv_query_best_size_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 2418 } 2419 2420 2421 /***************************************************************************** 2422 ** 2423 ** xcb_void_cookie_t xcb_xv_set_port_attribute_checked 2424 ** 2425 ** @param xcb_connection_t *c 2426 ** @param xcb_xv_port_t port 2427 ** @param xcb_atom_t attribute 2428 ** @param int32_t value 2429 ** @returns xcb_void_cookie_t 2430 ** 2431 *****************************************************************************/ 2432 2433 xcb_void_cookie_t 2434 xcb_xv_set_port_attribute_checked (xcb_connection_t *c /**< */, 2435 xcb_xv_port_t port /**< */, 2436 xcb_atom_t attribute /**< */, 2437 int32_t value /**< */) 2438 { 2439 static const xcb_protocol_request_t xcb_req = { 2440 /* count */ 2, 2441 /* ext */ &xcb_xv_id, 2442 /* opcode */ XCB_XV_SET_PORT_ATTRIBUTE, 2443 /* isvoid */ 1 2444 }; 2445 2446 struct iovec xcb_parts[4]; 2447 xcb_void_cookie_t xcb_ret; 2448 xcb_xv_set_port_attribute_request_t xcb_out; 2449 2450 xcb_out.port = port; 2451 xcb_out.attribute = attribute; 2452 xcb_out.value = value; 2453 2454 xcb_parts[2].iov_base = (char *) &xcb_out; 2455 xcb_parts[2].iov_len = sizeof(xcb_out); 2456 xcb_parts[3].iov_base = 0; 2457 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 2458 2459 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 2460 return xcb_ret; 2461 } 2462 2463 2464 /***************************************************************************** 2465 ** 2466 ** xcb_void_cookie_t xcb_xv_set_port_attribute 2467 ** 2468 ** @param xcb_connection_t *c 2469 ** @param xcb_xv_port_t port 2470 ** @param xcb_atom_t attribute 2471 ** @param int32_t value 2472 ** @returns xcb_void_cookie_t 2473 ** 2474 *****************************************************************************/ 2475 2476 xcb_void_cookie_t 2477 xcb_xv_set_port_attribute (xcb_connection_t *c /**< */, 2478 xcb_xv_port_t port /**< */, 2479 xcb_atom_t attribute /**< */, 2480 int32_t value /**< */) 2481 { 2482 static const xcb_protocol_request_t xcb_req = { 2483 /* count */ 2, 2484 /* ext */ &xcb_xv_id, 2485 /* opcode */ XCB_XV_SET_PORT_ATTRIBUTE, 2486 /* isvoid */ 1 2487 }; 2488 2489 struct iovec xcb_parts[4]; 2490 xcb_void_cookie_t xcb_ret; 2491 xcb_xv_set_port_attribute_request_t xcb_out; 2492 2493 xcb_out.port = port; 2494 xcb_out.attribute = attribute; 2495 xcb_out.value = value; 2496 2497 xcb_parts[2].iov_base = (char *) &xcb_out; 2498 xcb_parts[2].iov_len = sizeof(xcb_out); 2499 xcb_parts[3].iov_base = 0; 2500 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 2501 2502 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 2503 return xcb_ret; 2504 } 2505 2506 2507 /***************************************************************************** 2508 ** 2509 ** xcb_xv_get_port_attribute_cookie_t xcb_xv_get_port_attribute 2510 ** 2511 ** @param xcb_connection_t *c 2512 ** @param xcb_xv_port_t port 2513 ** @param xcb_atom_t attribute 2514 ** @returns xcb_xv_get_port_attribute_cookie_t 2515 ** 2516 *****************************************************************************/ 2517 2518 xcb_xv_get_port_attribute_cookie_t 2519 xcb_xv_get_port_attribute (xcb_connection_t *c /**< */, 2520 xcb_xv_port_t port /**< */, 2521 xcb_atom_t attribute /**< */) 2522 { 2523 static const xcb_protocol_request_t xcb_req = { 2524 /* count */ 2, 2525 /* ext */ &xcb_xv_id, 2526 /* opcode */ XCB_XV_GET_PORT_ATTRIBUTE, 2527 /* isvoid */ 0 2528 }; 2529 2530 struct iovec xcb_parts[4]; 2531 xcb_xv_get_port_attribute_cookie_t xcb_ret; 2532 xcb_xv_get_port_attribute_request_t xcb_out; 2533 2534 xcb_out.port = port; 2535 xcb_out.attribute = attribute; 2536 2537 xcb_parts[2].iov_base = (char *) &xcb_out; 2538 xcb_parts[2].iov_len = sizeof(xcb_out); 2539 xcb_parts[3].iov_base = 0; 2540 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 2541 2542 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 2543 return xcb_ret; 2544 } 2545 2546 2547 /***************************************************************************** 2548 ** 2549 ** xcb_xv_get_port_attribute_cookie_t xcb_xv_get_port_attribute_unchecked 2550 ** 2551 ** @param xcb_connection_t *c 2552 ** @param xcb_xv_port_t port 2553 ** @param xcb_atom_t attribute 2554 ** @returns xcb_xv_get_port_attribute_cookie_t 2555 ** 2556 *****************************************************************************/ 2557 2558 xcb_xv_get_port_attribute_cookie_t 2559 xcb_xv_get_port_attribute_unchecked (xcb_connection_t *c /**< */, 2560 xcb_xv_port_t port /**< */, 2561 xcb_atom_t attribute /**< */) 2562 { 2563 static const xcb_protocol_request_t xcb_req = { 2564 /* count */ 2, 2565 /* ext */ &xcb_xv_id, 2566 /* opcode */ XCB_XV_GET_PORT_ATTRIBUTE, 2567 /* isvoid */ 0 2568 }; 2569 2570 struct iovec xcb_parts[4]; 2571 xcb_xv_get_port_attribute_cookie_t xcb_ret; 2572 xcb_xv_get_port_attribute_request_t xcb_out; 2573 2574 xcb_out.port = port; 2575 xcb_out.attribute = attribute; 2576 2577 xcb_parts[2].iov_base = (char *) &xcb_out; 2578 xcb_parts[2].iov_len = sizeof(xcb_out); 2579 xcb_parts[3].iov_base = 0; 2580 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 2581 2582 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 2583 return xcb_ret; 2584 } 2585 2586 2587 /***************************************************************************** 2588 ** 2589 ** xcb_xv_get_port_attribute_reply_t * xcb_xv_get_port_attribute_reply 2590 ** 2591 ** @param xcb_connection_t *c 2592 ** @param xcb_xv_get_port_attribute_cookie_t cookie 2593 ** @param xcb_generic_error_t **e 2594 ** @returns xcb_xv_get_port_attribute_reply_t * 2595 ** 2596 *****************************************************************************/ 2597 2598 xcb_xv_get_port_attribute_reply_t * 2599 xcb_xv_get_port_attribute_reply (xcb_connection_t *c /**< */, 2600 xcb_xv_get_port_attribute_cookie_t cookie /**< */, 2601 xcb_generic_error_t **e /**< */) 2602 { 2603 return (xcb_xv_get_port_attribute_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 2604 } 2605 2606 int 2607 xcb_xv_query_port_attributes_sizeof (const void *_buffer /**< */) 2608 { 2609 char *xcb_tmp = (char *)_buffer; 2610 const xcb_xv_query_port_attributes_reply_t *_aux = (xcb_xv_query_port_attributes_reply_t *)_buffer; 2611 unsigned int xcb_buffer_len = 0; 2612 unsigned int xcb_block_len = 0; 2613 unsigned int xcb_pad = 0; 2614 unsigned int xcb_align_to = 0; 2615 2616 unsigned int i; 2617 unsigned int xcb_tmp_len; 2618 2619 xcb_block_len += sizeof(xcb_xv_query_port_attributes_reply_t); 2620 xcb_tmp += xcb_block_len; 2621 xcb_buffer_len += xcb_block_len; 2622 xcb_block_len = 0; 2623 /* attributes */ 2624 for(i=0; i<_aux->num_attributes; i++) { 2625 xcb_tmp_len = xcb_xv_attribute_info_sizeof(xcb_tmp); 2626 xcb_block_len += xcb_tmp_len; 2627 xcb_tmp += xcb_tmp_len; 2628 } 2629 xcb_align_to = ALIGNOF(xcb_xv_attribute_info_t); 2630 /* insert padding */ 2631 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 2632 xcb_buffer_len += xcb_block_len + xcb_pad; 2633 if (0 != xcb_pad) { 2634 xcb_tmp += xcb_pad; 2635 xcb_pad = 0; 2636 } 2637 xcb_block_len = 0; 2638 2639 return xcb_buffer_len; 2640 } 2641 2642 2643 /***************************************************************************** 2644 ** 2645 ** xcb_xv_query_port_attributes_cookie_t xcb_xv_query_port_attributes 2646 ** 2647 ** @param xcb_connection_t *c 2648 ** @param xcb_xv_port_t port 2649 ** @returns xcb_xv_query_port_attributes_cookie_t 2650 ** 2651 *****************************************************************************/ 2652 2653 xcb_xv_query_port_attributes_cookie_t 2654 xcb_xv_query_port_attributes (xcb_connection_t *c /**< */, 2655 xcb_xv_port_t port /**< */) 2656 { 2657 static const xcb_protocol_request_t xcb_req = { 2658 /* count */ 2, 2659 /* ext */ &xcb_xv_id, 2660 /* opcode */ XCB_XV_QUERY_PORT_ATTRIBUTES, 2661 /* isvoid */ 0 2662 }; 2663 2664 struct iovec xcb_parts[4]; 2665 xcb_xv_query_port_attributes_cookie_t xcb_ret; 2666 xcb_xv_query_port_attributes_request_t xcb_out; 2667 2668 xcb_out.port = port; 2669 2670 xcb_parts[2].iov_base = (char *) &xcb_out; 2671 xcb_parts[2].iov_len = sizeof(xcb_out); 2672 xcb_parts[3].iov_base = 0; 2673 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 2674 2675 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 2676 return xcb_ret; 2677 } 2678 2679 2680 /***************************************************************************** 2681 ** 2682 ** xcb_xv_query_port_attributes_cookie_t xcb_xv_query_port_attributes_unchecked 2683 ** 2684 ** @param xcb_connection_t *c 2685 ** @param xcb_xv_port_t port 2686 ** @returns xcb_xv_query_port_attributes_cookie_t 2687 ** 2688 *****************************************************************************/ 2689 2690 xcb_xv_query_port_attributes_cookie_t 2691 xcb_xv_query_port_attributes_unchecked (xcb_connection_t *c /**< */, 2692 xcb_xv_port_t port /**< */) 2693 { 2694 static const xcb_protocol_request_t xcb_req = { 2695 /* count */ 2, 2696 /* ext */ &xcb_xv_id, 2697 /* opcode */ XCB_XV_QUERY_PORT_ATTRIBUTES, 2698 /* isvoid */ 0 2699 }; 2700 2701 struct iovec xcb_parts[4]; 2702 xcb_xv_query_port_attributes_cookie_t xcb_ret; 2703 xcb_xv_query_port_attributes_request_t xcb_out; 2704 2705 xcb_out.port = port; 2706 2707 xcb_parts[2].iov_base = (char *) &xcb_out; 2708 xcb_parts[2].iov_len = sizeof(xcb_out); 2709 xcb_parts[3].iov_base = 0; 2710 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 2711 2712 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 2713 return xcb_ret; 2714 } 2715 2716 2717 /***************************************************************************** 2718 ** 2719 ** int xcb_xv_query_port_attributes_attributes_length 2720 ** 2721 ** @param const xcb_xv_query_port_attributes_reply_t *R 2722 ** @returns int 2723 ** 2724 *****************************************************************************/ 2725 2726 int 2727 xcb_xv_query_port_attributes_attributes_length (const xcb_xv_query_port_attributes_reply_t *R /**< */) 2728 { 2729 return R->num_attributes; 2730 } 2731 2732 2733 /***************************************************************************** 2734 ** 2735 ** xcb_xv_attribute_info_iterator_t xcb_xv_query_port_attributes_attributes_iterator 2736 ** 2737 ** @param const xcb_xv_query_port_attributes_reply_t *R 2738 ** @returns xcb_xv_attribute_info_iterator_t 2739 ** 2740 *****************************************************************************/ 2741 2742 xcb_xv_attribute_info_iterator_t 2743 xcb_xv_query_port_attributes_attributes_iterator (const xcb_xv_query_port_attributes_reply_t *R /**< */) 2744 { 2745 xcb_xv_attribute_info_iterator_t i; 2746 i.data = (xcb_xv_attribute_info_t *) (R + 1); 2747 i.rem = R->num_attributes; 2748 i.index = (char *) i.data - (char *) R; 2749 return i; 2750 } 2751 2752 2753 /***************************************************************************** 2754 ** 2755 ** xcb_xv_query_port_attributes_reply_t * xcb_xv_query_port_attributes_reply 2756 ** 2757 ** @param xcb_connection_t *c 2758 ** @param xcb_xv_query_port_attributes_cookie_t cookie 2759 ** @param xcb_generic_error_t **e 2760 ** @returns xcb_xv_query_port_attributes_reply_t * 2761 ** 2762 *****************************************************************************/ 2763 2764 xcb_xv_query_port_attributes_reply_t * 2765 xcb_xv_query_port_attributes_reply (xcb_connection_t *c /**< */, 2766 xcb_xv_query_port_attributes_cookie_t cookie /**< */, 2767 xcb_generic_error_t **e /**< */) 2768 { 2769 return (xcb_xv_query_port_attributes_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 2770 } 2771 2772 int 2773 xcb_xv_list_image_formats_sizeof (const void *_buffer /**< */) 2774 { 2775 char *xcb_tmp = (char *)_buffer; 2776 const xcb_xv_list_image_formats_reply_t *_aux = (xcb_xv_list_image_formats_reply_t *)_buffer; 2777 unsigned int xcb_buffer_len = 0; 2778 unsigned int xcb_block_len = 0; 2779 unsigned int xcb_pad = 0; 2780 unsigned int xcb_align_to = 0; 2781 2782 2783 xcb_block_len += sizeof(xcb_xv_list_image_formats_reply_t); 2784 xcb_tmp += xcb_block_len; 2785 xcb_buffer_len += xcb_block_len; 2786 xcb_block_len = 0; 2787 /* format */ 2788 xcb_block_len += _aux->num_formats * sizeof(xcb_xv_image_format_info_t); 2789 xcb_tmp += xcb_block_len; 2790 xcb_align_to = ALIGNOF(xcb_xv_image_format_info_t); 2791 /* insert padding */ 2792 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 2793 xcb_buffer_len += xcb_block_len + xcb_pad; 2794 if (0 != xcb_pad) { 2795 xcb_tmp += xcb_pad; 2796 xcb_pad = 0; 2797 } 2798 xcb_block_len = 0; 2799 2800 return xcb_buffer_len; 2801 } 2802 2803 2804 /***************************************************************************** 2805 ** 2806 ** xcb_xv_list_image_formats_cookie_t xcb_xv_list_image_formats 2807 ** 2808 ** @param xcb_connection_t *c 2809 ** @param xcb_xv_port_t port 2810 ** @returns xcb_xv_list_image_formats_cookie_t 2811 ** 2812 *****************************************************************************/ 2813 2814 xcb_xv_list_image_formats_cookie_t 2815 xcb_xv_list_image_formats (xcb_connection_t *c /**< */, 2816 xcb_xv_port_t port /**< */) 2817 { 2818 static const xcb_protocol_request_t xcb_req = { 2819 /* count */ 2, 2820 /* ext */ &xcb_xv_id, 2821 /* opcode */ XCB_XV_LIST_IMAGE_FORMATS, 2822 /* isvoid */ 0 2823 }; 2824 2825 struct iovec xcb_parts[4]; 2826 xcb_xv_list_image_formats_cookie_t xcb_ret; 2827 xcb_xv_list_image_formats_request_t xcb_out; 2828 2829 xcb_out.port = port; 2830 2831 xcb_parts[2].iov_base = (char *) &xcb_out; 2832 xcb_parts[2].iov_len = sizeof(xcb_out); 2833 xcb_parts[3].iov_base = 0; 2834 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 2835 2836 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 2837 return xcb_ret; 2838 } 2839 2840 2841 /***************************************************************************** 2842 ** 2843 ** xcb_xv_list_image_formats_cookie_t xcb_xv_list_image_formats_unchecked 2844 ** 2845 ** @param xcb_connection_t *c 2846 ** @param xcb_xv_port_t port 2847 ** @returns xcb_xv_list_image_formats_cookie_t 2848 ** 2849 *****************************************************************************/ 2850 2851 xcb_xv_list_image_formats_cookie_t 2852 xcb_xv_list_image_formats_unchecked (xcb_connection_t *c /**< */, 2853 xcb_xv_port_t port /**< */) 2854 { 2855 static const xcb_protocol_request_t xcb_req = { 2856 /* count */ 2, 2857 /* ext */ &xcb_xv_id, 2858 /* opcode */ XCB_XV_LIST_IMAGE_FORMATS, 2859 /* isvoid */ 0 2860 }; 2861 2862 struct iovec xcb_parts[4]; 2863 xcb_xv_list_image_formats_cookie_t xcb_ret; 2864 xcb_xv_list_image_formats_request_t xcb_out; 2865 2866 xcb_out.port = port; 2867 2868 xcb_parts[2].iov_base = (char *) &xcb_out; 2869 xcb_parts[2].iov_len = sizeof(xcb_out); 2870 xcb_parts[3].iov_base = 0; 2871 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 2872 2873 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 2874 return xcb_ret; 2875 } 2876 2877 2878 /***************************************************************************** 2879 ** 2880 ** xcb_xv_image_format_info_t * xcb_xv_list_image_formats_format 2881 ** 2882 ** @param const xcb_xv_list_image_formats_reply_t *R 2883 ** @returns xcb_xv_image_format_info_t * 2884 ** 2885 *****************************************************************************/ 2886 2887 xcb_xv_image_format_info_t * 2888 xcb_xv_list_image_formats_format (const xcb_xv_list_image_formats_reply_t *R /**< */) 2889 { 2890 return (xcb_xv_image_format_info_t *) (R + 1); 2891 } 2892 2893 2894 /***************************************************************************** 2895 ** 2896 ** int xcb_xv_list_image_formats_format_length 2897 ** 2898 ** @param const xcb_xv_list_image_formats_reply_t *R 2899 ** @returns int 2900 ** 2901 *****************************************************************************/ 2902 2903 int 2904 xcb_xv_list_image_formats_format_length (const xcb_xv_list_image_formats_reply_t *R /**< */) 2905 { 2906 return R->num_formats; 2907 } 2908 2909 2910 /***************************************************************************** 2911 ** 2912 ** xcb_xv_image_format_info_iterator_t xcb_xv_list_image_formats_format_iterator 2913 ** 2914 ** @param const xcb_xv_list_image_formats_reply_t *R 2915 ** @returns xcb_xv_image_format_info_iterator_t 2916 ** 2917 *****************************************************************************/ 2918 2919 xcb_xv_image_format_info_iterator_t 2920 xcb_xv_list_image_formats_format_iterator (const xcb_xv_list_image_formats_reply_t *R /**< */) 2921 { 2922 xcb_xv_image_format_info_iterator_t i; 2923 i.data = (xcb_xv_image_format_info_t *) (R + 1); 2924 i.rem = R->num_formats; 2925 i.index = (char *) i.data - (char *) R; 2926 return i; 2927 } 2928 2929 2930 /***************************************************************************** 2931 ** 2932 ** xcb_xv_list_image_formats_reply_t * xcb_xv_list_image_formats_reply 2933 ** 2934 ** @param xcb_connection_t *c 2935 ** @param xcb_xv_list_image_formats_cookie_t cookie 2936 ** @param xcb_generic_error_t **e 2937 ** @returns xcb_xv_list_image_formats_reply_t * 2938 ** 2939 *****************************************************************************/ 2940 2941 xcb_xv_list_image_formats_reply_t * 2942 xcb_xv_list_image_formats_reply (xcb_connection_t *c /**< */, 2943 xcb_xv_list_image_formats_cookie_t cookie /**< */, 2944 xcb_generic_error_t **e /**< */) 2945 { 2946 return (xcb_xv_list_image_formats_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 2947 } 2948 2949 int 2950 xcb_xv_query_image_attributes_sizeof (const void *_buffer /**< */) 2951 { 2952 char *xcb_tmp = (char *)_buffer; 2953 const xcb_xv_query_image_attributes_reply_t *_aux = (xcb_xv_query_image_attributes_reply_t *)_buffer; 2954 unsigned int xcb_buffer_len = 0; 2955 unsigned int xcb_block_len = 0; 2956 unsigned int xcb_pad = 0; 2957 unsigned int xcb_align_to = 0; 2958 2959 2960 xcb_block_len += sizeof(xcb_xv_query_image_attributes_reply_t); 2961 xcb_tmp += xcb_block_len; 2962 xcb_buffer_len += xcb_block_len; 2963 xcb_block_len = 0; 2964 /* pitches */ 2965 xcb_block_len += _aux->num_planes * sizeof(uint32_t); 2966 xcb_tmp += xcb_block_len; 2967 xcb_align_to = ALIGNOF(uint32_t); 2968 /* insert padding */ 2969 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 2970 xcb_buffer_len += xcb_block_len + xcb_pad; 2971 if (0 != xcb_pad) { 2972 xcb_tmp += xcb_pad; 2973 xcb_pad = 0; 2974 } 2975 xcb_block_len = 0; 2976 /* offsets */ 2977 xcb_block_len += _aux->num_planes * sizeof(uint32_t); 2978 xcb_tmp += xcb_block_len; 2979 xcb_align_to = ALIGNOF(uint32_t); 2980 /* insert padding */ 2981 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 2982 xcb_buffer_len += xcb_block_len + xcb_pad; 2983 if (0 != xcb_pad) { 2984 xcb_tmp += xcb_pad; 2985 xcb_pad = 0; 2986 } 2987 xcb_block_len = 0; 2988 2989 return xcb_buffer_len; 2990 } 2991 2992 2993 /***************************************************************************** 2994 ** 2995 ** xcb_xv_query_image_attributes_cookie_t xcb_xv_query_image_attributes 2996 ** 2997 ** @param xcb_connection_t *c 2998 ** @param xcb_xv_port_t port 2999 ** @param uint32_t id 3000 ** @param uint16_t width 3001 ** @param uint16_t height 3002 ** @returns xcb_xv_query_image_attributes_cookie_t 3003 ** 3004 *****************************************************************************/ 3005 3006 xcb_xv_query_image_attributes_cookie_t 3007 xcb_xv_query_image_attributes (xcb_connection_t *c /**< */, 3008 xcb_xv_port_t port /**< */, 3009 uint32_t id /**< */, 3010 uint16_t width /**< */, 3011 uint16_t height /**< */) 3012 { 3013 static const xcb_protocol_request_t xcb_req = { 3014 /* count */ 2, 3015 /* ext */ &xcb_xv_id, 3016 /* opcode */ XCB_XV_QUERY_IMAGE_ATTRIBUTES, 3017 /* isvoid */ 0 3018 }; 3019 3020 struct iovec xcb_parts[4]; 3021 xcb_xv_query_image_attributes_cookie_t xcb_ret; 3022 xcb_xv_query_image_attributes_request_t xcb_out; 3023 3024 xcb_out.port = port; 3025 xcb_out.id = id; 3026 xcb_out.width = width; 3027 xcb_out.height = height; 3028 3029 xcb_parts[2].iov_base = (char *) &xcb_out; 3030 xcb_parts[2].iov_len = sizeof(xcb_out); 3031 xcb_parts[3].iov_base = 0; 3032 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 3033 3034 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 3035 return xcb_ret; 3036 } 3037 3038 3039 /***************************************************************************** 3040 ** 3041 ** xcb_xv_query_image_attributes_cookie_t xcb_xv_query_image_attributes_unchecked 3042 ** 3043 ** @param xcb_connection_t *c 3044 ** @param xcb_xv_port_t port 3045 ** @param uint32_t id 3046 ** @param uint16_t width 3047 ** @param uint16_t height 3048 ** @returns xcb_xv_query_image_attributes_cookie_t 3049 ** 3050 *****************************************************************************/ 3051 3052 xcb_xv_query_image_attributes_cookie_t 3053 xcb_xv_query_image_attributes_unchecked (xcb_connection_t *c /**< */, 3054 xcb_xv_port_t port /**< */, 3055 uint32_t id /**< */, 3056 uint16_t width /**< */, 3057 uint16_t height /**< */) 3058 { 3059 static const xcb_protocol_request_t xcb_req = { 3060 /* count */ 2, 3061 /* ext */ &xcb_xv_id, 3062 /* opcode */ XCB_XV_QUERY_IMAGE_ATTRIBUTES, 3063 /* isvoid */ 0 3064 }; 3065 3066 struct iovec xcb_parts[4]; 3067 xcb_xv_query_image_attributes_cookie_t xcb_ret; 3068 xcb_xv_query_image_attributes_request_t xcb_out; 3069 3070 xcb_out.port = port; 3071 xcb_out.id = id; 3072 xcb_out.width = width; 3073 xcb_out.height = height; 3074 3075 xcb_parts[2].iov_base = (char *) &xcb_out; 3076 xcb_parts[2].iov_len = sizeof(xcb_out); 3077 xcb_parts[3].iov_base = 0; 3078 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 3079 3080 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 3081 return xcb_ret; 3082 } 3083 3084 3085 /***************************************************************************** 3086 ** 3087 ** uint32_t * xcb_xv_query_image_attributes_pitches 3088 ** 3089 ** @param const xcb_xv_query_image_attributes_reply_t *R 3090 ** @returns uint32_t * 3091 ** 3092 *****************************************************************************/ 3093 3094 uint32_t * 3095 xcb_xv_query_image_attributes_pitches (const xcb_xv_query_image_attributes_reply_t *R /**< */) 3096 { 3097 return (uint32_t *) (R + 1); 3098 } 3099 3100 3101 /***************************************************************************** 3102 ** 3103 ** int xcb_xv_query_image_attributes_pitches_length 3104 ** 3105 ** @param const xcb_xv_query_image_attributes_reply_t *R 3106 ** @returns int 3107 ** 3108 *****************************************************************************/ 3109 3110 int 3111 xcb_xv_query_image_attributes_pitches_length (const xcb_xv_query_image_attributes_reply_t *R /**< */) 3112 { 3113 return R->num_planes; 3114 } 3115 3116 3117 /***************************************************************************** 3118 ** 3119 ** xcb_generic_iterator_t xcb_xv_query_image_attributes_pitches_end 3120 ** 3121 ** @param const xcb_xv_query_image_attributes_reply_t *R 3122 ** @returns xcb_generic_iterator_t 3123 ** 3124 *****************************************************************************/ 3125 3126 xcb_generic_iterator_t 3127 xcb_xv_query_image_attributes_pitches_end (const xcb_xv_query_image_attributes_reply_t *R /**< */) 3128 { 3129 xcb_generic_iterator_t i; 3130 i.data = ((uint32_t *) (R + 1)) + (R->num_planes); 3131 i.rem = 0; 3132 i.index = (char *) i.data - (char *) R; 3133 return i; 3134 } 3135 3136 3137 /***************************************************************************** 3138 ** 3139 ** uint32_t * xcb_xv_query_image_attributes_offsets 3140 ** 3141 ** @param const xcb_xv_query_image_attributes_reply_t *R 3142 ** @returns uint32_t * 3143 ** 3144 *****************************************************************************/ 3145 3146 uint32_t * 3147 xcb_xv_query_image_attributes_offsets (const xcb_xv_query_image_attributes_reply_t *R /**< */) 3148 { 3149 xcb_generic_iterator_t prev = xcb_xv_query_image_attributes_pitches_end(R); 3150 return (uint32_t *) ((char *) prev.data + XCB_TYPE_PAD(uint32_t, prev.index) + 0); 3151 } 3152 3153 3154 /***************************************************************************** 3155 ** 3156 ** int xcb_xv_query_image_attributes_offsets_length 3157 ** 3158 ** @param const xcb_xv_query_image_attributes_reply_t *R 3159 ** @returns int 3160 ** 3161 *****************************************************************************/ 3162 3163 int 3164 xcb_xv_query_image_attributes_offsets_length (const xcb_xv_query_image_attributes_reply_t *R /**< */) 3165 { 3166 return R->num_planes; 3167 } 3168 3169 3170 /***************************************************************************** 3171 ** 3172 ** xcb_generic_iterator_t xcb_xv_query_image_attributes_offsets_end 3173 ** 3174 ** @param const xcb_xv_query_image_attributes_reply_t *R 3175 ** @returns xcb_generic_iterator_t 3176 ** 3177 *****************************************************************************/ 3178 3179 xcb_generic_iterator_t 3180 xcb_xv_query_image_attributes_offsets_end (const xcb_xv_query_image_attributes_reply_t *R /**< */) 3181 { 3182 xcb_generic_iterator_t i; 3183 xcb_generic_iterator_t child = xcb_xv_query_image_attributes_pitches_end(R); 3184 i.data = ((uint32_t *) child.data) + (R->num_planes); 3185 i.rem = 0; 3186 i.index = (char *) i.data - (char *) R; 3187 return i; 3188 } 3189 3190 3191 /***************************************************************************** 3192 ** 3193 ** xcb_xv_query_image_attributes_reply_t * xcb_xv_query_image_attributes_reply 3194 ** 3195 ** @param xcb_connection_t *c 3196 ** @param xcb_xv_query_image_attributes_cookie_t cookie 3197 ** @param xcb_generic_error_t **e 3198 ** @returns xcb_xv_query_image_attributes_reply_t * 3199 ** 3200 *****************************************************************************/ 3201 3202 xcb_xv_query_image_attributes_reply_t * 3203 xcb_xv_query_image_attributes_reply (xcb_connection_t *c /**< */, 3204 xcb_xv_query_image_attributes_cookie_t cookie /**< */, 3205 xcb_generic_error_t **e /**< */) 3206 { 3207 return (xcb_xv_query_image_attributes_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e); 3208 } 3209 3210 int 3211 xcb_xv_put_image_sizeof (const void *_buffer /**< */, 3212 uint32_t data_len /**< */) 3213 { 3214 char *xcb_tmp = (char *)_buffer; 3215 unsigned int xcb_buffer_len = 0; 3216 unsigned int xcb_block_len = 0; 3217 unsigned int xcb_pad = 0; 3218 unsigned int xcb_align_to = 0; 3219 3220 3221 xcb_block_len += sizeof(xcb_xv_put_image_request_t); 3222 xcb_tmp += xcb_block_len; 3223 xcb_buffer_len += xcb_block_len; 3224 xcb_block_len = 0; 3225 /* data */ 3226 xcb_block_len += data_len * sizeof(uint8_t); 3227 xcb_tmp += xcb_block_len; 3228 xcb_align_to = ALIGNOF(uint8_t); 3229 /* insert padding */ 3230 xcb_pad = -xcb_block_len & (xcb_align_to - 1); 3231 xcb_buffer_len += xcb_block_len + xcb_pad; 3232 if (0 != xcb_pad) { 3233 xcb_tmp += xcb_pad; 3234 xcb_pad = 0; 3235 } 3236 xcb_block_len = 0; 3237 3238 return xcb_buffer_len; 3239 } 3240 3241 3242 /***************************************************************************** 3243 ** 3244 ** xcb_void_cookie_t xcb_xv_put_image_checked 3245 ** 3246 ** @param xcb_connection_t *c 3247 ** @param xcb_xv_port_t port 3248 ** @param xcb_drawable_t drawable 3249 ** @param xcb_gcontext_t gc 3250 ** @param uint32_t id 3251 ** @param int16_t src_x 3252 ** @param int16_t src_y 3253 ** @param uint16_t src_w 3254 ** @param uint16_t src_h 3255 ** @param int16_t drw_x 3256 ** @param int16_t drw_y 3257 ** @param uint16_t drw_w 3258 ** @param uint16_t drw_h 3259 ** @param uint16_t width 3260 ** @param uint16_t height 3261 ** @param uint32_t data_len 3262 ** @param const uint8_t *data 3263 ** @returns xcb_void_cookie_t 3264 ** 3265 *****************************************************************************/ 3266 3267 xcb_void_cookie_t 3268 xcb_xv_put_image_checked (xcb_connection_t *c /**< */, 3269 xcb_xv_port_t port /**< */, 3270 xcb_drawable_t drawable /**< */, 3271 xcb_gcontext_t gc /**< */, 3272 uint32_t id /**< */, 3273 int16_t src_x /**< */, 3274 int16_t src_y /**< */, 3275 uint16_t src_w /**< */, 3276 uint16_t src_h /**< */, 3277 int16_t drw_x /**< */, 3278 int16_t drw_y /**< */, 3279 uint16_t drw_w /**< */, 3280 uint16_t drw_h /**< */, 3281 uint16_t width /**< */, 3282 uint16_t height /**< */, 3283 uint32_t data_len /**< */, 3284 const uint8_t *data /**< */) 3285 { 3286 static const xcb_protocol_request_t xcb_req = { 3287 /* count */ 4, 3288 /* ext */ &xcb_xv_id, 3289 /* opcode */ XCB_XV_PUT_IMAGE, 3290 /* isvoid */ 1 3291 }; 3292 3293 struct iovec xcb_parts[6]; 3294 xcb_void_cookie_t xcb_ret; 3295 xcb_xv_put_image_request_t xcb_out; 3296 3297 xcb_out.port = port; 3298 xcb_out.drawable = drawable; 3299 xcb_out.gc = gc; 3300 xcb_out.id = id; 3301 xcb_out.src_x = src_x; 3302 xcb_out.src_y = src_y; 3303 xcb_out.src_w = src_w; 3304 xcb_out.src_h = src_h; 3305 xcb_out.drw_x = drw_x; 3306 xcb_out.drw_y = drw_y; 3307 xcb_out.drw_w = drw_w; 3308 xcb_out.drw_h = drw_h; 3309 xcb_out.width = width; 3310 xcb_out.height = height; 3311 3312 xcb_parts[2].iov_base = (char *) &xcb_out; 3313 xcb_parts[2].iov_len = sizeof(xcb_out); 3314 xcb_parts[3].iov_base = 0; 3315 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 3316 /* uint8_t data */ 3317 xcb_parts[4].iov_base = (char *) data; 3318 xcb_parts[4].iov_len = data_len * sizeof(uint8_t); 3319 xcb_parts[5].iov_base = 0; 3320 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; 3321 3322 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 3323 return xcb_ret; 3324 } 3325 3326 3327 /***************************************************************************** 3328 ** 3329 ** xcb_void_cookie_t xcb_xv_put_image 3330 ** 3331 ** @param xcb_connection_t *c 3332 ** @param xcb_xv_port_t port 3333 ** @param xcb_drawable_t drawable 3334 ** @param xcb_gcontext_t gc 3335 ** @param uint32_t id 3336 ** @param int16_t src_x 3337 ** @param int16_t src_y 3338 ** @param uint16_t src_w 3339 ** @param uint16_t src_h 3340 ** @param int16_t drw_x 3341 ** @param int16_t drw_y 3342 ** @param uint16_t drw_w 3343 ** @param uint16_t drw_h 3344 ** @param uint16_t width 3345 ** @param uint16_t height 3346 ** @param uint32_t data_len 3347 ** @param const uint8_t *data 3348 ** @returns xcb_void_cookie_t 3349 ** 3350 *****************************************************************************/ 3351 3352 xcb_void_cookie_t 3353 xcb_xv_put_image (xcb_connection_t *c /**< */, 3354 xcb_xv_port_t port /**< */, 3355 xcb_drawable_t drawable /**< */, 3356 xcb_gcontext_t gc /**< */, 3357 uint32_t id /**< */, 3358 int16_t src_x /**< */, 3359 int16_t src_y /**< */, 3360 uint16_t src_w /**< */, 3361 uint16_t src_h /**< */, 3362 int16_t drw_x /**< */, 3363 int16_t drw_y /**< */, 3364 uint16_t drw_w /**< */, 3365 uint16_t drw_h /**< */, 3366 uint16_t width /**< */, 3367 uint16_t height /**< */, 3368 uint32_t data_len /**< */, 3369 const uint8_t *data /**< */) 3370 { 3371 static const xcb_protocol_request_t xcb_req = { 3372 /* count */ 4, 3373 /* ext */ &xcb_xv_id, 3374 /* opcode */ XCB_XV_PUT_IMAGE, 3375 /* isvoid */ 1 3376 }; 3377 3378 struct iovec xcb_parts[6]; 3379 xcb_void_cookie_t xcb_ret; 3380 xcb_xv_put_image_request_t xcb_out; 3381 3382 xcb_out.port = port; 3383 xcb_out.drawable = drawable; 3384 xcb_out.gc = gc; 3385 xcb_out.id = id; 3386 xcb_out.src_x = src_x; 3387 xcb_out.src_y = src_y; 3388 xcb_out.src_w = src_w; 3389 xcb_out.src_h = src_h; 3390 xcb_out.drw_x = drw_x; 3391 xcb_out.drw_y = drw_y; 3392 xcb_out.drw_w = drw_w; 3393 xcb_out.drw_h = drw_h; 3394 xcb_out.width = width; 3395 xcb_out.height = height; 3396 3397 xcb_parts[2].iov_base = (char *) &xcb_out; 3398 xcb_parts[2].iov_len = sizeof(xcb_out); 3399 xcb_parts[3].iov_base = 0; 3400 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 3401 /* uint8_t data */ 3402 xcb_parts[4].iov_base = (char *) data; 3403 xcb_parts[4].iov_len = data_len * sizeof(uint8_t); 3404 xcb_parts[5].iov_base = 0; 3405 xcb_parts[5].iov_len = -xcb_parts[4].iov_len & 3; 3406 3407 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 3408 return xcb_ret; 3409 } 3410 3411 3412 /***************************************************************************** 3413 ** 3414 ** xcb_void_cookie_t xcb_xv_shm_put_image_checked 3415 ** 3416 ** @param xcb_connection_t *c 3417 ** @param xcb_xv_port_t port 3418 ** @param xcb_drawable_t drawable 3419 ** @param xcb_gcontext_t gc 3420 ** @param xcb_shm_seg_t shmseg 3421 ** @param uint32_t id 3422 ** @param uint32_t offset 3423 ** @param int16_t src_x 3424 ** @param int16_t src_y 3425 ** @param uint16_t src_w 3426 ** @param uint16_t src_h 3427 ** @param int16_t drw_x 3428 ** @param int16_t drw_y 3429 ** @param uint16_t drw_w 3430 ** @param uint16_t drw_h 3431 ** @param uint16_t width 3432 ** @param uint16_t height 3433 ** @param uint8_t send_event 3434 ** @returns xcb_void_cookie_t 3435 ** 3436 *****************************************************************************/ 3437 3438 xcb_void_cookie_t 3439 xcb_xv_shm_put_image_checked (xcb_connection_t *c /**< */, 3440 xcb_xv_port_t port /**< */, 3441 xcb_drawable_t drawable /**< */, 3442 xcb_gcontext_t gc /**< */, 3443 xcb_shm_seg_t shmseg /**< */, 3444 uint32_t id /**< */, 3445 uint32_t offset /**< */, 3446 int16_t src_x /**< */, 3447 int16_t src_y /**< */, 3448 uint16_t src_w /**< */, 3449 uint16_t src_h /**< */, 3450 int16_t drw_x /**< */, 3451 int16_t drw_y /**< */, 3452 uint16_t drw_w /**< */, 3453 uint16_t drw_h /**< */, 3454 uint16_t width /**< */, 3455 uint16_t height /**< */, 3456 uint8_t send_event /**< */) 3457 { 3458 static const xcb_protocol_request_t xcb_req = { 3459 /* count */ 2, 3460 /* ext */ &xcb_xv_id, 3461 /* opcode */ XCB_XV_SHM_PUT_IMAGE, 3462 /* isvoid */ 1 3463 }; 3464 3465 struct iovec xcb_parts[4]; 3466 xcb_void_cookie_t xcb_ret; 3467 xcb_xv_shm_put_image_request_t xcb_out; 3468 3469 xcb_out.port = port; 3470 xcb_out.drawable = drawable; 3471 xcb_out.gc = gc; 3472 xcb_out.shmseg = shmseg; 3473 xcb_out.id = id; 3474 xcb_out.offset = offset; 3475 xcb_out.src_x = src_x; 3476 xcb_out.src_y = src_y; 3477 xcb_out.src_w = src_w; 3478 xcb_out.src_h = src_h; 3479 xcb_out.drw_x = drw_x; 3480 xcb_out.drw_y = drw_y; 3481 xcb_out.drw_w = drw_w; 3482 xcb_out.drw_h = drw_h; 3483 xcb_out.width = width; 3484 xcb_out.height = height; 3485 xcb_out.send_event = send_event; 3486 memset(xcb_out.pad0, 0, 3); 3487 3488 xcb_parts[2].iov_base = (char *) &xcb_out; 3489 xcb_parts[2].iov_len = sizeof(xcb_out); 3490 xcb_parts[3].iov_base = 0; 3491 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 3492 3493 xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req); 3494 return xcb_ret; 3495 } 3496 3497 3498 /***************************************************************************** 3499 ** 3500 ** xcb_void_cookie_t xcb_xv_shm_put_image 3501 ** 3502 ** @param xcb_connection_t *c 3503 ** @param xcb_xv_port_t port 3504 ** @param xcb_drawable_t drawable 3505 ** @param xcb_gcontext_t gc 3506 ** @param xcb_shm_seg_t shmseg 3507 ** @param uint32_t id 3508 ** @param uint32_t offset 3509 ** @param int16_t src_x 3510 ** @param int16_t src_y 3511 ** @param uint16_t src_w 3512 ** @param uint16_t src_h 3513 ** @param int16_t drw_x 3514 ** @param int16_t drw_y 3515 ** @param uint16_t drw_w 3516 ** @param uint16_t drw_h 3517 ** @param uint16_t width 3518 ** @param uint16_t height 3519 ** @param uint8_t send_event 3520 ** @returns xcb_void_cookie_t 3521 ** 3522 *****************************************************************************/ 3523 3524 xcb_void_cookie_t 3525 xcb_xv_shm_put_image (xcb_connection_t *c /**< */, 3526 xcb_xv_port_t port /**< */, 3527 xcb_drawable_t drawable /**< */, 3528 xcb_gcontext_t gc /**< */, 3529 xcb_shm_seg_t shmseg /**< */, 3530 uint32_t id /**< */, 3531 uint32_t offset /**< */, 3532 int16_t src_x /**< */, 3533 int16_t src_y /**< */, 3534 uint16_t src_w /**< */, 3535 uint16_t src_h /**< */, 3536 int16_t drw_x /**< */, 3537 int16_t drw_y /**< */, 3538 uint16_t drw_w /**< */, 3539 uint16_t drw_h /**< */, 3540 uint16_t width /**< */, 3541 uint16_t height /**< */, 3542 uint8_t send_event /**< */) 3543 { 3544 static const xcb_protocol_request_t xcb_req = { 3545 /* count */ 2, 3546 /* ext */ &xcb_xv_id, 3547 /* opcode */ XCB_XV_SHM_PUT_IMAGE, 3548 /* isvoid */ 1 3549 }; 3550 3551 struct iovec xcb_parts[4]; 3552 xcb_void_cookie_t xcb_ret; 3553 xcb_xv_shm_put_image_request_t xcb_out; 3554 3555 xcb_out.port = port; 3556 xcb_out.drawable = drawable; 3557 xcb_out.gc = gc; 3558 xcb_out.shmseg = shmseg; 3559 xcb_out.id = id; 3560 xcb_out.offset = offset; 3561 xcb_out.src_x = src_x; 3562 xcb_out.src_y = src_y; 3563 xcb_out.src_w = src_w; 3564 xcb_out.src_h = src_h; 3565 xcb_out.drw_x = drw_x; 3566 xcb_out.drw_y = drw_y; 3567 xcb_out.drw_w = drw_w; 3568 xcb_out.drw_h = drw_h; 3569 xcb_out.width = width; 3570 xcb_out.height = height; 3571 xcb_out.send_event = send_event; 3572 memset(xcb_out.pad0, 0, 3); 3573 3574 xcb_parts[2].iov_base = (char *) &xcb_out; 3575 xcb_parts[2].iov_len = sizeof(xcb_out); 3576 xcb_parts[3].iov_base = 0; 3577 xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3; 3578 3579 xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req); 3580 return xcb_ret; 3581 } 3582 3583