summaryrefslogtreecommitdiffstats
path: root/video/filter/vf_vo.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/filter/vf_vo.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/filter/vf_vo.c')
-rw-r--r--video/filter/vf_vo.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/video/filter/vf_vo.c b/video/filter/vf_vo.c
index 5edd2956c6..22fa38f8d0 100644
--- a/video/filter/vf_vo.c
+++ b/video/filter/vf_vo.c
@@ -37,22 +37,18 @@ struct vf_priv_s {
};
#define video_out (vf->priv->vo)
-static int config(struct vf_instance *vf,
- int width, int height, int d_width, int d_height,
- unsigned int flags, unsigned int outfmt)
+static int reconfig(struct vf_instance *vf, struct mp_image_params *p, int flags)
{
-
- if ((width <= 0) || (height <= 0) || (d_width <= 0) || (d_height <= 0)) {
+ if (p->w <= 0 || p->h <= 0 || p->d_w <= 0 || p->d_h <= 0) {
mp_msg(MSGT_CPLAYER, MSGL_ERR, "VO: invalid dimensions!\n");
- return 0;
+ return -1;
}
const vo_info_t *info = video_out->driver->info;
mp_msg(MSGT_CPLAYER, MSGL_INFO, "VO: [%s] %dx%d => %dx%d %s %s%s\n",
info->short_name,
- width, height,
- d_width, d_height,
- vo_format_name(outfmt),
+ p->w, p->h, p->d_w, p->d_h,
+ vo_format_name(p->imgfmt),
(flags & VOFLAG_FULLSCREEN) ? " [fs]" : "",
(flags & VOFLAG_FLIPPING) ? " [flip]" : "");
mp_msg(MSGT_CPLAYER, MSGL_V, "VO: Description: %s\n", info->name);
@@ -60,10 +56,7 @@ static int config(struct vf_instance *vf,
if (info->comment && strlen(info->comment) > 0)
mp_msg(MSGT_CPLAYER, MSGL_V, "VO: Comment: %s\n", info->comment);
- if (vo_config(video_out, width, height, d_width, d_height, flags, outfmt))
- return 0;
-
- return 1;
+ return vo_reconfig(video_out, p, flags);
}
static int control(struct vf_instance *vf, int request, void *data)
@@ -120,7 +113,7 @@ static void uninit(struct vf_instance *vf)
static int vf_open(vf_instance_t *vf, char *args)
{
- vf->config = config;
+ vf->reconfig = reconfig;
vf->control = control;
vf->query_format = query_format;
vf->uninit = uninit;