summaryrefslogtreecommitdiffstats
path: root/video/out/vo_opengl.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-06-15 20:46:57 +0200
committerwm4 <wm4@nowhere>2014-06-15 20:53:15 +0200
commit716285782d5e4b264e18e253e9d58980183c76c6 (patch)
treeb03e6e0ead71828f9d68bdebe777a808bee5d26f /video/out/vo_opengl.c
parentd88aca6fb2474617136b09c2f281860d6a0a1a38 (diff)
downloadmpv-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.c')
-rw-r--r--video/out/vo_opengl.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/video/out/vo_opengl.c b/video/out/vo_opengl.c
index 37c890ddbe..cfbd0e590f 100644
--- a/video/out/vo_opengl.c
+++ b/video/out/vo_opengl.c
@@ -111,17 +111,6 @@ static void flip_page(struct vo *vo)
mpgl_unlock(p->glctx);
}
-static void draw_osd(struct vo *vo, struct osd_state *osd)
-{
- struct gl_priv *p = vo->priv;
-
- mpgl_lock(p->glctx);
-
- gl_video_draw_osd(p->renderer, osd);
-
- mpgl_unlock(p->glctx);
-}
-
static void draw_image(struct vo *vo, mp_image_t *mpi)
{
struct gl_priv *p = vo->priv;
@@ -132,6 +121,7 @@ static void draw_image(struct vo *vo, mp_image_t *mpi)
mpgl_lock(p->glctx);
gl_video_upload_image(p->renderer, mpi);
gl_video_render_frame(p->renderer);
+ gl_video_draw_osd(p->renderer);
mpgl_unlock(p->glctx);
}
@@ -380,6 +370,7 @@ static int control(struct vo *vo, uint32_t request, void *data)
case VOCTRL_REDRAW_FRAME:
mpgl_lock(p->glctx);
gl_video_render_frame(p->renderer);
+ gl_video_draw_osd(p->renderer);
mpgl_unlock(p->glctx);
return true;
case VOCTRL_SET_COMMAND_LINE: {
@@ -434,7 +425,7 @@ static int preinit(struct vo *vo)
if (p->gl->SwapInterval)
p->gl->SwapInterval(p->swap_interval);
- p->renderer = gl_video_init(p->gl, vo->log);
+ p->renderer = gl_video_init(p->gl, vo->log, vo->osd);
gl_video_set_output_depth(p->renderer, p->glctx->depth_r, p->glctx->depth_g,
p->glctx->depth_b);
gl_video_set_options(p->renderer, p->renderer_opts);
@@ -474,7 +465,6 @@ const struct vo_driver video_out_opengl = {
.reconfig = reconfig,
.control = control,
.draw_image = draw_image,
- .draw_osd = draw_osd,
.flip_page = flip_page,
.uninit = uninit,
.priv_size = sizeof(struct gl_priv),
@@ -490,7 +480,6 @@ const struct vo_driver video_out_opengl_hq = {
.reconfig = reconfig,
.control = control,
.draw_image = draw_image,
- .draw_osd = draw_osd,
.flip_page = flip_page,
.uninit = uninit,
.priv_size = sizeof(struct gl_priv),