summaryrefslogtreecommitdiffstats
path: root/libmpv
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-04-09 19:30:26 +0200
committerwm4 <wm4@nowhere>2015-04-09 19:30:26 +0200
commit8dc7156bc0271965ea1e6768cfc7bbe67cef1876 (patch)
tree3573cd6130ff7b71bf0c4d7f66e4f9ae53200b75 /libmpv
parent4e8ee522f4df73a74befc093640fdf60a43053ec (diff)
downloadmpv-8dc7156bc0271965ea1e6768cfc7bbe67cef1876.tar.bz2
mpv-8dc7156bc0271965ea1e6768cfc7bbe67cef1876.tar.xz
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.
Diffstat (limited to 'libmpv')
-rw-r--r--libmpv/client.h2
-rw-r--r--libmpv/mpv.def1
-rw-r--r--libmpv/opengl_cb.h12
3 files changed, 14 insertions, 1 deletions
diff --git a/libmpv/client.h b/libmpv/client.h
index 2ace0f54cf..511c4794b4 100644
--- a/libmpv/client.h
+++ b/libmpv/client.h
@@ -195,7 +195,7 @@ extern "C" {
* relational operators (<, >, <=, >=).
*/
#define MPV_MAKE_VERSION(major, minor) (((major) << 16) | (minor) | 0UL)
-#define MPV_CLIENT_API_VERSION MPV_MAKE_VERSION(1, 15)
+#define MPV_CLIENT_API_VERSION MPV_MAKE_VERSION(1, 16)
/**
* Return the MPV_CLIENT_API_VERSION the mpv source has been compiled with.
diff --git a/libmpv/mpv.def b/libmpv/mpv.def
index d4d45874fa..4cdcf6b06b 100644
--- a/libmpv/mpv.def
+++ b/libmpv/mpv.def
@@ -23,6 +23,7 @@ mpv_initialize
mpv_load_config_file
mpv_observe_property
mpv_opengl_cb_init_gl
+mpv_opengl_cb_report_flip
mpv_opengl_cb_render
mpv_opengl_cb_set_update_callback
mpv_opengl_cb_uninit_gl
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
@@ -199,6 +199,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.
*
* If video is still active (e.g. a file playing), video will be disabled