diff options
author | Uoti Urpala <uau@mplayer2.org> | 2011-12-05 06:36:20 +0200 |
---|---|---|
committer | Uoti Urpala <uau@mplayer2.org> | 2011-12-06 07:47:35 +0200 |
commit | 253f62c564443b93604f4bac610c6e7dc7f58824 (patch) | |
tree | 5271e93ea67928f6f5db5c34189cb9190a61116d /libvo/vo_xv.c | |
parent | ad0348cf0a7459c0581deaf3ed7d8b73a12cc73f (diff) | |
download | mpv-253f62c564443b93604f4bac610c6e7dc7f58824.tar.bz2 mpv-253f62c564443b93604f4bac610c6e7dc7f58824.tar.xz |
core, vo: new window refresh logic, add slow-video OSD redraw
Remove code refreshing window contents after events such as resize
from vo_vdpau, vo_gl and vo_xv. Instead have them simply set a flag
indicating that a refresh is needed, and have the player core perform
that refresh by doing an OSD redraw. Also add support for updating the
OSD contents over existing frames during slow-but-not-paused playback.
The VOs now also request a refresh if parameters affecting the picture
change (equalizer settings, colormatrix, VDPAU deinterlacing setting).
Even previously the picture was typically redrawn with the new
settings while paused because new OSD messages associated with setting
changes triggered a redraw, but this did not happen if OSD was turned
off.
A minor imperfection is that now window system events can trigger a
single one-frame step forward when using vo_xv after pausing so that
vo_xv does not yet have a copy of the current image. This could be
fixed but I think it's not important enough to bother.
Diffstat (limited to 'libvo/vo_xv.c')
-rw-r--r-- | libvo/vo_xv.c | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/libvo/vo_xv.c b/libvo/vo_xv.c index 4d1a354937..d43244e85d 100644 --- a/libvo/vo_xv.c +++ b/libvo/vo_xv.c @@ -418,18 +418,11 @@ static void copy_backup_image(struct vo *vo, int dest, int src) static void check_events(struct vo *vo) { - struct xvctx *ctx = vo->priv; int e = vo_x11_check_events(vo); - if (e & VO_EVENT_EXPOSE || e & VO_EVENT_RESIZE) + if (e & VO_EVENT_EXPOSE || e & VO_EVENT_RESIZE) { resize(vo); - - if ((e & VO_EVENT_EXPOSE || e & VO_EVENT_RESIZE) && ctx->is_paused) { - /* did we already draw a buffer */ - if (ctx->visible_buf != -1) { - /* redraw the last visible buffer */ - put_xvimage(vo, ctx->xvimage[ctx->visible_buf]); - } + vo->want_redraw = true; } } @@ -833,20 +826,20 @@ static int control(struct vo *vo, uint32_t request, void *data) case VOCTRL_SET_PANSCAN: resize(vo); return VO_TRUE; - case VOCTRL_SET_EQUALIZER: - { - struct voctrl_set_equalizer_args *args = data; - return vo_xv_set_eq(vo, x11->xv_port, args->name, args->value); - } - case VOCTRL_GET_EQUALIZER: - { - struct voctrl_get_equalizer_args *args = data; - return vo_xv_get_eq(vo, x11->xv_port, args->name, args->valueptr); - } + case VOCTRL_SET_EQUALIZER: { + vo->want_redraw = true; + struct voctrl_set_equalizer_args *args = data; + return vo_xv_set_eq(vo, x11->xv_port, args->name, args->value); + } + case VOCTRL_GET_EQUALIZER: { + struct voctrl_get_equalizer_args *args = data; + return vo_xv_get_eq(vo, x11->xv_port, args->name, args->valueptr); + } case VOCTRL_SET_YUV_COLORSPACE:; struct mp_csp_details* given_cspc = data; int is_709 = given_cspc->format == MP_CSP_BT_709; vo_xv_set_eq(vo, x11->xv_port, "bt_709", is_709 * 200 - 100); + vo->want_redraw = true; return true; case VOCTRL_GET_YUV_COLORSPACE:; struct mp_csp_details* cspc = data; |