summaryrefslogtreecommitdiffstats
path: root/video/out/vo_opengl.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-06-08 01:35:44 +0200
committerwm4 <wm4@nowhere>2013-06-28 20:34:46 +0200
commit3382a6f6e48c7e093c2b7e0e4a0e28b60a084358 (patch)
treecc50df6d6ae5ffa6b1f7d3eb4e816a3afcfd1641 /video/out/vo_opengl.c
parent823e0c511bea235be06d5e2037ef9d0b345d9405 (diff)
downloadmpv-3382a6f6e48c7e093c2b7e0e4a0e28b60a084358.tar.bz2
mpv-3382a6f6e48c7e093c2b7e0e4a0e28b60a084358.tar.xz
video: add a new method to configure filters and VOs
The filter chain and the video ouputs have config() functions. They are strictly limited to transfering the video size and format. Other parameters (like color levels) have to be transferred separately. Improve upon this by introducing a separate set of reconfig() functions, which use mp_image_params to carry format parameters. This struct contains all image format related parameters from config(), plus additional parameters such as colorspace. Change vf_rotate to use it, as well as vo_opengl. vf_rotate is just an example/test case, but vo_opengl will need it later. The intention is also to get rid of VOCTRL_SET_YUV_COLORSPACE. This information is now handed to the VOs via reconfig(). The getter, VOCTRL_GET_YUV_COLORSPACE, will still be needed though.
Diffstat (limited to 'video/out/vo_opengl.c')
-rw-r--r--video/out/vo_opengl.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/video/out/vo_opengl.c b/video/out/vo_opengl.c
index 35ea0cebb0..882689ed87 100644
--- a/video/out/vo_opengl.c
+++ b/video/out/vo_opengl.c
@@ -163,15 +163,13 @@ static void video_resize_redraw_callback(struct vo *vo, int w, int h)
}
-static int config(struct vo *vo, uint32_t width, uint32_t height,
- uint32_t d_width, uint32_t d_height, uint32_t flags,
- uint32_t format)
+static int reconfig(struct vo *vo, struct mp_image_params *params, int flags)
{
struct gl_priv *p = vo->priv;
mpgl_lock(p->glctx);
- if (!config_window(p, d_width, d_height, flags)) {
+ if (!config_window(p, vo->dwidth, vo->dheight, flags)) {
mpgl_unlock(p->glctx);
return -1;
}
@@ -180,8 +178,7 @@ static int config(struct vo *vo, uint32_t width, uint32_t height,
p->glctx->register_resize_callback(vo, video_resize_redraw_callback);
}
- gl_video_config(p->renderer, format, width, height,
- p->vo->aspdat.prew, p->vo->aspdat.preh);
+ gl_video_config(p->renderer, params);
p->vo_flipped = !!(flags & VOFLAG_FLIPPING);
@@ -378,7 +375,7 @@ const struct vo_driver video_out_opengl = {
},
.preinit = preinit,
.query_format = query_format,
- .config = config,
+ .reconfig = reconfig,
.control = control,
.draw_image = draw_image,
.draw_osd = draw_osd,
@@ -398,7 +395,7 @@ const struct vo_driver video_out_opengl_hq = {
},
.preinit = preinit,
.query_format = query_format,
- .config = config,
+ .reconfig = reconfig,
.control = control,
.draw_image = draw_image,
.draw_osd = draw_osd,