diff options
author | Uoti Urpala <uau@mplayer2.org> | 2011-12-05 05:24:18 +0200 |
---|---|---|
committer | Uoti Urpala <uau@mplayer2.org> | 2011-12-06 05:03:39 +0200 |
commit | ad0348cf0a7459c0581deaf3ed7d8b73a12cc73f (patch) | |
tree | 206975ec6720a6d3605cc1b9d4c1a603898b3458 /libmpcodecs/vf_vo.c | |
parent | c9553ce82fdb80811196f40b9c1eaaa3b2351e01 (diff) | |
download | mpv-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 'libmpcodecs/vf_vo.c')
-rw-r--r-- | libmpcodecs/vf_vo.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/libmpcodecs/vf_vo.c b/libmpcodecs/vf_vo.c index 9e2612654c..2d9514d3d2 100644 --- a/libmpcodecs/vf_vo.c +++ b/libmpcodecs/vf_vo.c @@ -117,8 +117,6 @@ static int control(struct vf_instance *vf, int request, void* data) if(!video_out->config_ok) return CONTROL_FALSE; // vo not configured? vo_draw_osd(video_out, data); return CONTROL_TRUE; - case VFCTRL_REDRAW_OSD: - return vo_control(video_out, VOCTRL_REDRAW_OSD, data) == true; case VFCTRL_SET_EQUALIZER: { vf_equalizer_t *eq=data; @@ -153,7 +151,6 @@ static int control(struct vf_instance *vf, int request, void* data) { struct osd_state *osd = data; mp_eosd_images_t images = {NULL, 2}; - double pts = video_out->next_pts; ASS_Renderer *renderer; double scale; if (osd->vsfilter_aspect && vf->opts->ass_vsfilter_aspect_compat) { @@ -168,7 +165,7 @@ static int control(struct vf_instance *vf, int request, void* data) if (osd->ass_track_changed) vf->priv->prev_visibility = false; osd->ass_track_changed = false; - if (sub_visibility && osd->ass_track && (pts != MP_NOPTS_VALUE)) { + if (sub_visibility && osd->ass_track && (osd->pts != MP_NOPTS_VALUE)) { struct mp_eosd_res res = {0}; if (vo_control(video_out, VOCTRL_GET_EOSD_RES, &res) == VO_TRUE) { ass_set_frame_size(renderer, res.w, res.h); @@ -181,7 +178,7 @@ static int control(struct vf_instance *vf, int request, void* data) mp_ass_reload_options(vf->priv->renderer_vsfilter, vf->opts); } images.imgs = ass_render_frame(renderer, osd->ass_track, - (pts+sub_delay) * 1000 + .5, + (osd->pts+sub_delay) * 1000 + .5, &images.changed); if (!vf->priv->prev_visibility || osd->ass_force_reload) images.changed = 2; |