summaryrefslogtreecommitdiffstats
path: root/libvo/video_out.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@mplayer2.org>2011-12-05 05:24:18 +0200
committerUoti Urpala <uau@mplayer2.org>2011-12-06 05:03:39 +0200
commitad0348cf0a7459c0581deaf3ed7d8b73a12cc73f (patch)
tree206975ec6720a6d3605cc1b9d4c1a603898b3458 /libvo/video_out.c
parentc9553ce82fdb80811196f40b9c1eaaa3b2351e01 (diff)
downloadmpv-ad0348cf0a7459c0581deaf3ed7d8b73a12cc73f.tar.bz2
mpv-ad0348cf0a7459c0581deaf3ed7d8b73a12cc73f.tar.xz
core, vo: modify OSD redraw architecture, support EOSD
Previously the core sent VFCTRL_REDRAW_OSD to change OSD contents over the current frame. Change this to VFCTRL_REDRAW_FRAME followed by normal EOSD and OSD drawing calls, then vo_flip_page(). The new version supports changing EOSD contents for libass-rendered subtitles and simplifies the redraw support code needed per VO. vo_xv doesn't support EOSD changes because it relies on vf_ass to render EOSD contents earlier in the filter chain. vo_xv logic is additionally simplified because the previous commit removed the need to track the status of current and next images separately (now each frame is guaranteed to become "visible" soon after we receive it as "next", with no VO code running in the interval between).
Diffstat (limited to 'libvo/video_out.c')
-rw-r--r--libvo/video_out.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/libvo/video_out.c b/libvo/video_out.c
index 82cf0dbbfe..0b1f7d1fab 100644
--- a/libvo/video_out.c
+++ b/libvo/video_out.c
@@ -285,6 +285,17 @@ int vo_draw_image(struct vo *vo, struct mp_image *mpi, double pts)
return 0;
}
+int vo_redraw_frame(struct vo *vo)
+{
+ if (!vo->config_ok)
+ return -1;
+ if (vo_control(vo, VOCTRL_REDRAW_FRAME, NULL) == true) {
+ vo->redrawing = true;
+ return 0;
+ }
+ return -1;
+}
+
int vo_get_buffered_frame(struct vo *vo, bool eof)
{
if (!vo->config_ok)
@@ -339,8 +350,11 @@ void vo_flip_page(struct vo *vo, unsigned int pts_us, int duration)
{
if (!vo->config_ok)
return;
- vo->frame_loaded = false;
- vo->next_pts = MP_NOPTS_VALUE;
+ if (!vo->redrawing) {
+ vo->frame_loaded = false;
+ vo->next_pts = MP_NOPTS_VALUE;
+ }
+ vo->redrawing = false;
if (vo->driver->flip_page_timed)
vo->driver->flip_page_timed(vo, pts_us, duration);
else
@@ -486,6 +500,7 @@ int vo_config(struct vo *vo, uint32_t width, uint32_t height,
}
vo->frame_loaded = false;
vo->waiting_mpi = NULL;
+ vo->redrawing = false;
return ret;
}