diff options
author | wm4 <wm4@nowhere> | 2015-12-19 17:55:14 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-12-19 18:35:58 +0100 |
commit | 1f7c099dc0feb9a160d9018ad6ad068e0295341a (patch) | |
tree | fb46a991dc1cb41136d4ffab0f08f6308c9abcd6 /video/filter/vf_expand.c | |
parent | 78bfee53dd32bdc70af9294b11a04722a42b10c2 (diff) | |
download | mpv-1f7c099dc0feb9a160d9018ad6ad068e0295341a.tar.bz2 mpv-1f7c099dc0feb9a160d9018ad6ad068e0295341a.tar.xz |
vf: remove old config() callback
Diffstat (limited to 'video/filter/vf_expand.c')
-rw-r--r-- | video/filter/vf_expand.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/video/filter/vf_expand.c b/video/filter/vf_expand.c index 6d5b694613..69574efff3 100644 --- a/video/filter/vf_expand.c +++ b/video/filter/vf_expand.c @@ -55,10 +55,11 @@ static struct vf_priv_s { //===========================================================================// -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 *in, + struct mp_image_params *out) { + int width = in->w, height = in->h; + vf->priv->exp_x = vf->priv->cfg_exp_x; vf->priv->exp_y = vf->priv->cfg_exp_y; vf->priv->exp_w = vf->priv->cfg_exp_w; @@ -71,7 +72,7 @@ static int config(struct vf_instance *vf, else if( vf->priv->exp_h<height ) vf->priv->exp_h=height; if (vf->priv->aspect) { float adjusted_aspect = vf->priv->aspect; - adjusted_aspect *= ((double)width/height) / ((double)d_width/d_height); + adjusted_aspect *= ((double)width/height) / ((double)in->d_w/in->d_h); if (vf->priv->exp_h < vf->priv->exp_w / adjusted_aspect) { vf->priv->exp_h = vf->priv->exp_w / adjusted_aspect + 0.5; } else { @@ -86,15 +87,19 @@ static int config(struct vf_instance *vf, if(vf->priv->exp_x<0 || vf->priv->exp_x+width>vf->priv->exp_w) vf->priv->exp_x=(vf->priv->exp_w-width)/2; if(vf->priv->exp_y<0 || vf->priv->exp_y+height>vf->priv->exp_h) vf->priv->exp_y=(vf->priv->exp_h-height)/2; - struct mp_imgfmt_desc fmt = mp_imgfmt_get_desc(outfmt); + struct mp_imgfmt_desc fmt = mp_imgfmt_get_desc(in->imgfmt); vf->priv->exp_x = MP_ALIGN_DOWN(vf->priv->exp_x, fmt.align_x); vf->priv->exp_y = MP_ALIGN_DOWN(vf->priv->exp_y, fmt.align_y); - vf_rescale_dsize(&d_width, &d_height, width, height, + *out = *in; + out->w = vf->priv->exp_w; + out->h = vf->priv->exp_h; + + vf_rescale_dsize(&out->d_w, &out->d_h, width, height, vf->priv->exp_w, vf->priv->exp_h); - return vf_next_config(vf,vf->priv->exp_w,vf->priv->exp_h,d_width,d_height,flags,outfmt); + return 0; } static struct mp_image *filter(struct vf_instance *vf, struct mp_image *mpi) @@ -140,7 +145,7 @@ static int query_format(struct vf_instance *vf, unsigned int fmt) } static int vf_open(vf_instance_t *vf){ - vf->config=config; + vf->reconfig=reconfig; vf->query_format=query_format; vf->filter=filter; return 1; |