diff options
author | wm4 <wm4@nowhere> | 2012-10-19 19:25:18 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2012-10-24 21:56:34 +0200 |
commit | 4d11f32162b08e3b48ae382e2ed0a151035f8aea (patch) | |
tree | c588341bf672fd935de45a05bef99e0d8f20892f /mplayer.c | |
parent | a4f9077f6c1a897120616cc70c1ca37c6a247be2 (diff) | |
download | mpv-4d11f32162b08e3b48ae382e2ed0a151035f8aea.tar.bz2 mpv-4d11f32162b08e3b48ae382e2ed0a151035f8aea.tar.xz |
VO, sub: refactor
Remove VFCTRL_DRAW_OSD, VFCAP_EOSD_FILTER, VFCAP_EOSD_RGBA, VFCAP_EOSD,
VOCTRL_DRAW_EOSD, VOCTRL_GET_EOSD_RES, VOCTRL_QUERY_EOSD_FORMAT.
Remove draw_osd_with_eosd(), which rendered the OSD by calling
VOCTRL_DRAW_EOSD. Change VOs to call osd_draw() directly, which takes
a callback as argument. (This basically works like the old OSD API,
except multiple OSD bitmap formats are supported and caching is
possible.)
Remove all mentions of "eosd". It's simply "osd" now.
Make OSD size per-OSD-object, as they can be different when using
vf_sub. Include display_par/video_par in resolution change detection.
Fix the issue with margin borders in vo_corevideo.
Diffstat (limited to 'mplayer.c')
-rw-r--r-- | mplayer.c | 29 |
1 files changed, 13 insertions, 16 deletions
@@ -2292,7 +2292,7 @@ int reinit_video_chain(struct MPContext *mpctx) &retcode); if (vf_ass) sh_video->vfilter = vf_ass; - else if (retcode == -1) // vf_ass open() returns -1 VO has EOSD + else if (retcode == -1) // vf_ass open() returns -1 VO has OSD mp_msg(MSGT_CPLAYER, MSGL_V, "[ass] vf_ass not needed\n"); else mp_msg(MSGT_CPLAYER, MSGL_ERR, @@ -2546,17 +2546,15 @@ void unpause_player(struct MPContext *mpctx) static int redraw_osd(struct MPContext *mpctx) { - struct sh_video *sh_video = mpctx->sh_video; - struct vf_instance *vf = sh_video->vfilter; - if (vo_redraw_frame(mpctx->video_out) < 0) + struct vo *vo = mpctx->video_out; + if (vo_redraw_frame(vo) < 0) return -1; - mpctx->osd->vo_sub_pts = mpctx->video_pts; - // NOTE: probably should use VO ctrl directly, and/or check if a filter does - // OSD rendering (a filter can't redraw anything here) - vf->control(vf, VFCTRL_DRAW_OSD, mpctx->osd); - vo_osd_reset_changed(); - vo_flip_page(mpctx->video_out, 0, -1); + mpctx->osd->vo_pts = mpctx->video_pts; + vo_draw_osd(vo, mpctx->osd); + osd_reset_changed(mpctx->osd); + + vo_flip_page(vo, 0, -1); return 0; } @@ -3160,10 +3158,10 @@ static void run_playloop(struct MPContext *mpctx) mpctx->video_pts = sh_video->pts; update_subtitles(mpctx, sh_video->pts); update_osd_msg(mpctx); - struct vf_instance *vf = sh_video->vfilter; - mpctx->osd->vo_sub_pts = mpctx->video_pts; - vf->control(vf, VFCTRL_DRAW_OSD, mpctx->osd); - vo_osd_reset_changed(); + + mpctx->osd->vo_pts = mpctx->video_pts; + vo_draw_osd(vo, mpctx->osd); + osd_reset_changed(mpctx->osd); mpctx->time_frame -= get_relative_time(mpctx); mpctx->time_frame -= vo->flip_queue_offset; @@ -3305,8 +3303,7 @@ static void run_playloop(struct MPContext *mpctx) if (sleeptime > 0) { if (!mpctx->sh_video) goto novideo; - if (vo_osd_has_changed(mpctx->osd) || mpctx->video_out->want_redraw) - { + if (osd_has_changed(mpctx->osd) || mpctx->video_out->want_redraw) { if (redraw_osd(mpctx) < 0) { if (mpctx->paused && video_left) add_step_frame(mpctx); |