diff options
author | wm4 <wm4@nowhere> | 2013-03-01 11:16:01 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-03-01 11:16:01 +0100 |
commit | d511ef79a09fa9e42479e66f4837daaa68b7255b (patch) | |
tree | 9df1d56baf902583387317af3070152c6de40f0c /video/out/vo_opengl_old.c | |
parent | 6b3d510165201e5600e9ec25c37f33541c03f58a (diff) | |
download | mpv-d511ef79a09fa9e42479e66f4837daaa68b7255b.tar.bz2 mpv-d511ef79a09fa9e42479e66f4837daaa68b7255b.tar.xz |
core: simplify OSD capability handling, remove VFCAP_OSD
VFCAP_OSD was used to determine at runtime whether the VO supports OSD
rendering. This was mostly unused. vo_direct3d had an option to disable
OSD (was supposed to allow to force auto-insertion of vf_ass, but we
removed that anyway). vo_opengl_old could disable OSD rendering when a
very old OpenGL version was detected, and had an option to explicitly
disable it as well.
Remove VFCAP_OSD from everything (and some associated logic). Now the
vo_driver.draw_osd callback can be set to NULL to indicate missing OSD
support (important so that vo_null etc. don't single-step on OSD
redraw), and if OSD support depends on runtime support, the VO's
draw_osd should just do nothing if OSD is not available.
Also, do not access vo->want_redraw directly. Change the want_redraw
reset logic for this purpose, too. (Probably unneeded, vo_flip_page
resets it already.)
Diffstat (limited to 'video/out/vo_opengl_old.c')
-rw-r--r-- | video/out/vo_opengl_old.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/video/out/vo_opengl_old.c b/video/out/vo_opengl_old.c index 80175c516b..0f286dc72a 100644 --- a/video/out/vo_opengl_old.c +++ b/video/out/vo_opengl_old.c @@ -55,7 +55,6 @@ struct gl_priv { int allow_sw; - int use_osd; int scaled_osd; struct mpgl_osd *osd; int osd_color; @@ -1468,9 +1467,8 @@ static void draw_osd(struct vo *vo, struct osd_state *osd) { struct gl_priv *p = vo->priv; GL *gl = p->gl; - assert(p->osd); - if (!p->use_osd) + if (!p->osd) return; if (!p->scaled_osd) { @@ -1572,8 +1570,6 @@ static void autodetectGlExtensions(struct vo *vo) && strstr(renderer, "Mesa DRI R200") ? 1 : 0; } } - if (p->use_osd == -1) - p->use_osd = gl->BindTexture != NULL; if (p->use_yuv == -1) p->use_yuv = glAutodetectYUVConversion(gl); @@ -1711,8 +1707,10 @@ static int initGl(struct vo *vo, uint32_t d_width, uint32_t d_height) update_yuvconv(vo); } - p->osd = mpgl_osd_init(gl, true); - p->osd->scaled = p->scaled_osd; + if (gl->BindTexture) { + p->osd = mpgl_osd_init(gl, true); + p->osd->scaled = p->scaled_osd; + } resize(vo, d_width, d_height); @@ -2068,8 +2066,6 @@ static int query_format(struct vo *vo, uint32_t format) int depth = desc.plane_bits; int caps = VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW | VFCAP_FLIP; - if (p->use_osd) - caps |= VFCAP_OSD; if (format == IMGFMT_RGB24 || format == IMGFMT_RGBA) return caps; if (p->use_yuv && (desc.flags & MP_IMGFLAG_YUV_P) && @@ -2115,7 +2111,6 @@ static int preinit(struct vo *vo, const char *arg) *p = (struct gl_priv) { .many_fmts = 1, - .use_osd = -1, .use_yuv = -1, .colorspace = MP_CSP_DETAILS_DEFAULTS, .filter_strength = 0.5, @@ -2138,7 +2133,6 @@ static int preinit(struct vo *vo, const char *arg) const opt_t subopts[] = { {"manyfmts", OPT_ARG_BOOL, &p->many_fmts, NULL}, - {"osd", OPT_ARG_BOOL, &p->use_osd, NULL}, {"scaled-osd", OPT_ARG_BOOL, &p->scaled_osd, NULL}, {"ycbcr", OPT_ARG_BOOL, &p->use_ycbcr, NULL}, {"slice-height", OPT_ARG_INT, &p->slice_height, int_non_neg}, @@ -2178,8 +2172,6 @@ static int preinit(struct vo *vo, const char *arg) " Disable extended color formats for OpenGL 1.2 and later\n" " slice-height=<0-...>\n" " Slice size for texture transfer, 0 for whole image\n" - " noosd\n" - " Do not use OpenGL OSD code\n" " scaled-osd\n" " Render OSD at movie resolution and scale it\n" " rectangle=<0,1,2>\n" |