summaryrefslogtreecommitdiffstats
path: root/video/out/vo.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-03-01 11:16:01 +0100
committerwm4 <wm4@nowhere>2013-03-01 11:16:01 +0100
commitd511ef79a09fa9e42479e66f4837daaa68b7255b (patch)
tree9df1d56baf902583387317af3070152c6de40f0c /video/out/vo.c
parent6b3d510165201e5600e9ec25c37f33541c03f58a (diff)
downloadmpv-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.c')
-rw-r--r--video/out/vo.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/video/out/vo.c b/video/out/vo.c
index 76c71518e6..6fff185c6c 100644
--- a/video/out/vo.c
+++ b/video/out/vo.c
@@ -176,12 +176,20 @@ int vo_redraw_frame(struct vo *vo)
if (!vo->config_ok || !vo->hasframe)
return -1;
if (vo_control(vo, VOCTRL_REDRAW_FRAME, NULL) == true) {
+ vo->want_redraw = false;
vo->redrawing = true;
return 0;
}
return -1;
}
+bool vo_get_want_redraw(struct vo *vo)
+{
+ if (!vo->config_ok || !vo->hasframe)
+ return false;
+ return vo->want_redraw;
+}
+
int vo_get_buffered_frame(struct vo *vo, bool eof)
{
if (!vo->config_ok)
@@ -216,7 +224,7 @@ void vo_new_frame_imminent(struct vo *vo)
void vo_draw_osd(struct vo *vo, struct osd_state *osd)
{
- if (vo->config_ok && (vo->default_caps & VFCAP_OSD))
+ if (vo->config_ok && vo->driver->draw_osd)
vo->driver->draw_osd(vo, osd);
}
@@ -428,14 +436,10 @@ int vo_config(struct vo *vo, uint32_t width, uint32_t height,
d_height = vo->dheight;
}
- vo->default_caps = vo->driver->query_format(vo, format);
-
int ret = vo->driver->config(vo, width, height, d_width, d_height, flags,
format);
vo->config_ok = (ret == 0);
vo->config_count += vo->config_ok;
- if (!vo->config_ok)
- vo->default_caps = 0;
if (vo->registered_fd == -1 && vo->event_fd != -1 && vo->config_ok) {
mp_input_add_key_fd(vo->input_ctx, vo->event_fd, 1, event_fd_callback,
NULL, vo);