]> git.sesse.net Git - vlc/blob - modules/video_output/xcb/xvideo.c
Fixed segfault when xcb xvideo open failed.
[vlc] / modules / video_output / xcb / xvideo.c
1 /**
2  * @file xvideo.c
3  * @brief X C Bindings video output module for VLC media player
4  */
5 /*****************************************************************************
6  * Copyright © 2009 Rémi Denis-Courmont
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * as published by the Free Software Foundation; either version 2.0
11  * of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
21  ****************************************************************************/
22
23 #ifdef HAVE_CONFIG_H
24 # include <config.h>
25 #endif
26
27 #include <stdlib.h>
28 #include <assert.h>
29
30 #include <xcb/xcb.h>
31 #include <xcb/shm.h>
32 #include <xcb/xv.h>
33
34 #include <vlc_common.h>
35 #include <vlc_plugin.h>
36 #include <vlc_vout_display.h>
37 #include <vlc_picture_pool.h>
38
39 #include "xcb_vlc.h"
40
41 #define DISPLAY_TEXT N_("X11 display")
42 #define DISPLAY_LONGTEXT N_( \
43     "X11 hardware display to use. By default VLC will " \
44     "use the value of the DISPLAY environment variable.")
45
46 #define SHM_TEXT N_("Use shared memory")
47 #define SHM_LONGTEXT N_( \
48     "Use shared memory to communicate between VLC and the X server.")
49
50 static int  Open (vlc_object_t *);
51 static void Close (vlc_object_t *);
52
53 /*
54  * Module descriptor
55  */
56 vlc_module_begin ()
57     set_shortname (N_("XVideo"))
58     set_description (N_("XVideo output (XCB)"))
59     set_category (CAT_VIDEO)
60     set_subcategory (SUBCAT_VIDEO_VOUT)
61     set_capability ("vout display", 155)
62     set_callbacks (Open, Close)
63
64     add_string ("x11-display", NULL, NULL,
65                 DISPLAY_TEXT, DISPLAY_LONGTEXT, true)
66         add_deprecated_alias ("xvideo-display")
67     add_bool ("x11-shm", true, NULL, SHM_TEXT, SHM_LONGTEXT, true)
68         add_deprecated_alias ("xvideo-shm")
69     add_shortcut ("xcb-xv")
70     add_shortcut ("xv")
71 vlc_module_end ()
72
73 #define MAX_PICTURES (VOUT_MAX_PICTURES)
74
75 struct vout_display_sys_t
76 {
77     xcb_connection_t *conn;
78     xcb_xv_query_adaptors_reply_t *adaptors;
79     vout_window_t *embed;/* VLC window */
80
81     xcb_window_t window; /* drawable X window */
82     xcb_gcontext_t gc;   /* context to put images */
83     xcb_xv_port_t port;  /* XVideo port */
84     uint32_t id;         /* XVideo format */
85     uint16_t width;      /* display width */
86     uint16_t height;     /* display height */
87     uint32_t data_size;  /* picture byte size (for non-SHM) */
88     bool shm;            /* whether to use MIT-SHM */
89
90     xcb_xv_query_image_attributes_reply_t *att;
91     picture_pool_t *pool; /* picture pool */
92     picture_resource_t resource[MAX_PICTURES];
93 };
94
95 static picture_t *Get (vout_display_t *);
96 static void Display (vout_display_t *, picture_t *);
97 static int Control (vout_display_t *, int, va_list);
98 static void Manage (vout_display_t *);
99
100 /**
101  * Check that the X server supports the XVideo extension.
102  */
103 static bool CheckXVideo (vout_display_t *vd, xcb_connection_t *conn)
104 {
105     xcb_xv_query_extension_reply_t *r;
106     xcb_xv_query_extension_cookie_t ck = xcb_xv_query_extension (conn);
107     bool ok = false;
108
109     r = xcb_xv_query_extension_reply (conn, ck, NULL);
110     if (r != NULL)
111     {   /* We need XVideo 2.2 for PutImage */
112         if ((r->major > 2) || (r->major == 2 && r->minor >= 2))
113         {
114             msg_Dbg (vd, "using XVideo extension v%"PRIu8".%"PRIu8,
115                      r->major, r->minor);
116             ok = true;
117         }
118         else
119             msg_Dbg (vd, "XVideo extension too old (v%"PRIu8".%"PRIu8,
120                      r->major, r->minor);
121         free (r);
122     }
123     else
124         msg_Dbg (vd, "XVideo extension not available");
125     return ok;
126 }
127
128 static vlc_fourcc_t ParseFormat (vout_display_t *vd,
129                                  const xcb_xv_image_format_info_t *restrict f)
130 {
131     if (f->byte_order != ORDER && f->bpp != 8)
132         return 0; /* Argh! */
133
134     switch (f->type)
135     {
136       case XCB_XV_IMAGE_FORMAT_INFO_TYPE_RGB:
137         switch (f->num_planes)
138         {
139           case 1:
140             switch (f->bpp)
141             {
142               case 32:
143                 if (f->depth == 24)
144                     return VLC_CODEC_RGB32;
145                 break;
146               case 24:
147                 if (f->depth == 24)
148                     return VLC_CODEC_RGB24;
149                 break;
150               case 16:
151                 if (f->depth == 16)
152                     return VLC_CODEC_RGB16;
153                 if (f->depth == 15)
154                     return VLC_CODEC_RGB15;
155                 break;
156               case 8:
157                 if (f->depth == 8)
158                     return VLC_CODEC_RGB8;
159                 break;
160             }
161             break;
162         }
163         msg_Err (vd, "unknown XVideo RGB format %"PRIx32" (%.4s)",
164                  f->id, f->guid);
165         msg_Dbg (vd, " %"PRIu8" planes, %"PRIu8" bits/pixel, "
166                  "depth %"PRIu8, f->num_planes, f->bpp, f->depth);
167         break;
168
169       case XCB_XV_IMAGE_FORMAT_INFO_TYPE_YUV:
170         if (f->u_sample_bits != f->v_sample_bits
171          || f->vhorz_u_period != f->vhorz_v_period
172          || f->vvert_u_period != f->vvert_v_period
173          || f->y_sample_bits != 8 || f->u_sample_bits != 8
174          || f->vhorz_y_period != 1 || f->vvert_y_period != 1)
175             goto bad;
176         switch (f->num_planes)
177         {
178           case 1:
179             switch (f->bpp)
180             {
181               /*untested: case 24:
182                 if (f->vhorz_u_period == 1 && f->vvert_u_period == 1)
183                     return VLC_CODEC_I444;
184                 break;*/
185               case 16:
186                 if (f->vhorz_u_period == 2 && f->vvert_u_period == 1)
187                 {
188                     if (!strcmp ((const char *)f->vcomp_order, "YUYV"))
189                         return VLC_CODEC_YUYV;
190                     if (!strcmp ((const char *)f->vcomp_order, "UYVY"))
191                         return VLC_CODEC_UYVY;
192                 }
193                 break;
194             }
195             break;
196           case 3:
197             switch (f->bpp)
198             {
199               case 12:
200                 if (f->vhorz_u_period == 2 && f->vvert_u_period == 2)
201                 {
202                     if (!strcmp ((const char *)f->vcomp_order, "YVU"))
203                         return VLC_CODEC_YV12;
204                     if (!strcmp ((const char *)f->vcomp_order, "YUV"))
205                         return VLC_CODEC_I420;
206                 }
207             }
208             break;
209         }
210     bad:
211         msg_Err (vd, "unknown XVideo YUV format %"PRIx32" (%.4s)", f->id,
212                  f->guid);
213         msg_Dbg (vd, " %"PRIu8" planes, %"PRIu32" bits/pixel, "
214                  "%"PRIu32"/%"PRIu32"/%"PRIu32" bits/sample", f->num_planes,
215                  f->bpp, f->y_sample_bits, f->u_sample_bits, f->v_sample_bits);
216         msg_Dbg (vd, " period: %"PRIu32"/%"PRIu32"/%"PRIu32"x"
217                  "%"PRIu32"/%"PRIu32"/%"PRIu32,
218                  f->vhorz_y_period, f->vhorz_u_period, f->vhorz_v_period,
219                  f->vvert_y_period, f->vvert_u_period, f->vvert_v_period);
220         msg_Warn (vd, " order: %.32s", f->vcomp_order);
221         break;
222     }
223     return 0;
224 }
225
226
227 static const xcb_xv_image_format_info_t *
228 FindFormat (vout_display_t *vd,
229             vlc_fourcc_t chroma, const video_format_t *fmt,
230             xcb_xv_port_t port,
231             const xcb_xv_list_image_formats_reply_t *list,
232             xcb_xv_query_image_attributes_reply_t **restrict pa)
233 {
234     xcb_connection_t *conn = vd->sys->conn;
235     const xcb_xv_image_format_info_t *f, *end;
236
237 #ifndef XCB_XV_OLD
238     f = xcb_xv_list_image_formats_format (list);
239 #else
240     f = (xcb_xv_image_format_info_t *) (list + 1);
241 #endif
242     end = f + xcb_xv_list_image_formats_format_length (list);
243     for (; f < end; f++)
244     {
245         if (chroma != ParseFormat (vd, f))
246             continue;
247
248         xcb_xv_query_image_attributes_reply_t *i;
249         i = xcb_xv_query_image_attributes_reply (conn,
250             xcb_xv_query_image_attributes (conn, port, f->id,
251                 fmt->i_width, fmt->i_height), NULL);
252         if (i == NULL)
253             continue;
254
255         if (i->width != fmt->i_width
256          || i->height != fmt->i_height)
257         {
258             msg_Warn (vd, "incompatible size %ux%u -> %"PRIu32"x%"PRIu32,
259                       fmt->i_width, fmt->i_height,
260                       i->width, i->height);
261             free (i);
262             continue;
263         }
264         *pa = i;
265         return f;
266     }
267     return NULL;
268 }
269
270
271 /**
272  * Get a list of XVideo adaptors for a given window.
273  */
274 static xcb_xv_query_adaptors_reply_t *GetAdaptors (vout_window_t *wnd,
275                                                    xcb_connection_t *conn)
276 {
277     xcb_xv_query_adaptors_cookie_t ck;
278
279     ck = xcb_xv_query_adaptors (conn, wnd->handle.xid);
280     return xcb_xv_query_adaptors_reply (conn, ck, NULL);
281 }
282
283 /**
284  * Probe the X server.
285  */
286 static int Open (vlc_object_t *obj)
287 {
288     vout_display_t *vd = (vout_display_t *)obj;
289     vout_display_sys_t *p_sys = malloc (sizeof (*p_sys));
290     if (p_sys == NULL)
291         return VLC_ENOMEM;
292
293     vd->sys = p_sys;
294
295     /* Connect to X */
296     p_sys->conn = Connect (obj);
297     if (p_sys->conn == NULL)
298     {
299         free (p_sys);
300         return VLC_EGENERIC;
301     }
302
303     if (!CheckXVideo (vd, p_sys->conn))
304     {
305         msg_Warn (vd, "Please enable XVideo 2.2 for faster video display");
306         xcb_disconnect (p_sys->conn);
307         free (p_sys);
308         return VLC_EGENERIC;
309     }
310
311     const xcb_screen_t *screen;
312     p_sys->embed = GetWindow (vd, p_sys->conn, &screen, &p_sys->shm);
313     if (p_sys->embed == NULL)
314     {
315         xcb_disconnect (p_sys->conn);
316         free (p_sys);
317         return VLC_EGENERIC;
318     }
319
320     /* */
321     p_sys->att = NULL;
322     p_sys->pool = NULL;
323
324     /* Cache adaptors infos */
325     p_sys->adaptors = GetAdaptors (p_sys->embed, p_sys->conn);
326     if (p_sys->adaptors == NULL)
327         goto error;
328
329     /* */
330     video_format_t fmt = vd->fmt;
331     // TODO !
332 #if 1
333     bool found_adaptor = false;
334
335     /* FIXME: check max image size */
336     xcb_xv_adaptor_info_iterator_t it;
337     for (it = xcb_xv_query_adaptors_info_iterator (p_sys->adaptors);
338          it.rem > 0;
339          xcb_xv_adaptor_info_next (&it))
340     {
341         const xcb_xv_adaptor_info_t *a = it.data;
342
343         /* FIXME: Open() should fail if none of the ports are usable to VLC */
344         if (!(a->type & XCB_XV_TYPE_IMAGE_MASK))
345             continue;
346
347         xcb_xv_list_image_formats_reply_t *r;
348         r = xcb_xv_list_image_formats_reply (p_sys->conn,
349             xcb_xv_list_image_formats (p_sys->conn, a->base_id), NULL);
350         if (r == NULL)
351             continue;
352
353         const xcb_xv_image_format_info_t *xfmt;
354
355         /* */
356         const vlc_fourcc_t *chromas, chromas_default[] = {
357             fmt.i_chroma,
358             VLC_CODEC_RGB24,
359             VLC_CODEC_RGB15,
360             VLC_CODEC_YUYV,
361             0
362         };
363         if (vlc_fourcc_IsYUV (fmt.i_chroma))
364             chromas = vlc_fourcc_GetYUVFallback (fmt.i_chroma);
365         else
366             chromas = chromas_default;
367
368         for (size_t i = 0; chromas[i]; i++)
369         {
370             vlc_fourcc_t chroma = chromas[i];
371             xfmt = FindFormat (vd, chroma, &fmt, a->base_id, r, &p_sys->att);
372             if (xfmt != NULL)
373             {
374                 fmt.i_chroma = chroma;
375                 goto found_format;
376             }
377         }
378         free (r);
379         continue;
380
381     found_format:
382         /* TODO: grab port */
383         p_sys->port = a->base_id;
384         msg_Dbg (vd, "using port %"PRIu32, p_sys->port);
385
386         p_sys->id = xfmt->id;
387         msg_Dbg (vd, "using image format 0x%"PRIx32, p_sys->id);
388         if (xfmt->type == XCB_XV_IMAGE_FORMAT_INFO_TYPE_RGB)
389         {
390             fmt.i_rmask = xfmt->red_mask;
391             fmt.i_gmask = xfmt->green_mask;
392             fmt.i_bmask = xfmt->blue_mask;
393         }
394         else
395         if (xfmt->num_planes == 3
396          && !strcmp ((const char *)xfmt->vcomp_order, "YVU"))
397             fmt.i_chroma = VLC_CODEC_YV12;
398         free (r);
399         found_adaptor = true;
400         break;
401     }
402     if (!found_adaptor)
403     {
404         msg_Err (vd, "no available XVideo adaptor");
405         goto error;
406     }
407 #endif
408
409     /* Create window */
410     {
411         const uint32_t mask =
412             /* XCB_CW_EVENT_MASK */
413             XCB_EVENT_MASK_BUTTON_PRESS | XCB_EVENT_MASK_BUTTON_RELEASE |
414             XCB_EVENT_MASK_POINTER_MOTION;
415         xcb_void_cookie_t c;
416         xcb_window_t window = xcb_generate_id (p_sys->conn);
417
418         c = xcb_create_window_checked (p_sys->conn, screen->root_depth, window,
419                                        p_sys->embed->handle.xid, 0, 0, 1, 1, 0,
420                                        XCB_WINDOW_CLASS_INPUT_OUTPUT,
421                                        screen->root_visual,
422                                        XCB_CW_EVENT_MASK, &mask);
423         if (CheckError (vd, p_sys->conn, "cannot create X11 window", c))
424             goto error;
425         p_sys->window = window;
426         msg_Dbg (vd, "using X11 window %08"PRIx32, p_sys->window);
427         xcb_map_window (p_sys->conn, window);
428
429         vout_display_place_t place;
430
431         vout_display_PlacePicture (&place, &vd->source, vd->cfg, false);
432         p_sys->width  = place.width;
433         p_sys->height = place.height;
434
435         /* */
436         const uint32_t values[] = { place.x, place.y, place.width, place.height };
437         xcb_configure_window (p_sys->conn, p_sys->window,
438                               XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y |
439                               XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT,
440                               values);
441     }
442
443     /* Create graphic context */
444     p_sys->gc = xcb_generate_id (p_sys->conn);
445     xcb_create_gc (p_sys->conn, p_sys->gc, p_sys->window, 0, NULL);
446     msg_Dbg (vd, "using X11 graphic context %08"PRIx32, p_sys->gc);
447
448     /* */
449     p_sys->pool = NULL;
450
451     /* */
452     vout_display_info_t info = vd->info;
453     info.has_pictures_invalid = false;
454
455     /* Setup vout_display_t once everything is fine */
456     vd->fmt = fmt;
457     vd->info = info;
458
459     vd->get = Get;
460     vd->prepare = NULL;
461     vd->display = Display;
462     vd->control = Control;
463     vd->manage = Manage;
464
465     /* */
466     unsigned width, height;
467     if (!GetWindowSize (p_sys->embed, p_sys->conn, &width, &height))
468         vout_display_SendEventDisplaySize (vd, width, height);
469     vout_display_SendEventFullscreen (vd, false);
470
471     return VLC_SUCCESS;
472
473 error:
474     Close (obj);
475     return VLC_EGENERIC;
476 }
477
478
479 /**
480  * Disconnect from the X server.
481  */
482 static void Close (vlc_object_t *obj)
483 {
484     vout_display_t *vd = (vout_display_t *)obj;
485     vout_display_sys_t *p_sys = vd->sys;
486
487     if (p_sys->pool)
488     {
489         for (unsigned i = 0; i < MAX_PICTURES; i++)
490         {
491             picture_resource_t *res = &p_sys->resource[i];
492
493             if (!res->p->p_pixels)
494                 break;
495             PictureResourceFree (res, p_sys->conn);
496         }
497         picture_pool_Delete (p_sys->pool);
498     }
499
500     free (p_sys->att);
501     free (p_sys->adaptors);
502     vout_display_DeleteWindow (vd, p_sys->embed);
503     xcb_disconnect (p_sys->conn);
504     free (p_sys);
505 }
506
507 /**
508  * Return a direct buffer
509  */
510 static picture_t *Get (vout_display_t *vd)
511 {
512     vout_display_sys_t *p_sys = vd->sys;
513
514     if (!p_sys->pool)
515     {
516         picture_t *pic = picture_New (vd->fmt.i_chroma,
517                                       p_sys->att->width, p_sys->att->height, 0);
518         if (!pic)
519             return NULL;
520
521         memset (p_sys->resource, 0, sizeof(p_sys->resource));
522
523         const uint32_t *offsets =
524             xcb_xv_query_image_attributes_offsets (p_sys->att);
525         p_sys->data_size = p_sys->att->data_size;
526
527         unsigned count;
528         picture_t *pic_array[MAX_PICTURES];
529         for (count = 0; count < MAX_PICTURES; count++)
530         {
531             picture_resource_t *res = &p_sys->resource[count];
532
533             for (int i = 0; i < pic->i_planes; i++)
534             {
535                 res->p[i].i_lines = pic->p[i].i_lines; /* FIXME seems wrong*/
536                 res->p[i].i_pitch = pic->p[i].i_pitch;
537             }
538             if (PictureResourceAlloc (vd, res, p_sys->att->data_size,
539                                       p_sys->conn, p_sys->shm))
540                 break;
541
542             /* Allocate further planes as specified by XVideo */
543             /* We assume that offsets[0] is zero */
544             for (int i = 1; i < pic->i_planes; i++)
545                 res->p[i].p_pixels = res->p[0].p_pixels + offsets[i];
546             pic_array[count] = picture_NewFromResource (&vd->fmt, res);
547             if (!pic_array[count])
548             {
549                 PictureResourceFree (res, p_sys->conn);
550                 memset (res, 0, sizeof(*res));
551                 break;
552             }
553         }
554         picture_Release (pic);
555
556         if (count == 0)
557             return NULL;
558
559         p_sys->pool = picture_pool_New (count, pic_array);
560         if (!p_sys->pool)
561         {
562             /* TODO release picture resources */
563             return NULL;
564         }
565         /* FIXME should also do it in case of error ? */
566         xcb_flush (p_sys->conn);
567     }
568
569     return picture_pool_Get (p_sys->pool);
570 }
571
572 /**
573  * Sends an image to the X server.
574  */
575 static void Display (vout_display_t *vd, picture_t *pic)
576 {
577     vout_display_sys_t *p_sys = vd->sys;
578     xcb_shm_seg_t segment = pic->p_sys->segment;
579
580     if (segment)
581         xcb_xv_shm_put_image (p_sys->conn, p_sys->port, p_sys->window,
582                               p_sys->gc, segment, p_sys->id, 0,
583                    /* Src: */ vd->source.i_x_offset,
584                               vd->source.i_y_offset,
585                               vd->source.i_visible_width,
586                               vd->source.i_visible_height,
587                    /* Dst: */ 0, 0, p_sys->width, p_sys->height,
588                 /* Memory: */ pic->p->i_pitch / pic->p->i_pixel_pitch,
589                               pic->p->i_visible_lines, false);
590     else
591         xcb_xv_put_image (p_sys->conn, p_sys->port, p_sys->window,
592                           p_sys->gc, p_sys->id,
593                           vd->source.i_x_offset,
594                           vd->source.i_y_offset,
595                           vd->source.i_visible_width,
596                           vd->source.i_visible_height,
597                           0, 0, p_sys->width, p_sys->height,
598                           vd->source.i_width, vd->source.i_height,
599                           p_sys->data_size, pic->p->p_pixels);
600
601     xcb_flush (p_sys->conn);
602     picture_Release (pic);
603 }
604
605 static int Control (vout_display_t *vd, int query, va_list ap)
606 {
607     vout_display_sys_t *p_sys = vd->sys;
608
609     switch (query)
610     {
611     case VOUT_DISPLAY_CHANGE_FULLSCREEN:
612     {
613         const vout_display_cfg_t *c = va_arg (ap, const vout_display_cfg_t *);
614         return vout_window_SetFullScreen (p_sys->embed, c->is_fullscreen);
615     }
616
617     case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE:
618     case VOUT_DISPLAY_CHANGE_DISPLAY_FILLED:
619     case VOUT_DISPLAY_CHANGE_ZOOM:
620     case VOUT_DISPLAY_CHANGE_SOURCE_ASPECT:
621     case VOUT_DISPLAY_CHANGE_SOURCE_CROP:
622     {
623         const vout_display_cfg_t *cfg;
624         const video_format_t *source;
625
626         if (query == VOUT_DISPLAY_CHANGE_SOURCE_ASPECT
627          || query == VOUT_DISPLAY_CHANGE_SOURCE_CROP)
628         {
629             source = (const video_format_t *)va_arg (ap, const video_format_t *);
630             cfg = vd->cfg;
631         }
632         else
633         {
634             source = &vd->source;
635             cfg = (const vout_display_cfg_t*)va_arg (ap, const vout_display_cfg_t *);
636         }
637
638         /* */
639         if (query == VOUT_DISPLAY_CHANGE_DISPLAY_SIZE
640          && (cfg->display.width  != vd->cfg->display.width
641            ||cfg->display.height != vd->cfg->display.height)
642          && vout_window_SetSize (p_sys->embed,
643                                   cfg->display.width,
644                                   cfg->display.height))
645             return VLC_EGENERIC;
646
647         vout_display_place_t place;
648         vout_display_PlacePicture (&place, source, cfg, false);
649         p_sys->width  = place.width;
650         p_sys->height = place.height;
651
652         /* Move the picture within the window */
653         const uint32_t values[] = { place.x, place.y,
654                                     place.width, place.height, };
655         xcb_configure_window (p_sys->conn, p_sys->window,
656                               XCB_CONFIG_WINDOW_X | XCB_CONFIG_WINDOW_Y
657                             | XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT,
658                               values);
659         xcb_flush (p_sys->conn);
660         return VLC_SUCCESS;
661     }
662     case VOUT_DISPLAY_CHANGE_ON_TOP:
663     {
664         int on_top = (int)va_arg (ap, int);
665         return vout_window_SetOnTop (p_sys->embed, on_top);
666     }
667
668     /* TODO */
669 #if 0
670     /* Hide the mouse. It will be send when
671      * vout_display_t::info.b_hide_mouse is false */
672     VOUT_DISPLAY_HIDE_MOUSE,
673 #endif
674     case VOUT_DISPLAY_RESET_PICTURES:
675         assert(0);
676     default:
677         msg_Err (vd, "Unknown request in XCB vout display");
678         return VLC_EGENERIC;
679     }
680 }
681
682 static void Manage (vout_display_t *vd)
683 {
684     vout_display_sys_t *p_sys = vd->sys;
685
686     ManageEvent (vd, p_sys->conn, p_sys->window);
687 }
688