summaryrefslogtreecommitdiffstats
path: root/video/out/wayland_common.h
diff options
context:
space:
mode:
authorRostislav Pehlivanov <atomnuker@gmail.com>2016-07-21 12:25:30 +0100
committerwm4 <wm4@nowhere>2016-07-21 14:45:38 +0200
commitc0ef3cf9c2d8db023dd3d5dcdeb2c2c592ad6b58 (patch)
tree91331f7e448cd34974f2b1a639aefc92e7a0e8dd /video/out/wayland_common.h
parent8f51418ca4d08533fe23a8f233e59afb2241a9b8 (diff)
downloadmpv-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/wayland_common.h')
-rw-r--r--video/out/wayland_common.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/video/out/wayland_common.h b/video/out/wayland_common.h
index ec3f72ce67..cf659fb8e6 100644
--- a/video/out/wayland_common.h
+++ b/video/out/wayland_common.h
@@ -53,14 +53,12 @@ typedef void (*vo_wayland_frame_cb)(void *data, uint32_t time);
struct vo_wayland_state {
struct vo *vo;
struct mp_log* log;
+ int wakeup_pipe[2];
struct {
void *data;
vo_wayland_frame_cb function;
struct wl_callback *callback;
- uint64_t last_us;
- bool pending;
- bool dropping;
} frame;
#if HAVE_GL_WAYLAND
@@ -150,8 +148,9 @@ int vo_wayland_init(struct vo *vo);
void vo_wayland_uninit(struct vo *vo);
bool vo_wayland_config(struct vo *vo);
int vo_wayland_control(struct vo *vo, int *events, int request, void *arg);
+void vo_wayland_wakeup(struct vo *vo);
+void vo_wayland_wait_events(struct vo *vo, int64_t until_time_us);
void vo_wayland_request_frame(struct vo *vo, void *data, vo_wayland_frame_cb cb);
-bool vo_wayland_wait_frame(struct vo *vo);
#endif /* MPLAYER_WAYLAND_COMMON_H */