diff options
author | wm4 <wm4@nowhere> | 2013-06-08 01:35:44 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-06-28 20:34:46 +0200 |
commit | 3382a6f6e48c7e093c2b7e0e4a0e28b60a084358 (patch) | |
tree | cc50df6d6ae5ffa6b1f7d3eb4e816a3afcfd1641 /video/out/gl_video.c | |
parent | 823e0c511bea235be06d5e2037ef9d0b345d9405 (diff) | |
download | mpv-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/gl_video.c')
-rw-r--r-- | video/out/gl_video.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/video/out/gl_video.c b/video/out/gl_video.c index 4d780f41d8..658c531546 100644 --- a/video/out/gl_video.c +++ b/video/out/gl_video.c @@ -1848,17 +1848,19 @@ bool gl_video_check_format(int mp_format) return init_format(mp_format, NULL); } -void gl_video_config(struct gl_video *p, int format, int w, int h, int dw, int dh) +void gl_video_config(struct gl_video *p, struct mp_image_params *params) { - if (p->image_format != format || p->image_w != w || p->image_h != h) { + if (p->image_format != params->imgfmt || p->image_w != params->w || + p->image_h != params->h) + { uninit_video(p); - p->image_w = w; - p->image_h = h; - init_format(format, p); + p->image_w = params->w; + p->image_h = params->h; + init_format(params->imgfmt, p); init_video(p); } - p->image_dw = dw; - p->image_dh = dh; + p->image_dw = params->d_w; + p->image_dh = params->d_h; } void gl_video_set_output_depth(struct gl_video *p, int r, int g, int b) |