diff options
author | Dudemanguy <random342@airmail.cc> | 2020-12-11 13:46:14 -0600 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2020-12-14 22:44:43 +0000 |
commit | 4029a695b5c6431ab2548f63614a89b1b6f04d93 (patch) | |
tree | 3a5a473b78d0ae36fd009e3534694faeb6ec0c4a | |
parent | b59eaf57fef7b4fef37991ad68bdba3a6fca3490 (diff) | |
download | mpv-4029a695b5c6431ab2548f63614a89b1b6f04d93.tar.bz2 mpv-4029a695b5c6431ab2548f63614a89b1b6f04d93.tar.xz |
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.
-rw-r--r-- | video/out/vo_wlshm.c | 14 |
1 files changed, 14 insertions, 0 deletions
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, |