summaryrefslogtreecommitdiffstats
path: root/libvo/video_out.h
diff options
context:
space:
mode:
authorUoti Urpala <uau@mplayer2.org>2011-12-04 18:10:17 +0200
committerUoti Urpala <uau@mplayer2.org>2011-12-06 02:55:13 +0200
commitc9553ce82fdb80811196f40b9c1eaaa3b2351e01 (patch)
tree8a0068a1f2654637bcd90a9c8529016f568078d1 /libvo/video_out.h
parent421c840b3c061de89b426244fe75237a73f765de (diff)
downloadmpv-c9553ce82fdb80811196f40b9c1eaaa3b2351e01.tar.bz2
mpv-c9553ce82fdb80811196f40b9c1eaaa3b2351e01.tar.xz
vo: do final frame draw only near page flip
Separate passing a new frame to VOs using the new API into two steps. The first, vo_draw_image(), happens after a new frame is available from the filter chain. In constrast to old behavior, now the frame is not actually rendered yet at this point (though possible slice draw calls can already reach the VO before). The second step, vo_new_frame_imminent(), happens when we're close enough to the display time of the new frame that we'll commit to flipping it as the next action and will not change the OSD over the previous frame any more. This new behavior fixes a previous problem with vo_vdpau and vo_gl in the situation where the player is paused after decoding a new frame but before flipping it; previously changing OSD in that state would switch to the new frame as a side effect. It would also allow an easy way to fix extra output files produced with something like "--vo=png --frames=1" with precise seeking, but this is not done yet. The code now relies on a new mp_image from the filter chain staying valid even after the vf_vo put_image() call providing it returns. In other words decoders/filters must not deallocate or otherwise invalidate their output frame between passing it forward and returning from the decode/filter call.
Diffstat (limited to 'libvo/video_out.h')
-rw-r--r--libvo/video_out.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/libvo/video_out.h b/libvo/video_out.h
index bd7b2e8fa5..a710f7de4a 100644
--- a/libvo/video_out.h
+++ b/libvo/video_out.h
@@ -63,6 +63,8 @@ enum mp_voctrl {
VOCTRL_XOVERLAY_SET_COLORKEY, // mp_colorkey_t
VOCTRL_XOVERLAY_SET_WIN,
+ VOCTRL_NEWFRAME,
+ VOCTRL_SKIPFRAME,
VOCTRL_REDRAW_OSD,
VOCTRL_ONTOP,
@@ -258,6 +260,7 @@ struct vo {
int config_count; // Total number of successful config calls
bool frame_loaded; // Is there a next frame the VO could flip to?
+ struct mp_image *waiting_mpi;
double next_pts; // pts value of the next frame if any
double next_pts2; // optional pts of frame after that
@@ -307,6 +310,7 @@ int vo_get_buffered_frame(struct vo *vo, bool eof);
void vo_skip_frame(struct vo *vo);
int vo_draw_frame(struct vo *vo, uint8_t *src[]);
int vo_draw_slice(struct vo *vo, uint8_t *src[], int stride[], int w, int h, int x, int y);
+void vo_new_frame_imminent(struct vo *vo);
void vo_draw_osd(struct vo *vo, struct osd_state *osd);
void vo_flip_page(struct vo *vo, unsigned int pts_us, int duration);
void vo_check_events(struct vo *vo);