summaryrefslogtreecommitdiffstats
path: root/libvo/vo_gl.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@mplayer2.org>2011-12-05 06:36:20 +0200
committerUoti Urpala <uau@mplayer2.org>2011-12-06 07:47:35 +0200
commit253f62c564443b93604f4bac610c6e7dc7f58824 (patch)
tree5271e93ea67928f6f5db5c34189cb9190a61116d /libvo/vo_gl.c
parentad0348cf0a7459c0581deaf3ed7d8b73a12cc73f (diff)
downloadmpv-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_gl.c')
-rw-r--r--libvo/vo_gl.c25
1 files changed, 5 insertions, 20 deletions
diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c
index ec6e6573e6..08868246e5 100644
--- a/libvo/vo_gl.c
+++ b/libvo/vo_gl.c
@@ -127,8 +127,6 @@ struct gl_priv {
int mipmap_gen;
int stereo_mode;
- int int_pause;
-
struct mp_csp_equalizer video_eq;
int texture_width;
@@ -140,8 +138,6 @@ struct gl_priv {
unsigned int slice_height;
};
-static void redraw(struct vo *vo);
-
static void resize(struct vo *vo, int x, int y)
{
struct gl_priv *p = vo->priv;
@@ -185,7 +181,7 @@ static void resize(struct vo *vo, int x, int y)
vo_osd_changed(OSDTYPE_OSD);
}
gl->Clear(GL_COLOR_BUFFER_BIT);
- redraw(vo);
+ vo->want_redraw = true;
}
static void texSize(struct vo *vo, int w, int h, int *texw, int *texh)
@@ -699,8 +695,8 @@ static void check_events(struct vo *vo)
}
if (e & VO_EVENT_RESIZE)
resize(vo, vo->dwidth, vo->dheight);
- if (e & VO_EVENT_EXPOSE && p->int_pause)
- redraw(vo);
+ if (e & VO_EVENT_EXPOSE)
+ vo->want_redraw = true;
}
/**
@@ -900,15 +896,6 @@ static void flip_page(struct vo *vo)
}
}
-static void redraw(struct vo *vo)
-{
- if (vo_doublebuffering) {
- do_render(vo);
- do_render_osd(vo, RENDER_OSD | RENDER_EOSD);
- }
- flip_page(vo);
-}
-
static int draw_slice(struct vo *vo, uint8_t *src[], int stride[], int w, int h,
int x, int y)
{
@@ -1423,10 +1410,6 @@ static int control(struct vo *vo, uint32_t request, void *data)
struct gl_priv *p = vo->priv;
switch (request) {
- case VOCTRL_PAUSE:
- case VOCTRL_RESUME:
- p->int_pause = (request == VOCTRL_PAUSE);
- return VO_TRUE;
case VOCTRL_QUERY_FORMAT:
return query_format(vo, *(uint32_t *)data);
case VOCTRL_GET_IMAGE:
@@ -1487,6 +1470,7 @@ static int control(struct vo *vo, uint32_t request, void *data)
if (mp_csp_equalizer_set(&p->video_eq, args->name, args->value) < 0)
return VO_NOTIMPL;
update_yuvconv(vo);
+ vo->want_redraw = true;
return VO_TRUE;
}
break;
@@ -1495,6 +1479,7 @@ static int control(struct vo *vo, uint32_t request, void *data)
if (vo->config_count && supports_csp) {
p->colorspace = *(struct mp_csp_details *)data;
update_yuvconv(vo);
+ vo->want_redraw = true;
}
return VO_TRUE;
}