mirror of
https://github.com/mpv-player/mpv
synced 2025-02-09 16:37:24 +00:00
vo_wayand: save the flip time in the frame handler
This value is more accurate than the default value.
This commit is contained in:
parent
1cb15316b0
commit
3bf83f7642
@ -42,6 +42,8 @@
|
|||||||
#include "common/msg.h"
|
#include "common/msg.h"
|
||||||
#include "input/input.h"
|
#include "input/input.h"
|
||||||
|
|
||||||
|
#include "osdep/timer.h"
|
||||||
|
|
||||||
#include "wayland_common.h"
|
#include "wayland_common.h"
|
||||||
#include "wayland-version.h"
|
#include "wayland-version.h"
|
||||||
|
|
||||||
@ -161,6 +163,8 @@ struct priv {
|
|||||||
// this id tells us if the subtitle part has changed or not
|
// this id tells us if the subtitle part has changed or not
|
||||||
int bitmap_pos_id[MAX_OSD_PARTS];
|
int bitmap_pos_id[MAX_OSD_PARTS];
|
||||||
|
|
||||||
|
int64_t recent_flip_time; // last frame event
|
||||||
|
|
||||||
// options
|
// options
|
||||||
int enable_alpha;
|
int enable_alpha;
|
||||||
int use_rgb565;
|
int use_rgb565;
|
||||||
@ -621,6 +625,7 @@ static void frame_handle_redraw(void *data,
|
|||||||
|
|
||||||
p->redraw_callback = NULL;
|
p->redraw_callback = NULL;
|
||||||
}
|
}
|
||||||
|
p->recent_flip_time = mp_time_us();
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct wl_callback_listener frame_listener = {
|
static const struct wl_callback_listener frame_listener = {
|
||||||
@ -907,6 +912,11 @@ static int control(struct vo *vo, uint32_t request, void *data)
|
|||||||
args->out_image = get_screenshot(p);
|
args->out_image = get_screenshot(p);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
case VOCTRL_GET_RECENT_FLIP_TIME:
|
||||||
|
{
|
||||||
|
*(int64_t*) data = p->recent_flip_time;
|
||||||
|
return VO_TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
int events = 0;
|
int events = 0;
|
||||||
int r = vo_wayland_control(vo, &events, request, data);
|
int r = vo_wayland_control(vo, &events, request, data);
|
||||||
|
Loading…
Reference in New Issue
Block a user