From 4029a695b5c6431ab2548f63614a89b1b6f04d93 Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Fri, 11 Dec 2020 13:46:14 -0600 Subject: vo_wlshm: support presentation time We get presentation feedback for free thanks to the last commit. Implementing it in wlshm is pretty straightfoward from there. --- video/out/vo_wlshm.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'video/out') diff --git a/video/out/vo_wlshm.c b/video/out/vo_wlshm.c index 994df64d02..8319475f72 100644 --- a/video/out/vo_wlshm.c +++ b/video/out/vo_wlshm.c @@ -275,6 +275,19 @@ static void flip_page(struct vo *vo) if (!wl->opts->disable_vsync) vo_wayland_wait_frame(wl); + + if (wl->presentation) + wayland_sync_swap(wl); +} + +static void get_vsync(struct vo *vo, struct vo_vsync_info *info) +{ + struct vo_wayland_state *wl = vo->wl; + if (wl->presentation) { + info->vsync_duration = wl->vsync_duration; + info->skipped_vsyncs = wl->last_skipped_vsyncs; + info->last_queue_display_time = wl->last_queue_display_time; + } } static void uninit(struct vo *vo) @@ -304,6 +317,7 @@ const struct vo_driver video_out_wlshm = { .control = control, .draw_image = draw_image, .flip_page = flip_page, + .get_vsync = get_vsync, .wakeup = vo_wayland_wakeup, .wait_events = vo_wayland_wait_events, .uninit = uninit, -- cgit v1.2.3