summaryrefslogtreecommitdiffstats
path: root/video/out/vo.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-08-15 23:33:33 +0200
committerwm4 <wm4@nowhere>2014-08-15 23:33:33 +0200
commit543ba6c114303c8c3a71b37864f6d901c41808eb (patch)
tree3735649107f6df38de3adaf9081ecb672546c7a3 /video/out/vo.h
parent22a95290126398c1f416dbadaf596ba79c872996 (diff)
downloadmpv-543ba6c114303c8c3a71b37864f6d901c41808eb.tar.bz2
mpv-543ba6c114303c8c3a71b37864f6d901c41808eb.tar.xz
video: add VO framedropping mode
This mostly uses the same idea as with vo_vdpau.c, but much simplified. On X11, it tries to get the display framerate with XF86VM, and limits the frequency of new video frames against it. Note that this is an old extension, and is confirmed not to work correctly with multi-monitor setups. But we're using it because it was already around (it is also used by vo_vdpau). This attempts to predict the next vsync event by using the time of the last frame and the display FPS. Even if that goes completely wrong, the results are still relatively good. On other systems, or if the X11 code doesn't return a display FPS, a framerate of 1000 is assumed. This is infinite for all practical purposes, and means that only frames which are definitely too late are dropped. This probably has worse results, but is still useful. "--framedrop=yes" is basically replaced with "--framedrop=decoder". The old framedropping mode is kept around, and should perhaps be improved. Dropping on the decoder level is still useful if decoding itself is too slow.
Diffstat (limited to 'video/out/vo.h')
-rw-r--r--video/out/vo.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/video/out/vo.h b/video/out/vo.h
index 0a8dca8c41..9077ab49b1 100644
--- a/video/out/vo.h
+++ b/video/out/vo.h
@@ -85,6 +85,7 @@ enum mp_voctrl {
VOCTRL_SET_COMMAND_LINE, // char**
VOCTRL_GET_ICC_PROFILE_PATH, // char**
+ VOCTRL_GET_DISPLAY_FPS, // double*
VOCTRL_GET_PREF_DEINT, // int*
};
@@ -134,6 +135,8 @@ struct voctrl_screenshot_args {
// VO does handle mp_image_params.rotate in 90 degree steps
#define VO_CAP_ROTATE90 1
+// VO does framedrop itself (vo_vdpau). Untimed/encoding VOs never drop.
+#define VO_CAP_FRAMEDROP 2
struct vo;
struct osd_state;
@@ -282,6 +285,8 @@ bool vo_has_frame(struct vo *vo);
void vo_redraw(struct vo *vo);
void vo_seek_reset(struct vo *vo);
void vo_destroy(struct vo *vo);
+void vo_set_paused(struct vo *vo, bool paused);
+int64_t vo_get_drop_count(struct vo *vo);
void vo_set_flip_queue_offset(struct vo *vo, int64_t us);
void vo_wakeup(struct vo *vo);