xref: /netbsd-src/external/mit/xorg/lib/libxcb/files/xvmc.c (revision b7b7574d3bf8eeb51a1fa3977b59142ec6434a55)
1 /*
2  * This file generated automatically from xvmc.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 "xvmc.h"
15 
16 #define ALIGNOF(type) offsetof(struct { char dummy; type member; }, member)
17 #include "xproto.h"
18 #include "shm.h"
19 #include "xv.h"
20 
21 xcb_extension_t xcb_xvmc_id = { "XVideo-MotionCompensation", 0 };
22 
23 
24 /*****************************************************************************
25  **
26  ** void xcb_xvmc_context_next
27  **
28  ** @param xcb_xvmc_context_iterator_t *i
29  ** @returns void
30  **
31  *****************************************************************************/
32 
33 void
34 xcb_xvmc_context_next (xcb_xvmc_context_iterator_t *i  /**< */)
35 {
36     --i->rem;
37     ++i->data;
38     i->index += sizeof(xcb_xvmc_context_t);
39 }
40 
41 
42 /*****************************************************************************
43  **
44  ** xcb_generic_iterator_t xcb_xvmc_context_end
45  **
46  ** @param xcb_xvmc_context_iterator_t i
47  ** @returns xcb_generic_iterator_t
48  **
49  *****************************************************************************/
50 
51 xcb_generic_iterator_t
52 xcb_xvmc_context_end (xcb_xvmc_context_iterator_t i  /**< */)
53 {
54     xcb_generic_iterator_t ret;
55     ret.data = i.data + i.rem;
56     ret.index = i.index + ((char *) ret.data - (char *) i.data);
57     ret.rem = 0;
58     return ret;
59 }
60 
61 
62 /*****************************************************************************
63  **
64  ** void xcb_xvmc_surface_next
65  **
66  ** @param xcb_xvmc_surface_iterator_t *i
67  ** @returns void
68  **
69  *****************************************************************************/
70 
71 void
72 xcb_xvmc_surface_next (xcb_xvmc_surface_iterator_t *i  /**< */)
73 {
74     --i->rem;
75     ++i->data;
76     i->index += sizeof(xcb_xvmc_surface_t);
77 }
78 
79 
80 /*****************************************************************************
81  **
82  ** xcb_generic_iterator_t xcb_xvmc_surface_end
83  **
84  ** @param xcb_xvmc_surface_iterator_t i
85  ** @returns xcb_generic_iterator_t
86  **
87  *****************************************************************************/
88 
89 xcb_generic_iterator_t
90 xcb_xvmc_surface_end (xcb_xvmc_surface_iterator_t i  /**< */)
91 {
92     xcb_generic_iterator_t ret;
93     ret.data = i.data + i.rem;
94     ret.index = i.index + ((char *) ret.data - (char *) i.data);
95     ret.rem = 0;
96     return ret;
97 }
98 
99 
100 /*****************************************************************************
101  **
102  ** void xcb_xvmc_subpicture_next
103  **
104  ** @param xcb_xvmc_subpicture_iterator_t *i
105  ** @returns void
106  **
107  *****************************************************************************/
108 
109 void
110 xcb_xvmc_subpicture_next (xcb_xvmc_subpicture_iterator_t *i  /**< */)
111 {
112     --i->rem;
113     ++i->data;
114     i->index += sizeof(xcb_xvmc_subpicture_t);
115 }
116 
117 
118 /*****************************************************************************
119  **
120  ** xcb_generic_iterator_t xcb_xvmc_subpicture_end
121  **
122  ** @param xcb_xvmc_subpicture_iterator_t i
123  ** @returns xcb_generic_iterator_t
124  **
125  *****************************************************************************/
126 
127 xcb_generic_iterator_t
128 xcb_xvmc_subpicture_end (xcb_xvmc_subpicture_iterator_t i  /**< */)
129 {
130     xcb_generic_iterator_t ret;
131     ret.data = i.data + i.rem;
132     ret.index = i.index + ((char *) ret.data - (char *) i.data);
133     ret.rem = 0;
134     return ret;
135 }
136 
137 
138 /*****************************************************************************
139  **
140  ** void xcb_xvmc_surface_info_next
141  **
142  ** @param xcb_xvmc_surface_info_iterator_t *i
143  ** @returns void
144  **
145  *****************************************************************************/
146 
147 void
148 xcb_xvmc_surface_info_next (xcb_xvmc_surface_info_iterator_t *i  /**< */)
149 {
150     --i->rem;
151     ++i->data;
152     i->index += sizeof(xcb_xvmc_surface_info_t);
153 }
154 
155 
156 /*****************************************************************************
157  **
158  ** xcb_generic_iterator_t xcb_xvmc_surface_info_end
159  **
160  ** @param xcb_xvmc_surface_info_iterator_t i
161  ** @returns xcb_generic_iterator_t
162  **
163  *****************************************************************************/
164 
165 xcb_generic_iterator_t
166 xcb_xvmc_surface_info_end (xcb_xvmc_surface_info_iterator_t i  /**< */)
167 {
168     xcb_generic_iterator_t ret;
169     ret.data = i.data + i.rem;
170     ret.index = i.index + ((char *) ret.data - (char *) i.data);
171     ret.rem = 0;
172     return ret;
173 }
174 
175 
176 /*****************************************************************************
177  **
178  ** xcb_xvmc_query_version_cookie_t xcb_xvmc_query_version
179  **
180  ** @param xcb_connection_t *c
181  ** @returns xcb_xvmc_query_version_cookie_t
182  **
183  *****************************************************************************/
184 
185 xcb_xvmc_query_version_cookie_t
186 xcb_xvmc_query_version (xcb_connection_t *c  /**< */)
187 {
188     static const xcb_protocol_request_t xcb_req = {
189         /* count */ 2,
190         /* ext */ &xcb_xvmc_id,
191         /* opcode */ XCB_XVMC_QUERY_VERSION,
192         /* isvoid */ 0
193     };
194 
195     struct iovec xcb_parts[4];
196     xcb_xvmc_query_version_cookie_t xcb_ret;
197     xcb_xvmc_query_version_request_t xcb_out;
198 
199 
200     xcb_parts[2].iov_base = (char *) &xcb_out;
201     xcb_parts[2].iov_len = sizeof(xcb_out);
202     xcb_parts[3].iov_base = 0;
203     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
204 
205     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
206     return xcb_ret;
207 }
208 
209 
210 /*****************************************************************************
211  **
212  ** xcb_xvmc_query_version_cookie_t xcb_xvmc_query_version_unchecked
213  **
214  ** @param xcb_connection_t *c
215  ** @returns xcb_xvmc_query_version_cookie_t
216  **
217  *****************************************************************************/
218 
219 xcb_xvmc_query_version_cookie_t
220 xcb_xvmc_query_version_unchecked (xcb_connection_t *c  /**< */)
221 {
222     static const xcb_protocol_request_t xcb_req = {
223         /* count */ 2,
224         /* ext */ &xcb_xvmc_id,
225         /* opcode */ XCB_XVMC_QUERY_VERSION,
226         /* isvoid */ 0
227     };
228 
229     struct iovec xcb_parts[4];
230     xcb_xvmc_query_version_cookie_t xcb_ret;
231     xcb_xvmc_query_version_request_t xcb_out;
232 
233 
234     xcb_parts[2].iov_base = (char *) &xcb_out;
235     xcb_parts[2].iov_len = sizeof(xcb_out);
236     xcb_parts[3].iov_base = 0;
237     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
238 
239     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
240     return xcb_ret;
241 }
242 
243 
244 /*****************************************************************************
245  **
246  ** xcb_xvmc_query_version_reply_t * xcb_xvmc_query_version_reply
247  **
248  ** @param xcb_connection_t                 *c
249  ** @param xcb_xvmc_query_version_cookie_t   cookie
250  ** @param xcb_generic_error_t             **e
251  ** @returns xcb_xvmc_query_version_reply_t *
252  **
253  *****************************************************************************/
254 
255 xcb_xvmc_query_version_reply_t *
256 xcb_xvmc_query_version_reply (xcb_connection_t                 *c  /**< */,
257                               xcb_xvmc_query_version_cookie_t   cookie  /**< */,
258                               xcb_generic_error_t             **e  /**< */)
259 {
260     return (xcb_xvmc_query_version_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
261 }
262 
263 int
264 xcb_xvmc_list_surface_types_sizeof (const void  *_buffer  /**< */)
265 {
266     char *xcb_tmp = (char *)_buffer;
267     const xcb_xvmc_list_surface_types_reply_t *_aux = (xcb_xvmc_list_surface_types_reply_t *)_buffer;
268     unsigned int xcb_buffer_len = 0;
269     unsigned int xcb_block_len = 0;
270     unsigned int xcb_pad = 0;
271     unsigned int xcb_align_to = 0;
272 
273 
274     xcb_block_len += sizeof(xcb_xvmc_list_surface_types_reply_t);
275     xcb_tmp += xcb_block_len;
276     xcb_buffer_len += xcb_block_len;
277     xcb_block_len = 0;
278     /* surfaces */
279     xcb_block_len += _aux->num * sizeof(xcb_xvmc_surface_info_t);
280     xcb_tmp += xcb_block_len;
281     xcb_align_to = ALIGNOF(xcb_xvmc_surface_info_t);
282     /* insert padding */
283     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
284     xcb_buffer_len += xcb_block_len + xcb_pad;
285     if (0 != xcb_pad) {
286         xcb_tmp += xcb_pad;
287         xcb_pad = 0;
288     }
289     xcb_block_len = 0;
290 
291     return xcb_buffer_len;
292 }
293 
294 
295 /*****************************************************************************
296  **
297  ** xcb_xvmc_list_surface_types_cookie_t xcb_xvmc_list_surface_types
298  **
299  ** @param xcb_connection_t *c
300  ** @param xcb_xv_port_t     port_id
301  ** @returns xcb_xvmc_list_surface_types_cookie_t
302  **
303  *****************************************************************************/
304 
305 xcb_xvmc_list_surface_types_cookie_t
306 xcb_xvmc_list_surface_types (xcb_connection_t *c  /**< */,
307                              xcb_xv_port_t     port_id  /**< */)
308 {
309     static const xcb_protocol_request_t xcb_req = {
310         /* count */ 2,
311         /* ext */ &xcb_xvmc_id,
312         /* opcode */ XCB_XVMC_LIST_SURFACE_TYPES,
313         /* isvoid */ 0
314     };
315 
316     struct iovec xcb_parts[4];
317     xcb_xvmc_list_surface_types_cookie_t xcb_ret;
318     xcb_xvmc_list_surface_types_request_t xcb_out;
319 
320     xcb_out.port_id = port_id;
321 
322     xcb_parts[2].iov_base = (char *) &xcb_out;
323     xcb_parts[2].iov_len = sizeof(xcb_out);
324     xcb_parts[3].iov_base = 0;
325     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
326 
327     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
328     return xcb_ret;
329 }
330 
331 
332 /*****************************************************************************
333  **
334  ** xcb_xvmc_list_surface_types_cookie_t xcb_xvmc_list_surface_types_unchecked
335  **
336  ** @param xcb_connection_t *c
337  ** @param xcb_xv_port_t     port_id
338  ** @returns xcb_xvmc_list_surface_types_cookie_t
339  **
340  *****************************************************************************/
341 
342 xcb_xvmc_list_surface_types_cookie_t
343 xcb_xvmc_list_surface_types_unchecked (xcb_connection_t *c  /**< */,
344                                        xcb_xv_port_t     port_id  /**< */)
345 {
346     static const xcb_protocol_request_t xcb_req = {
347         /* count */ 2,
348         /* ext */ &xcb_xvmc_id,
349         /* opcode */ XCB_XVMC_LIST_SURFACE_TYPES,
350         /* isvoid */ 0
351     };
352 
353     struct iovec xcb_parts[4];
354     xcb_xvmc_list_surface_types_cookie_t xcb_ret;
355     xcb_xvmc_list_surface_types_request_t xcb_out;
356 
357     xcb_out.port_id = port_id;
358 
359     xcb_parts[2].iov_base = (char *) &xcb_out;
360     xcb_parts[2].iov_len = sizeof(xcb_out);
361     xcb_parts[3].iov_base = 0;
362     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
363 
364     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
365     return xcb_ret;
366 }
367 
368 
369 /*****************************************************************************
370  **
371  ** xcb_xvmc_surface_info_t * xcb_xvmc_list_surface_types_surfaces
372  **
373  ** @param const xcb_xvmc_list_surface_types_reply_t *R
374  ** @returns xcb_xvmc_surface_info_t *
375  **
376  *****************************************************************************/
377 
378 xcb_xvmc_surface_info_t *
379 xcb_xvmc_list_surface_types_surfaces (const xcb_xvmc_list_surface_types_reply_t *R  /**< */)
380 {
381     return (xcb_xvmc_surface_info_t *) (R + 1);
382 }
383 
384 
385 /*****************************************************************************
386  **
387  ** int xcb_xvmc_list_surface_types_surfaces_length
388  **
389  ** @param const xcb_xvmc_list_surface_types_reply_t *R
390  ** @returns int
391  **
392  *****************************************************************************/
393 
394 int
395 xcb_xvmc_list_surface_types_surfaces_length (const xcb_xvmc_list_surface_types_reply_t *R  /**< */)
396 {
397     return R->num;
398 }
399 
400 
401 /*****************************************************************************
402  **
403  ** xcb_xvmc_surface_info_iterator_t xcb_xvmc_list_surface_types_surfaces_iterator
404  **
405  ** @param const xcb_xvmc_list_surface_types_reply_t *R
406  ** @returns xcb_xvmc_surface_info_iterator_t
407  **
408  *****************************************************************************/
409 
410 xcb_xvmc_surface_info_iterator_t
411 xcb_xvmc_list_surface_types_surfaces_iterator (const xcb_xvmc_list_surface_types_reply_t *R  /**< */)
412 {
413     xcb_xvmc_surface_info_iterator_t i;
414     i.data = (xcb_xvmc_surface_info_t *) (R + 1);
415     i.rem = R->num;
416     i.index = (char *) i.data - (char *) R;
417     return i;
418 }
419 
420 
421 /*****************************************************************************
422  **
423  ** xcb_xvmc_list_surface_types_reply_t * xcb_xvmc_list_surface_types_reply
424  **
425  ** @param xcb_connection_t                      *c
426  ** @param xcb_xvmc_list_surface_types_cookie_t   cookie
427  ** @param xcb_generic_error_t                  **e
428  ** @returns xcb_xvmc_list_surface_types_reply_t *
429  **
430  *****************************************************************************/
431 
432 xcb_xvmc_list_surface_types_reply_t *
433 xcb_xvmc_list_surface_types_reply (xcb_connection_t                      *c  /**< */,
434                                    xcb_xvmc_list_surface_types_cookie_t   cookie  /**< */,
435                                    xcb_generic_error_t                  **e  /**< */)
436 {
437     return (xcb_xvmc_list_surface_types_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
438 }
439 
440 int
441 xcb_xvmc_create_context_sizeof (const void  *_buffer  /**< */)
442 {
443     char *xcb_tmp = (char *)_buffer;
444     const xcb_xvmc_create_context_reply_t *_aux = (xcb_xvmc_create_context_reply_t *)_buffer;
445     unsigned int xcb_buffer_len = 0;
446     unsigned int xcb_block_len = 0;
447     unsigned int xcb_pad = 0;
448     unsigned int xcb_align_to = 0;
449 
450 
451     xcb_block_len += sizeof(xcb_xvmc_create_context_reply_t);
452     xcb_tmp += xcb_block_len;
453     xcb_buffer_len += xcb_block_len;
454     xcb_block_len = 0;
455     /* priv_data */
456     xcb_block_len += _aux->length * sizeof(uint32_t);
457     xcb_tmp += xcb_block_len;
458     xcb_align_to = ALIGNOF(uint32_t);
459     /* insert padding */
460     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
461     xcb_buffer_len += xcb_block_len + xcb_pad;
462     if (0 != xcb_pad) {
463         xcb_tmp += xcb_pad;
464         xcb_pad = 0;
465     }
466     xcb_block_len = 0;
467 
468     return xcb_buffer_len;
469 }
470 
471 
472 /*****************************************************************************
473  **
474  ** xcb_xvmc_create_context_cookie_t xcb_xvmc_create_context
475  **
476  ** @param xcb_connection_t   *c
477  ** @param xcb_xvmc_context_t  context_id
478  ** @param xcb_xv_port_t       port_id
479  ** @param xcb_xvmc_surface_t  surface_id
480  ** @param uint16_t            width
481  ** @param uint16_t            height
482  ** @param uint32_t            flags
483  ** @returns xcb_xvmc_create_context_cookie_t
484  **
485  *****************************************************************************/
486 
487 xcb_xvmc_create_context_cookie_t
488 xcb_xvmc_create_context (xcb_connection_t   *c  /**< */,
489                          xcb_xvmc_context_t  context_id  /**< */,
490                          xcb_xv_port_t       port_id  /**< */,
491                          xcb_xvmc_surface_t  surface_id  /**< */,
492                          uint16_t            width  /**< */,
493                          uint16_t            height  /**< */,
494                          uint32_t            flags  /**< */)
495 {
496     static const xcb_protocol_request_t xcb_req = {
497         /* count */ 2,
498         /* ext */ &xcb_xvmc_id,
499         /* opcode */ XCB_XVMC_CREATE_CONTEXT,
500         /* isvoid */ 0
501     };
502 
503     struct iovec xcb_parts[4];
504     xcb_xvmc_create_context_cookie_t xcb_ret;
505     xcb_xvmc_create_context_request_t xcb_out;
506 
507     xcb_out.context_id = context_id;
508     xcb_out.port_id = port_id;
509     xcb_out.surface_id = surface_id;
510     xcb_out.width = width;
511     xcb_out.height = height;
512     xcb_out.flags = flags;
513 
514     xcb_parts[2].iov_base = (char *) &xcb_out;
515     xcb_parts[2].iov_len = sizeof(xcb_out);
516     xcb_parts[3].iov_base = 0;
517     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
518 
519     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
520     return xcb_ret;
521 }
522 
523 
524 /*****************************************************************************
525  **
526  ** xcb_xvmc_create_context_cookie_t xcb_xvmc_create_context_unchecked
527  **
528  ** @param xcb_connection_t   *c
529  ** @param xcb_xvmc_context_t  context_id
530  ** @param xcb_xv_port_t       port_id
531  ** @param xcb_xvmc_surface_t  surface_id
532  ** @param uint16_t            width
533  ** @param uint16_t            height
534  ** @param uint32_t            flags
535  ** @returns xcb_xvmc_create_context_cookie_t
536  **
537  *****************************************************************************/
538 
539 xcb_xvmc_create_context_cookie_t
540 xcb_xvmc_create_context_unchecked (xcb_connection_t   *c  /**< */,
541                                    xcb_xvmc_context_t  context_id  /**< */,
542                                    xcb_xv_port_t       port_id  /**< */,
543                                    xcb_xvmc_surface_t  surface_id  /**< */,
544                                    uint16_t            width  /**< */,
545                                    uint16_t            height  /**< */,
546                                    uint32_t            flags  /**< */)
547 {
548     static const xcb_protocol_request_t xcb_req = {
549         /* count */ 2,
550         /* ext */ &xcb_xvmc_id,
551         /* opcode */ XCB_XVMC_CREATE_CONTEXT,
552         /* isvoid */ 0
553     };
554 
555     struct iovec xcb_parts[4];
556     xcb_xvmc_create_context_cookie_t xcb_ret;
557     xcb_xvmc_create_context_request_t xcb_out;
558 
559     xcb_out.context_id = context_id;
560     xcb_out.port_id = port_id;
561     xcb_out.surface_id = surface_id;
562     xcb_out.width = width;
563     xcb_out.height = height;
564     xcb_out.flags = flags;
565 
566     xcb_parts[2].iov_base = (char *) &xcb_out;
567     xcb_parts[2].iov_len = sizeof(xcb_out);
568     xcb_parts[3].iov_base = 0;
569     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
570 
571     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
572     return xcb_ret;
573 }
574 
575 
576 /*****************************************************************************
577  **
578  ** uint32_t * xcb_xvmc_create_context_priv_data
579  **
580  ** @param const xcb_xvmc_create_context_reply_t *R
581  ** @returns uint32_t *
582  **
583  *****************************************************************************/
584 
585 uint32_t *
586 xcb_xvmc_create_context_priv_data (const xcb_xvmc_create_context_reply_t *R  /**< */)
587 {
588     return (uint32_t *) (R + 1);
589 }
590 
591 
592 /*****************************************************************************
593  **
594  ** int xcb_xvmc_create_context_priv_data_length
595  **
596  ** @param const xcb_xvmc_create_context_reply_t *R
597  ** @returns int
598  **
599  *****************************************************************************/
600 
601 int
602 xcb_xvmc_create_context_priv_data_length (const xcb_xvmc_create_context_reply_t *R  /**< */)
603 {
604     return R->length;
605 }
606 
607 
608 /*****************************************************************************
609  **
610  ** xcb_generic_iterator_t xcb_xvmc_create_context_priv_data_end
611  **
612  ** @param const xcb_xvmc_create_context_reply_t *R
613  ** @returns xcb_generic_iterator_t
614  **
615  *****************************************************************************/
616 
617 xcb_generic_iterator_t
618 xcb_xvmc_create_context_priv_data_end (const xcb_xvmc_create_context_reply_t *R  /**< */)
619 {
620     xcb_generic_iterator_t i;
621     i.data = ((uint32_t *) (R + 1)) + (R->length);
622     i.rem = 0;
623     i.index = (char *) i.data - (char *) R;
624     return i;
625 }
626 
627 
628 /*****************************************************************************
629  **
630  ** xcb_xvmc_create_context_reply_t * xcb_xvmc_create_context_reply
631  **
632  ** @param xcb_connection_t                  *c
633  ** @param xcb_xvmc_create_context_cookie_t   cookie
634  ** @param xcb_generic_error_t              **e
635  ** @returns xcb_xvmc_create_context_reply_t *
636  **
637  *****************************************************************************/
638 
639 xcb_xvmc_create_context_reply_t *
640 xcb_xvmc_create_context_reply (xcb_connection_t                  *c  /**< */,
641                                xcb_xvmc_create_context_cookie_t   cookie  /**< */,
642                                xcb_generic_error_t              **e  /**< */)
643 {
644     return (xcb_xvmc_create_context_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
645 }
646 
647 
648 /*****************************************************************************
649  **
650  ** xcb_void_cookie_t xcb_xvmc_destroy_context_checked
651  **
652  ** @param xcb_connection_t   *c
653  ** @param xcb_xvmc_context_t  context_id
654  ** @returns xcb_void_cookie_t
655  **
656  *****************************************************************************/
657 
658 xcb_void_cookie_t
659 xcb_xvmc_destroy_context_checked (xcb_connection_t   *c  /**< */,
660                                   xcb_xvmc_context_t  context_id  /**< */)
661 {
662     static const xcb_protocol_request_t xcb_req = {
663         /* count */ 2,
664         /* ext */ &xcb_xvmc_id,
665         /* opcode */ XCB_XVMC_DESTROY_CONTEXT,
666         /* isvoid */ 1
667     };
668 
669     struct iovec xcb_parts[4];
670     xcb_void_cookie_t xcb_ret;
671     xcb_xvmc_destroy_context_request_t xcb_out;
672 
673     xcb_out.context_id = context_id;
674 
675     xcb_parts[2].iov_base = (char *) &xcb_out;
676     xcb_parts[2].iov_len = sizeof(xcb_out);
677     xcb_parts[3].iov_base = 0;
678     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
679 
680     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
681     return xcb_ret;
682 }
683 
684 
685 /*****************************************************************************
686  **
687  ** xcb_void_cookie_t xcb_xvmc_destroy_context
688  **
689  ** @param xcb_connection_t   *c
690  ** @param xcb_xvmc_context_t  context_id
691  ** @returns xcb_void_cookie_t
692  **
693  *****************************************************************************/
694 
695 xcb_void_cookie_t
696 xcb_xvmc_destroy_context (xcb_connection_t   *c  /**< */,
697                           xcb_xvmc_context_t  context_id  /**< */)
698 {
699     static const xcb_protocol_request_t xcb_req = {
700         /* count */ 2,
701         /* ext */ &xcb_xvmc_id,
702         /* opcode */ XCB_XVMC_DESTROY_CONTEXT,
703         /* isvoid */ 1
704     };
705 
706     struct iovec xcb_parts[4];
707     xcb_void_cookie_t xcb_ret;
708     xcb_xvmc_destroy_context_request_t xcb_out;
709 
710     xcb_out.context_id = context_id;
711 
712     xcb_parts[2].iov_base = (char *) &xcb_out;
713     xcb_parts[2].iov_len = sizeof(xcb_out);
714     xcb_parts[3].iov_base = 0;
715     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
716 
717     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
718     return xcb_ret;
719 }
720 
721 int
722 xcb_xvmc_create_surface_sizeof (const void  *_buffer  /**< */)
723 {
724     char *xcb_tmp = (char *)_buffer;
725     const xcb_xvmc_create_surface_reply_t *_aux = (xcb_xvmc_create_surface_reply_t *)_buffer;
726     unsigned int xcb_buffer_len = 0;
727     unsigned int xcb_block_len = 0;
728     unsigned int xcb_pad = 0;
729     unsigned int xcb_align_to = 0;
730 
731 
732     xcb_block_len += sizeof(xcb_xvmc_create_surface_reply_t);
733     xcb_tmp += xcb_block_len;
734     xcb_buffer_len += xcb_block_len;
735     xcb_block_len = 0;
736     /* priv_data */
737     xcb_block_len += _aux->length * sizeof(uint32_t);
738     xcb_tmp += xcb_block_len;
739     xcb_align_to = ALIGNOF(uint32_t);
740     /* insert padding */
741     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
742     xcb_buffer_len += xcb_block_len + xcb_pad;
743     if (0 != xcb_pad) {
744         xcb_tmp += xcb_pad;
745         xcb_pad = 0;
746     }
747     xcb_block_len = 0;
748 
749     return xcb_buffer_len;
750 }
751 
752 
753 /*****************************************************************************
754  **
755  ** xcb_xvmc_create_surface_cookie_t xcb_xvmc_create_surface
756  **
757  ** @param xcb_connection_t   *c
758  ** @param xcb_xvmc_surface_t  surface_id
759  ** @param xcb_xvmc_context_t  context_id
760  ** @returns xcb_xvmc_create_surface_cookie_t
761  **
762  *****************************************************************************/
763 
764 xcb_xvmc_create_surface_cookie_t
765 xcb_xvmc_create_surface (xcb_connection_t   *c  /**< */,
766                          xcb_xvmc_surface_t  surface_id  /**< */,
767                          xcb_xvmc_context_t  context_id  /**< */)
768 {
769     static const xcb_protocol_request_t xcb_req = {
770         /* count */ 2,
771         /* ext */ &xcb_xvmc_id,
772         /* opcode */ XCB_XVMC_CREATE_SURFACE,
773         /* isvoid */ 0
774     };
775 
776     struct iovec xcb_parts[4];
777     xcb_xvmc_create_surface_cookie_t xcb_ret;
778     xcb_xvmc_create_surface_request_t xcb_out;
779 
780     xcb_out.surface_id = surface_id;
781     xcb_out.context_id = context_id;
782 
783     xcb_parts[2].iov_base = (char *) &xcb_out;
784     xcb_parts[2].iov_len = sizeof(xcb_out);
785     xcb_parts[3].iov_base = 0;
786     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
787 
788     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
789     return xcb_ret;
790 }
791 
792 
793 /*****************************************************************************
794  **
795  ** xcb_xvmc_create_surface_cookie_t xcb_xvmc_create_surface_unchecked
796  **
797  ** @param xcb_connection_t   *c
798  ** @param xcb_xvmc_surface_t  surface_id
799  ** @param xcb_xvmc_context_t  context_id
800  ** @returns xcb_xvmc_create_surface_cookie_t
801  **
802  *****************************************************************************/
803 
804 xcb_xvmc_create_surface_cookie_t
805 xcb_xvmc_create_surface_unchecked (xcb_connection_t   *c  /**< */,
806                                    xcb_xvmc_surface_t  surface_id  /**< */,
807                                    xcb_xvmc_context_t  context_id  /**< */)
808 {
809     static const xcb_protocol_request_t xcb_req = {
810         /* count */ 2,
811         /* ext */ &xcb_xvmc_id,
812         /* opcode */ XCB_XVMC_CREATE_SURFACE,
813         /* isvoid */ 0
814     };
815 
816     struct iovec xcb_parts[4];
817     xcb_xvmc_create_surface_cookie_t xcb_ret;
818     xcb_xvmc_create_surface_request_t xcb_out;
819 
820     xcb_out.surface_id = surface_id;
821     xcb_out.context_id = context_id;
822 
823     xcb_parts[2].iov_base = (char *) &xcb_out;
824     xcb_parts[2].iov_len = sizeof(xcb_out);
825     xcb_parts[3].iov_base = 0;
826     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
827 
828     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
829     return xcb_ret;
830 }
831 
832 
833 /*****************************************************************************
834  **
835  ** uint32_t * xcb_xvmc_create_surface_priv_data
836  **
837  ** @param const xcb_xvmc_create_surface_reply_t *R
838  ** @returns uint32_t *
839  **
840  *****************************************************************************/
841 
842 uint32_t *
843 xcb_xvmc_create_surface_priv_data (const xcb_xvmc_create_surface_reply_t *R  /**< */)
844 {
845     return (uint32_t *) (R + 1);
846 }
847 
848 
849 /*****************************************************************************
850  **
851  ** int xcb_xvmc_create_surface_priv_data_length
852  **
853  ** @param const xcb_xvmc_create_surface_reply_t *R
854  ** @returns int
855  **
856  *****************************************************************************/
857 
858 int
859 xcb_xvmc_create_surface_priv_data_length (const xcb_xvmc_create_surface_reply_t *R  /**< */)
860 {
861     return R->length;
862 }
863 
864 
865 /*****************************************************************************
866  **
867  ** xcb_generic_iterator_t xcb_xvmc_create_surface_priv_data_end
868  **
869  ** @param const xcb_xvmc_create_surface_reply_t *R
870  ** @returns xcb_generic_iterator_t
871  **
872  *****************************************************************************/
873 
874 xcb_generic_iterator_t
875 xcb_xvmc_create_surface_priv_data_end (const xcb_xvmc_create_surface_reply_t *R  /**< */)
876 {
877     xcb_generic_iterator_t i;
878     i.data = ((uint32_t *) (R + 1)) + (R->length);
879     i.rem = 0;
880     i.index = (char *) i.data - (char *) R;
881     return i;
882 }
883 
884 
885 /*****************************************************************************
886  **
887  ** xcb_xvmc_create_surface_reply_t * xcb_xvmc_create_surface_reply
888  **
889  ** @param xcb_connection_t                  *c
890  ** @param xcb_xvmc_create_surface_cookie_t   cookie
891  ** @param xcb_generic_error_t              **e
892  ** @returns xcb_xvmc_create_surface_reply_t *
893  **
894  *****************************************************************************/
895 
896 xcb_xvmc_create_surface_reply_t *
897 xcb_xvmc_create_surface_reply (xcb_connection_t                  *c  /**< */,
898                                xcb_xvmc_create_surface_cookie_t   cookie  /**< */,
899                                xcb_generic_error_t              **e  /**< */)
900 {
901     return (xcb_xvmc_create_surface_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
902 }
903 
904 
905 /*****************************************************************************
906  **
907  ** xcb_void_cookie_t xcb_xvmc_destroy_surface_checked
908  **
909  ** @param xcb_connection_t   *c
910  ** @param xcb_xvmc_surface_t  surface_id
911  ** @returns xcb_void_cookie_t
912  **
913  *****************************************************************************/
914 
915 xcb_void_cookie_t
916 xcb_xvmc_destroy_surface_checked (xcb_connection_t   *c  /**< */,
917                                   xcb_xvmc_surface_t  surface_id  /**< */)
918 {
919     static const xcb_protocol_request_t xcb_req = {
920         /* count */ 2,
921         /* ext */ &xcb_xvmc_id,
922         /* opcode */ XCB_XVMC_DESTROY_SURFACE,
923         /* isvoid */ 1
924     };
925 
926     struct iovec xcb_parts[4];
927     xcb_void_cookie_t xcb_ret;
928     xcb_xvmc_destroy_surface_request_t xcb_out;
929 
930     xcb_out.surface_id = surface_id;
931 
932     xcb_parts[2].iov_base = (char *) &xcb_out;
933     xcb_parts[2].iov_len = sizeof(xcb_out);
934     xcb_parts[3].iov_base = 0;
935     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
936 
937     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
938     return xcb_ret;
939 }
940 
941 
942 /*****************************************************************************
943  **
944  ** xcb_void_cookie_t xcb_xvmc_destroy_surface
945  **
946  ** @param xcb_connection_t   *c
947  ** @param xcb_xvmc_surface_t  surface_id
948  ** @returns xcb_void_cookie_t
949  **
950  *****************************************************************************/
951 
952 xcb_void_cookie_t
953 xcb_xvmc_destroy_surface (xcb_connection_t   *c  /**< */,
954                           xcb_xvmc_surface_t  surface_id  /**< */)
955 {
956     static const xcb_protocol_request_t xcb_req = {
957         /* count */ 2,
958         /* ext */ &xcb_xvmc_id,
959         /* opcode */ XCB_XVMC_DESTROY_SURFACE,
960         /* isvoid */ 1
961     };
962 
963     struct iovec xcb_parts[4];
964     xcb_void_cookie_t xcb_ret;
965     xcb_xvmc_destroy_surface_request_t xcb_out;
966 
967     xcb_out.surface_id = surface_id;
968 
969     xcb_parts[2].iov_base = (char *) &xcb_out;
970     xcb_parts[2].iov_len = sizeof(xcb_out);
971     xcb_parts[3].iov_base = 0;
972     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
973 
974     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
975     return xcb_ret;
976 }
977 
978 int
979 xcb_xvmc_create_subpicture_sizeof (const void  *_buffer  /**< */)
980 {
981     char *xcb_tmp = (char *)_buffer;
982     const xcb_xvmc_create_subpicture_reply_t *_aux = (xcb_xvmc_create_subpicture_reply_t *)_buffer;
983     unsigned int xcb_buffer_len = 0;
984     unsigned int xcb_block_len = 0;
985     unsigned int xcb_pad = 0;
986     unsigned int xcb_align_to = 0;
987 
988 
989     xcb_block_len += sizeof(xcb_xvmc_create_subpicture_reply_t);
990     xcb_tmp += xcb_block_len;
991     xcb_buffer_len += xcb_block_len;
992     xcb_block_len = 0;
993     /* priv_data */
994     xcb_block_len += _aux->length * sizeof(uint32_t);
995     xcb_tmp += xcb_block_len;
996     xcb_align_to = ALIGNOF(uint32_t);
997     /* insert padding */
998     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
999     xcb_buffer_len += xcb_block_len + xcb_pad;
1000     if (0 != xcb_pad) {
1001         xcb_tmp += xcb_pad;
1002         xcb_pad = 0;
1003     }
1004     xcb_block_len = 0;
1005 
1006     return xcb_buffer_len;
1007 }
1008 
1009 
1010 /*****************************************************************************
1011  **
1012  ** xcb_xvmc_create_subpicture_cookie_t xcb_xvmc_create_subpicture
1013  **
1014  ** @param xcb_connection_t      *c
1015  ** @param xcb_xvmc_subpicture_t  subpicture_id
1016  ** @param xcb_xvmc_context_t     context
1017  ** @param uint32_t               xvimage_id
1018  ** @param uint16_t               width
1019  ** @param uint16_t               height
1020  ** @returns xcb_xvmc_create_subpicture_cookie_t
1021  **
1022  *****************************************************************************/
1023 
1024 xcb_xvmc_create_subpicture_cookie_t
1025 xcb_xvmc_create_subpicture (xcb_connection_t      *c  /**< */,
1026                             xcb_xvmc_subpicture_t  subpicture_id  /**< */,
1027                             xcb_xvmc_context_t     context  /**< */,
1028                             uint32_t               xvimage_id  /**< */,
1029                             uint16_t               width  /**< */,
1030                             uint16_t               height  /**< */)
1031 {
1032     static const xcb_protocol_request_t xcb_req = {
1033         /* count */ 2,
1034         /* ext */ &xcb_xvmc_id,
1035         /* opcode */ XCB_XVMC_CREATE_SUBPICTURE,
1036         /* isvoid */ 0
1037     };
1038 
1039     struct iovec xcb_parts[4];
1040     xcb_xvmc_create_subpicture_cookie_t xcb_ret;
1041     xcb_xvmc_create_subpicture_request_t xcb_out;
1042 
1043     xcb_out.subpicture_id = subpicture_id;
1044     xcb_out.context = context;
1045     xcb_out.xvimage_id = xvimage_id;
1046     xcb_out.width = width;
1047     xcb_out.height = height;
1048 
1049     xcb_parts[2].iov_base = (char *) &xcb_out;
1050     xcb_parts[2].iov_len = sizeof(xcb_out);
1051     xcb_parts[3].iov_base = 0;
1052     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1053 
1054     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1055     return xcb_ret;
1056 }
1057 
1058 
1059 /*****************************************************************************
1060  **
1061  ** xcb_xvmc_create_subpicture_cookie_t xcb_xvmc_create_subpicture_unchecked
1062  **
1063  ** @param xcb_connection_t      *c
1064  ** @param xcb_xvmc_subpicture_t  subpicture_id
1065  ** @param xcb_xvmc_context_t     context
1066  ** @param uint32_t               xvimage_id
1067  ** @param uint16_t               width
1068  ** @param uint16_t               height
1069  ** @returns xcb_xvmc_create_subpicture_cookie_t
1070  **
1071  *****************************************************************************/
1072 
1073 xcb_xvmc_create_subpicture_cookie_t
1074 xcb_xvmc_create_subpicture_unchecked (xcb_connection_t      *c  /**< */,
1075                                       xcb_xvmc_subpicture_t  subpicture_id  /**< */,
1076                                       xcb_xvmc_context_t     context  /**< */,
1077                                       uint32_t               xvimage_id  /**< */,
1078                                       uint16_t               width  /**< */,
1079                                       uint16_t               height  /**< */)
1080 {
1081     static const xcb_protocol_request_t xcb_req = {
1082         /* count */ 2,
1083         /* ext */ &xcb_xvmc_id,
1084         /* opcode */ XCB_XVMC_CREATE_SUBPICTURE,
1085         /* isvoid */ 0
1086     };
1087 
1088     struct iovec xcb_parts[4];
1089     xcb_xvmc_create_subpicture_cookie_t xcb_ret;
1090     xcb_xvmc_create_subpicture_request_t xcb_out;
1091 
1092     xcb_out.subpicture_id = subpicture_id;
1093     xcb_out.context = context;
1094     xcb_out.xvimage_id = xvimage_id;
1095     xcb_out.width = width;
1096     xcb_out.height = height;
1097 
1098     xcb_parts[2].iov_base = (char *) &xcb_out;
1099     xcb_parts[2].iov_len = sizeof(xcb_out);
1100     xcb_parts[3].iov_base = 0;
1101     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1102 
1103     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1104     return xcb_ret;
1105 }
1106 
1107 
1108 /*****************************************************************************
1109  **
1110  ** uint32_t * xcb_xvmc_create_subpicture_priv_data
1111  **
1112  ** @param const xcb_xvmc_create_subpicture_reply_t *R
1113  ** @returns uint32_t *
1114  **
1115  *****************************************************************************/
1116 
1117 uint32_t *
1118 xcb_xvmc_create_subpicture_priv_data (const xcb_xvmc_create_subpicture_reply_t *R  /**< */)
1119 {
1120     return (uint32_t *) (R + 1);
1121 }
1122 
1123 
1124 /*****************************************************************************
1125  **
1126  ** int xcb_xvmc_create_subpicture_priv_data_length
1127  **
1128  ** @param const xcb_xvmc_create_subpicture_reply_t *R
1129  ** @returns int
1130  **
1131  *****************************************************************************/
1132 
1133 int
1134 xcb_xvmc_create_subpicture_priv_data_length (const xcb_xvmc_create_subpicture_reply_t *R  /**< */)
1135 {
1136     return R->length;
1137 }
1138 
1139 
1140 /*****************************************************************************
1141  **
1142  ** xcb_generic_iterator_t xcb_xvmc_create_subpicture_priv_data_end
1143  **
1144  ** @param const xcb_xvmc_create_subpicture_reply_t *R
1145  ** @returns xcb_generic_iterator_t
1146  **
1147  *****************************************************************************/
1148 
1149 xcb_generic_iterator_t
1150 xcb_xvmc_create_subpicture_priv_data_end (const xcb_xvmc_create_subpicture_reply_t *R  /**< */)
1151 {
1152     xcb_generic_iterator_t i;
1153     i.data = ((uint32_t *) (R + 1)) + (R->length);
1154     i.rem = 0;
1155     i.index = (char *) i.data - (char *) R;
1156     return i;
1157 }
1158 
1159 
1160 /*****************************************************************************
1161  **
1162  ** xcb_xvmc_create_subpicture_reply_t * xcb_xvmc_create_subpicture_reply
1163  **
1164  ** @param xcb_connection_t                     *c
1165  ** @param xcb_xvmc_create_subpicture_cookie_t   cookie
1166  ** @param xcb_generic_error_t                 **e
1167  ** @returns xcb_xvmc_create_subpicture_reply_t *
1168  **
1169  *****************************************************************************/
1170 
1171 xcb_xvmc_create_subpicture_reply_t *
1172 xcb_xvmc_create_subpicture_reply (xcb_connection_t                     *c  /**< */,
1173                                   xcb_xvmc_create_subpicture_cookie_t   cookie  /**< */,
1174                                   xcb_generic_error_t                 **e  /**< */)
1175 {
1176     return (xcb_xvmc_create_subpicture_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
1177 }
1178 
1179 
1180 /*****************************************************************************
1181  **
1182  ** xcb_void_cookie_t xcb_xvmc_destroy_subpicture_checked
1183  **
1184  ** @param xcb_connection_t      *c
1185  ** @param xcb_xvmc_subpicture_t  subpicture_id
1186  ** @returns xcb_void_cookie_t
1187  **
1188  *****************************************************************************/
1189 
1190 xcb_void_cookie_t
1191 xcb_xvmc_destroy_subpicture_checked (xcb_connection_t      *c  /**< */,
1192                                      xcb_xvmc_subpicture_t  subpicture_id  /**< */)
1193 {
1194     static const xcb_protocol_request_t xcb_req = {
1195         /* count */ 2,
1196         /* ext */ &xcb_xvmc_id,
1197         /* opcode */ XCB_XVMC_DESTROY_SUBPICTURE,
1198         /* isvoid */ 1
1199     };
1200 
1201     struct iovec xcb_parts[4];
1202     xcb_void_cookie_t xcb_ret;
1203     xcb_xvmc_destroy_subpicture_request_t xcb_out;
1204 
1205     xcb_out.subpicture_id = subpicture_id;
1206 
1207     xcb_parts[2].iov_base = (char *) &xcb_out;
1208     xcb_parts[2].iov_len = sizeof(xcb_out);
1209     xcb_parts[3].iov_base = 0;
1210     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1211 
1212     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1213     return xcb_ret;
1214 }
1215 
1216 
1217 /*****************************************************************************
1218  **
1219  ** xcb_void_cookie_t xcb_xvmc_destroy_subpicture
1220  **
1221  ** @param xcb_connection_t      *c
1222  ** @param xcb_xvmc_subpicture_t  subpicture_id
1223  ** @returns xcb_void_cookie_t
1224  **
1225  *****************************************************************************/
1226 
1227 xcb_void_cookie_t
1228 xcb_xvmc_destroy_subpicture (xcb_connection_t      *c  /**< */,
1229                              xcb_xvmc_subpicture_t  subpicture_id  /**< */)
1230 {
1231     static const xcb_protocol_request_t xcb_req = {
1232         /* count */ 2,
1233         /* ext */ &xcb_xvmc_id,
1234         /* opcode */ XCB_XVMC_DESTROY_SUBPICTURE,
1235         /* isvoid */ 1
1236     };
1237 
1238     struct iovec xcb_parts[4];
1239     xcb_void_cookie_t xcb_ret;
1240     xcb_xvmc_destroy_subpicture_request_t xcb_out;
1241 
1242     xcb_out.subpicture_id = subpicture_id;
1243 
1244     xcb_parts[2].iov_base = (char *) &xcb_out;
1245     xcb_parts[2].iov_len = sizeof(xcb_out);
1246     xcb_parts[3].iov_base = 0;
1247     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1248 
1249     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1250     return xcb_ret;
1251 }
1252 
1253 int
1254 xcb_xvmc_list_subpicture_types_sizeof (const void  *_buffer  /**< */)
1255 {
1256     char *xcb_tmp = (char *)_buffer;
1257     const xcb_xvmc_list_subpicture_types_reply_t *_aux = (xcb_xvmc_list_subpicture_types_reply_t *)_buffer;
1258     unsigned int xcb_buffer_len = 0;
1259     unsigned int xcb_block_len = 0;
1260     unsigned int xcb_pad = 0;
1261     unsigned int xcb_align_to = 0;
1262 
1263 
1264     xcb_block_len += sizeof(xcb_xvmc_list_subpicture_types_reply_t);
1265     xcb_tmp += xcb_block_len;
1266     xcb_buffer_len += xcb_block_len;
1267     xcb_block_len = 0;
1268     /* types */
1269     xcb_block_len += _aux->num * sizeof(xcb_xv_image_format_info_t);
1270     xcb_tmp += xcb_block_len;
1271     xcb_align_to = ALIGNOF(xcb_xv_image_format_info_t);
1272     /* insert padding */
1273     xcb_pad = -xcb_block_len & (xcb_align_to - 1);
1274     xcb_buffer_len += xcb_block_len + xcb_pad;
1275     if (0 != xcb_pad) {
1276         xcb_tmp += xcb_pad;
1277         xcb_pad = 0;
1278     }
1279     xcb_block_len = 0;
1280 
1281     return xcb_buffer_len;
1282 }
1283 
1284 
1285 /*****************************************************************************
1286  **
1287  ** xcb_xvmc_list_subpicture_types_cookie_t xcb_xvmc_list_subpicture_types
1288  **
1289  ** @param xcb_connection_t   *c
1290  ** @param xcb_xv_port_t       port_id
1291  ** @param xcb_xvmc_surface_t  surface_id
1292  ** @returns xcb_xvmc_list_subpicture_types_cookie_t
1293  **
1294  *****************************************************************************/
1295 
1296 xcb_xvmc_list_subpicture_types_cookie_t
1297 xcb_xvmc_list_subpicture_types (xcb_connection_t   *c  /**< */,
1298                                 xcb_xv_port_t       port_id  /**< */,
1299                                 xcb_xvmc_surface_t  surface_id  /**< */)
1300 {
1301     static const xcb_protocol_request_t xcb_req = {
1302         /* count */ 2,
1303         /* ext */ &xcb_xvmc_id,
1304         /* opcode */ XCB_XVMC_LIST_SUBPICTURE_TYPES,
1305         /* isvoid */ 0
1306     };
1307 
1308     struct iovec xcb_parts[4];
1309     xcb_xvmc_list_subpicture_types_cookie_t xcb_ret;
1310     xcb_xvmc_list_subpicture_types_request_t xcb_out;
1311 
1312     xcb_out.port_id = port_id;
1313     xcb_out.surface_id = surface_id;
1314 
1315     xcb_parts[2].iov_base = (char *) &xcb_out;
1316     xcb_parts[2].iov_len = sizeof(xcb_out);
1317     xcb_parts[3].iov_base = 0;
1318     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1319 
1320     xcb_ret.sequence = xcb_send_request(c, XCB_REQUEST_CHECKED, xcb_parts + 2, &xcb_req);
1321     return xcb_ret;
1322 }
1323 
1324 
1325 /*****************************************************************************
1326  **
1327  ** xcb_xvmc_list_subpicture_types_cookie_t xcb_xvmc_list_subpicture_types_unchecked
1328  **
1329  ** @param xcb_connection_t   *c
1330  ** @param xcb_xv_port_t       port_id
1331  ** @param xcb_xvmc_surface_t  surface_id
1332  ** @returns xcb_xvmc_list_subpicture_types_cookie_t
1333  **
1334  *****************************************************************************/
1335 
1336 xcb_xvmc_list_subpicture_types_cookie_t
1337 xcb_xvmc_list_subpicture_types_unchecked (xcb_connection_t   *c  /**< */,
1338                                           xcb_xv_port_t       port_id  /**< */,
1339                                           xcb_xvmc_surface_t  surface_id  /**< */)
1340 {
1341     static const xcb_protocol_request_t xcb_req = {
1342         /* count */ 2,
1343         /* ext */ &xcb_xvmc_id,
1344         /* opcode */ XCB_XVMC_LIST_SUBPICTURE_TYPES,
1345         /* isvoid */ 0
1346     };
1347 
1348     struct iovec xcb_parts[4];
1349     xcb_xvmc_list_subpicture_types_cookie_t xcb_ret;
1350     xcb_xvmc_list_subpicture_types_request_t xcb_out;
1351 
1352     xcb_out.port_id = port_id;
1353     xcb_out.surface_id = surface_id;
1354 
1355     xcb_parts[2].iov_base = (char *) &xcb_out;
1356     xcb_parts[2].iov_len = sizeof(xcb_out);
1357     xcb_parts[3].iov_base = 0;
1358     xcb_parts[3].iov_len = -xcb_parts[2].iov_len & 3;
1359 
1360     xcb_ret.sequence = xcb_send_request(c, 0, xcb_parts + 2, &xcb_req);
1361     return xcb_ret;
1362 }
1363 
1364 
1365 /*****************************************************************************
1366  **
1367  ** xcb_xv_image_format_info_t * xcb_xvmc_list_subpicture_types_types
1368  **
1369  ** @param const xcb_xvmc_list_subpicture_types_reply_t *R
1370  ** @returns xcb_xv_image_format_info_t *
1371  **
1372  *****************************************************************************/
1373 
1374 xcb_xv_image_format_info_t *
1375 xcb_xvmc_list_subpicture_types_types (const xcb_xvmc_list_subpicture_types_reply_t *R  /**< */)
1376 {
1377     return (xcb_xv_image_format_info_t *) (R + 1);
1378 }
1379 
1380 
1381 /*****************************************************************************
1382  **
1383  ** int xcb_xvmc_list_subpicture_types_types_length
1384  **
1385  ** @param const xcb_xvmc_list_subpicture_types_reply_t *R
1386  ** @returns int
1387  **
1388  *****************************************************************************/
1389 
1390 int
1391 xcb_xvmc_list_subpicture_types_types_length (const xcb_xvmc_list_subpicture_types_reply_t *R  /**< */)
1392 {
1393     return R->num;
1394 }
1395 
1396 
1397 /*****************************************************************************
1398  **
1399  ** xcb_xv_image_format_info_iterator_t xcb_xvmc_list_subpicture_types_types_iterator
1400  **
1401  ** @param const xcb_xvmc_list_subpicture_types_reply_t *R
1402  ** @returns xcb_xv_image_format_info_iterator_t
1403  **
1404  *****************************************************************************/
1405 
1406 xcb_xv_image_format_info_iterator_t
1407 xcb_xvmc_list_subpicture_types_types_iterator (const xcb_xvmc_list_subpicture_types_reply_t *R  /**< */)
1408 {
1409     xcb_xv_image_format_info_iterator_t i;
1410     i.data = (xcb_xv_image_format_info_t *) (R + 1);
1411     i.rem = R->num;
1412     i.index = (char *) i.data - (char *) R;
1413     return i;
1414 }
1415 
1416 
1417 /*****************************************************************************
1418  **
1419  ** xcb_xvmc_list_subpicture_types_reply_t * xcb_xvmc_list_subpicture_types_reply
1420  **
1421  ** @param xcb_connection_t                         *c
1422  ** @param xcb_xvmc_list_subpicture_types_cookie_t   cookie
1423  ** @param xcb_generic_error_t                     **e
1424  ** @returns xcb_xvmc_list_subpicture_types_reply_t *
1425  **
1426  *****************************************************************************/
1427 
1428 xcb_xvmc_list_subpicture_types_reply_t *
1429 xcb_xvmc_list_subpicture_types_reply (xcb_connection_t                         *c  /**< */,
1430                                       xcb_xvmc_list_subpicture_types_cookie_t   cookie  /**< */,
1431                                       xcb_generic_error_t                     **e  /**< */)
1432 {
1433     return (xcb_xvmc_list_subpicture_types_reply_t *) xcb_wait_for_reply(c, cookie.sequence, e);
1434 }
1435 
1436