diff options
author | Rostislav Pehlivanov <atomnuker@gmail.com> | 2016-07-21 12:25:30 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-07-21 14:45:38 +0200 |
commit | c0ef3cf9c2d8db023dd3d5dcdeb2c2c592ad6b58 (patch) | |
tree | 91331f7e448cd34974f2b1a639aefc92e7a0e8dd /video/out/vo_wayland.c | |
parent | 8f51418ca4d08533fe23a8f233e59afb2241a9b8 (diff) | |
download | mpv-c0ef3cf9c2d8db023dd3d5dcdeb2c2c592ad6b58.tar.bz2 mpv-c0ef3cf9c2d8db023dd3d5dcdeb2c2c592ad6b58.tar.xz |
wayland: port to the new wakeup/wait_events framework
This fits natively into the vo/backend and allows to simplify the
polling code.
One new change is the fact that surface_handle_enter flags VO_EVENT_WIN_STATE
and VO_EVENT_RESIZE instead of only VO_EVENT_WIN_STATE. Before this, the code
hackily relied on the timeout and the loop in the wait_frame function to track
and set the scaling factor. Instead, this triggers mpv to run a schedule_resize
and adjust the new VO output dimensions immediately. This is also more accurate
since surface_handle_enter() gets called when a surface is created, moved and
resized, which is exactly what the rest of the player might be interested in.
Diffstat (limited to 'video/out/vo_wayland.c')
-rw-r--r-- | video/out/vo_wayland.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/video/out/vo_wayland.c b/video/out/vo_wayland.c index 2997b38cde..236421e4ef 100644 --- a/video/out/vo_wayland.c +++ b/video/out/vo_wayland.c @@ -373,8 +373,7 @@ static void draw_image(struct vo *vo, mp_image_t *mpi) p->original_image = mpi; } - if (!vo_wayland_wait_frame(vo)) - MP_DBG(p->wl, "discarding frame callback\n"); + vo_wayland_wait_events(vo, 0); shm_buffer_t *buf = buffer_pool_get_back(&p->video_bufpool); @@ -513,8 +512,7 @@ static void flip_page(struct vo *vo) if (!p->wl->frame.callback) vo_wayland_request_frame(vo, p, redraw); - if (!vo_wayland_wait_frame(vo)) - MP_DBG(p->wl, "discarding frame callback\n"); + vo_wayland_wait_events(vo, 0); } static int query_format(struct vo *vo, int format) @@ -675,6 +673,8 @@ const struct vo_driver video_out_wayland = { .control = control, .draw_image = draw_image, .flip_page = flip_page, + .wakeup = vo_wayland_wakeup, + .wait_events = vo_wayland_wait_events, .uninit = uninit, .options = (const struct m_option[]) { OPT_FLAG("alpha", enable_alpha, 0), |