Commit a90da50b authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

XCB: do not render, we always use the native server format

parent 45a40753
...@@ -90,7 +90,6 @@ struct vout_sys_t ...@@ -90,7 +90,6 @@ struct vout_sys_t
static int Init (vout_thread_t *); static int Init (vout_thread_t *);
static void Deinit (vout_thread_t *); static void Deinit (vout_thread_t *);
static void Render (vout_thread_t *, picture_t *);
static void Display (vout_thread_t *, picture_t *); static void Display (vout_thread_t *, picture_t *);
static int Manage (vout_thread_t *); static int Manage (vout_thread_t *);
...@@ -300,7 +299,6 @@ static int Open (vlc_object_t *obj) ...@@ -300,7 +299,6 @@ static int Open (vlc_object_t *obj)
vout->pf_init = Init; vout->pf_init = Init;
vout->pf_end = Deinit; vout->pf_end = Deinit;
vout->pf_render = Render;
vout->pf_display = Display; vout->pf_display = Display;
vout->pf_manage = Manage; vout->pf_manage = Manage;
return VLC_SUCCESS; return VLC_SUCCESS;
...@@ -331,7 +329,6 @@ struct picture_sys_t ...@@ -331,7 +329,6 @@ struct picture_sys_t
{ {
xcb_connection_t *conn; /* Shared connection to X server */ xcb_connection_t *conn; /* Shared connection to X server */
xcb_image_t *image; /* Picture buffer */ xcb_image_t *image; /* Picture buffer */
xcb_image_t *native; /* Rendered picture buffer (in X server format) */
xcb_shm_seg_t segment; /* Shared memory segment X ID */ xcb_shm_seg_t segment; /* Shared memory segment X ID */
}; };
...@@ -407,12 +404,9 @@ static int PictureInit (vout_thread_t *vout, picture_t *pic) ...@@ -407,12 +404,9 @@ static int PictureInit (vout_thread_t *vout, picture_t *pic)
xcb_shm_detach (p_sys->conn, priv->segment); xcb_shm_detach (p_sys->conn, priv->segment);
goto error; goto error;
} }
if (shm != SHM_ERR && xcb_image_native (p_sys->conn, img, 0) == NULL)
msg_Warn (vout, "incompatible X server image format");
priv->conn = p_sys->conn; priv->conn = p_sys->conn;
priv->image = img; priv->image = img;
priv->native = NULL;
pic->p_sys = priv; pic->p_sys = priv;
pic->p->p_pixels = img->data; pic->p->p_pixels = img->data;
pic->i_status = DESTROYED_PICTURE; pic->i_status = DESTROYED_PICTURE;
...@@ -439,8 +433,6 @@ static void PictureDeinit (picture_t *pic) ...@@ -439,8 +433,6 @@ static void PictureDeinit (picture_t *pic)
xcb_shm_detach (p_sys->conn, p_sys->segment); xcb_shm_detach (p_sys->conn, p_sys->segment);
shmdt (p_sys->image->data); shmdt (p_sys->image->data);
} }
if ((p_sys->native != NULL) && (p_sys->native != p_sys->image))
xcb_image_destroy (p_sys->native);
xcb_image_destroy (p_sys->image); xcb_image_destroy (p_sys->image);
free (p_sys); free (p_sys);
} }
...@@ -570,20 +562,6 @@ static void Deinit (vout_thread_t *vout) ...@@ -570,20 +562,6 @@ static void Deinit (vout_thread_t *vout)
xcb_destroy_window (p_sys->conn, p_sys->window); xcb_destroy_window (p_sys->conn, p_sys->window);
} }
/**
* Prepares an image ahead of display.
*/
static void Render (vout_thread_t *vout, picture_t *pic)
{
vout_sys_t *p_sys = vout->p_sys;
picture_sys_t *priv = pic->p_sys;
if ((priv->native != NULL) && (priv->native != priv->image))
xcb_image_destroy (priv->native);
priv->native = xcb_image_native (p_sys->conn, priv->image, 1);
}
/** /**
* Sends an image to the X server. * Sends an image to the X server.
*/ */
...@@ -591,9 +569,9 @@ static void Display (vout_thread_t *vout, picture_t *pic) ...@@ -591,9 +569,9 @@ static void Display (vout_thread_t *vout, picture_t *pic)
{ {
vout_sys_t *p_sys = vout->p_sys; vout_sys_t *p_sys = vout->p_sys;
picture_sys_t *priv = pic->p_sys; picture_sys_t *priv = pic->p_sys;
xcb_image_t *img = priv->image, *native = priv->native; xcb_image_t *img = priv->image;
if ((native == img) && (img->base == NULL)) if (img->base == NULL)
{ {
xcb_shm_segment_info_t info = { xcb_shm_segment_info_t info = {
.shmseg = priv->segment, .shmseg = priv->segment,
...@@ -605,8 +583,7 @@ static void Display (vout_thread_t *vout, picture_t *pic) ...@@ -605,8 +583,7 @@ static void Display (vout_thread_t *vout, picture_t *pic)
0, 0, 0, 0, img->width, img->height, 0); 0, 0, 0, 0, img->width, img->height, 0);
} }
else else
if (native != NULL) xcb_image_put (p_sys->conn, p_sys->window, p_sys->gc, img, 0, 0, 0);
xcb_image_put (p_sys->conn, p_sys->window, p_sys->gc, native, 0, 0, 0);
xcb_flush (p_sys->conn); xcb_flush (p_sys->conn);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment