summaryrefslogtreecommitdiffstats
path: root/video/out/vo.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-07-01 19:22:40 +0200
committerwm4 <wm4@nowhere>2015-07-01 22:37:46 +0200
commit41ad9d8924cad07948ee7c2eaff9d0fa1be0b044 (patch)
tree97ffd8a66c1863f0f0a9c9c0c5b26b768da44be8 /video/out/vo.h
parent7faa80ace82f89036f6bb46e9539cc4a0cdce25c (diff)
downloadmpv-41ad9d8924cad07948ee7c2eaff9d0fa1be0b044.tar.bz2
mpv-41ad9d8924cad07948ee7c2eaff9d0fa1be0b044.tar.xz
video: pass future frames to VO
Now the VO can request a number of future frames with the last parameter of vo_set_queue_params(). This will be helpful to fix the interpolation code. Note that the first frame (after playback start or seeking) will usually not have any future frames (to make seeking fast). Near the end of the file, the number of future frames will become lower as well.
Diffstat (limited to 'video/out/vo.h')
-rw-r--r--video/out/vo.h26
1 files changed, 23 insertions, 3 deletions
diff --git a/video/out/vo.h b/video/out/vo.h
index 167c08a69c..51c7816920 100644
--- a/video/out/vo.h
+++ b/video/out/vo.h
@@ -140,6 +140,8 @@ struct voctrl_get_equalizer_args {
// VO does framedrop itself (vo_vdpau). Untimed/encoding VOs never drop.
#define VO_CAP_FRAMEDROP 2
+#define VO_MAX_FUTURE_FRAMES 10
+
struct vo;
struct osd_state;
struct mp_image;
@@ -153,9 +155,26 @@ struct vo_extra {
};
struct frame_timing {
+ // If > 0, realtime when frame should be shown, in mp_time_us() units.
int64_t pts;
+ // Realtime of estimated previous and next vsync events.
int64_t next_vsync;
int64_t prev_vsync;
+ // The current frame to be drawn. NULL means redraw previous frame
+ // (e.g. repeated frames).
+ // (Equivalent to the mp_image parameter of draw_image_timed, until the
+ // parameter is removed.)
+ struct mp_image *frame;
+ // List of future images, starting with the next one. This does not
+ // care about repeated frames - it simply contains the next real frames.
+ // vo_set_queue_params() sets how many frames this should include, though
+ // the actual number can be lower.
+ // future_frames[0] is the next frame.
+ // Note that this has frames only when a new real frame is pushed. Redraw
+ // calls or repeated frames do not include this.
+ // Ownership of the frames belongs to the caller.
+ int num_future_frames;
+ struct mp_image **future_frames;
};
struct vo_driver {
@@ -302,7 +321,7 @@ int vo_reconfig(struct vo *vo, struct mp_image_params *p, int flags);
int vo_control(struct vo *vo, uint32_t request, void *data);
bool vo_is_ready_for_frame(struct vo *vo, int64_t next_pts);
-void vo_queue_frame(struct vo *vo, struct mp_image *image,
+void vo_queue_frame(struct vo *vo, struct mp_image **images,
int64_t pts_us, int64_t duration);
void vo_wait_frame(struct vo *vo);
bool vo_still_displaying(struct vo *vo);
@@ -318,8 +337,9 @@ void vo_query_formats(struct vo *vo, uint8_t *list);
void vo_event(struct vo *vo, int event);
int vo_query_and_reset_events(struct vo *vo, int events);
struct mp_image *vo_get_current_frame(struct vo *vo);
-
-void vo_set_flip_queue_params(struct vo *vo, int64_t offset_us, bool vsync_timed);
+void vo_set_queue_params(struct vo *vo, int64_t offset_us, bool vsync_timed,
+ int num_future_frames);
+int vo_get_num_future_frames(struct vo *vo);
int64_t vo_get_vsync_interval(struct vo *vo);
double vo_get_display_fps(struct vo *vo);