From 8dc7156bc0271965ea1e6768cfc7bbe67cef1876 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 9 Apr 2015 19:30:26 +0200 Subject: vo_opengl_cb: add a function to report vsync time And also let vo.c know of it. Currently, this does not help much, but will facilitate future improvements. --- libmpv/opengl_cb.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'libmpv/opengl_cb.h') diff --git a/libmpv/opengl_cb.h b/libmpv/opengl_cb.h index 0e679e5edf..225f44fd50 100644 --- a/libmpv/opengl_cb.h +++ b/libmpv/opengl_cb.h @@ -198,6 +198,18 @@ int mpv_opengl_cb_init_gl(mpv_opengl_cb_context *ctx, const char *exts, */ int mpv_opengl_cb_render(mpv_opengl_cb_context *ctx, int fbo, int vp[4]); +/** + * Tell the renderer that a frame was flipped at the given time. This is + * optional, but can help the player to achieve better timing. + * + * If this is called while no video or no OpenGL is initialized, it is ignored. + * + * @param time The mpv time (using mpv_get_time_us()) at which the flip call + * returned. If 0 is passed, mpv_get_time_us() is used instead. + * @return error code + */ +int mpv_opengl_cb_report_flip(mpv_opengl_cb_context *ctx, int64_t time); + /** * Destroy the mpv OpenGL state. * -- cgit v1.2.3