[vlc-devel] [PATCH 5/7] vout/wayland: remove sys->embed

Thomas Guillem thomas at gllm.fr
Thu Mar 26 16:33:51 CET 2020


Since vd->window can be used directly.
---
 modules/video_output/wayland/shm.c | 22 ++++++++--------------
 1 file changed, 8 insertions(+), 14 deletions(-)

diff --git a/modules/video_output/wayland/shm.c b/modules/video_output/wayland/shm.c
index 81e0bd0cc2..ababd66827 100644
--- a/modules/video_output/wayland/shm.c
+++ b/modules/video_output/wayland/shm.c
@@ -46,7 +46,6 @@
 
 struct vout_display_sys_t
 {
-    vout_window_t *embed; /* VLC window */
     struct wl_event_queue *eventq;
     struct wl_shm *shm;
     struct wp_viewporter *viewporter;
@@ -87,8 +86,8 @@ static void Prepare(vout_display_t *vd, picture_t *pic, subpicture_t *subpic,
 {
     VLC_UNUSED(date);
     vout_display_sys_t *sys = vd->sys;
-    struct wl_display *display = sys->embed->display.wl;
-    struct wl_surface *surface = sys->embed->handle.wl;
+    struct wl_display *display = vd->window->display.wl;
+    struct wl_surface *surface = vd->window->handle.wl;
     struct picture_buffer_t *picbuf = pic->p_sys;
 
     if (picbuf->fd == -1)
@@ -143,8 +142,8 @@ static void Prepare(vout_display_t *vd, picture_t *pic, subpicture_t *subpic,
 static void Display(vout_display_t *vd, picture_t *pic)
 {
     vout_display_sys_t *sys = vd->sys;
-    struct wl_display *display = sys->embed->display.wl;
-    struct wl_surface *surface = sys->embed->handle.wl;
+    struct wl_display *display = vd->window->display.wl;
+    struct wl_surface *surface = vd->window->handle.wl;
 
     wl_surface_commit(surface);
     wl_display_roundtrip_queue(display, sys->eventq);
@@ -241,8 +240,8 @@ static const struct wl_shm_listener shm_cbs =
 static void Close(vout_display_t *vd)
 {
     vout_display_sys_t *sys = vd->sys;
-    struct wl_display *display = sys->embed->display.wl;
-    struct wl_surface *surface = sys->embed->handle.wl;
+    struct wl_display *display = vd->window->display.wl;
+    struct wl_surface *surface = vd->window->handle.wl;
 
     wl_surface_attach(surface, NULL, 0, 0);
     wl_surface_commit(surface);
@@ -275,18 +274,13 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
         return VLC_ENOMEM;
 
     vd->sys = sys;
-    sys->embed = NULL;
     sys->eventq = NULL;
     sys->shm = NULL;
     sys->active_buffers = 0;
     sys->display_width = cfg->display.width;
     sys->display_height = cfg->display.height;
 
-    /* Get window */
-    sys->embed = vd->window;
-    assert(sys->embed != NULL);
-
-    struct wl_display *display = sys->embed->display.wl;
+    struct wl_display *display = vd->window->display.wl;
     struct vlc_wl_registry *registry = NULL;
 
     sys->eventq = wl_display_create_queue(display);
@@ -308,7 +302,7 @@ static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg,
     wl_shm_add_listener(sys->shm, &shm_cbs, vd);
     wl_display_roundtrip_queue(display, sys->eventq);
 
-    struct wl_surface *surface = sys->embed->handle.wl;
+    struct wl_surface *surface = vd->window->handle.wl;
     if (sys->viewporter != NULL)
         sys->viewport = wp_viewporter_get_viewport(sys->viewporter, surface);
     else
-- 
2.20.1



More information about the vlc-devel mailing list