diff options
author | wm4 <wm4@nowhere> | 2014-06-15 20:46:57 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-06-15 20:53:15 +0200 |
commit | 716285782d5e4b264e18e253e9d58980183c76c6 (patch) | |
tree | b03e6e0ead71828f9d68bdebe777a808bee5d26f /video/out/vo_opengl_old.c | |
parent | d88aca6fb2474617136b09c2f281860d6a0a1a38 (diff) | |
download | mpv-716285782d5e4b264e18e253e9d58980183c76c6.tar.bz2 mpv-716285782d5e4b264e18e253e9d58980183c76c6.tar.xz |
video/out: change aspects of OSD handling
Let the VOs draw the OSD on their own, instead of making OSD drawing a
separate VO driver call. Further, let it be the VOs responsibility to
request subtitles with the correct PTS. We also basically allow the VO
to request OSD/subtitles at any time.
OSX changes untested.
Diffstat (limited to 'video/out/vo_opengl_old.c')
-rw-r--r-- | video/out/vo_opengl_old.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/video/out/vo_opengl_old.c b/video/out/vo_opengl_old.c index ea04283376..3f9e4b0f38 100644 --- a/video/out/vo_opengl_old.c +++ b/video/out/vo_opengl_old.c @@ -59,6 +59,7 @@ struct gl_priv { int scaled_osd; struct mpgl_osd *osd; int osd_color; + double osd_pts; int use_ycbcr; int use_yuv; @@ -1451,7 +1452,7 @@ static void update_yuvconv(struct vo *vo) } } -static void draw_osd(struct vo *vo, struct osd_state *osd) +static void draw_osd(struct vo *vo) { struct gl_priv *p = vo->priv; GL *gl = p->gl; @@ -1475,7 +1476,7 @@ static void draw_osd(struct vo *vo, struct osd_state *osd) gl->Color4ub((p->osd_color >> 16) & 0xff, (p->osd_color >> 8) & 0xff, p->osd_color & 0xff, 0xff - (p->osd_color >> 24)); - mpgl_osd_draw_legacy(p->osd, osd, res); + mpgl_osd_draw_legacy(p->osd, p->osd_pts, res); if (p->scaled_osd) gl->PopMatrix(); @@ -1686,7 +1687,7 @@ static int initGl(struct vo *vo, uint32_t d_width, uint32_t d_height) } if (gl->BindTexture) { - p->osd = mpgl_osd_init(gl, vo->log, true); + p->osd = mpgl_osd_init(gl, vo->log, vo->osd); p->osd->scaled = p->scaled_osd; } @@ -1782,6 +1783,8 @@ static void do_render(struct vo *vo) } if (p->is_yuv || p->custom_prog) glDisableYUVConversion(gl, p->target, p->yuvconvtype); + + draw_osd(vo); } static void flip_page(struct vo *vo) @@ -1906,6 +1909,8 @@ static void draw_image(struct vo *vo, mp_image_t *mpi) struct gl_priv *p = vo->priv; GL *gl = p->gl; + p->osd_pts = mpi->pts; + int slice = p->slice_height; int stride[3]; unsigned char *planes[3]; @@ -2166,7 +2171,6 @@ const struct vo_driver video_out_opengl_old = { .reconfig = reconfig, .control = control, .draw_image = draw_image, - .draw_osd = draw_osd, .flip_page = flip_page, .uninit = uninit, .priv_size = sizeof(struct gl_priv), |