diff options
author | cehoyos <cehoyos@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-03-22 10:06:34 +0000 |
---|---|---|
committer | cehoyos <cehoyos@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2007-03-22 10:06:34 +0000 |
commit | 90a29e3adeb5be3f2627007f66d2708018768d6c (patch) | |
tree | 5571728d5d6ed08b2ba227733322ce23b7d05257 /libmpcodecs | |
parent | 65b9ac6426f84390c1e3e2a987381eea6f5c1f67 (diff) | |
download | mpv-90a29e3adeb5be3f2627007f66d2708018768d6c.tar.bz2 mpv-90a29e3adeb5be3f2627007f66d2708018768d6c.tar.xz |
allows to de- and reactivate kerndeint on the fly
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22775 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs')
-rw-r--r-- | libmpcodecs/vf_kerndeint.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/libmpcodecs/vf_kerndeint.c b/libmpcodecs/vf_kerndeint.c index ed41068a48..f512601fb3 100644 --- a/libmpcodecs/vf_kerndeint.c +++ b/libmpcodecs/vf_kerndeint.c @@ -43,6 +43,7 @@ struct vf_priv_s { int thresh; int sharp; int twoway; + int do_deinterlace; }; @@ -97,11 +98,15 @@ static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts){ int map = vf->priv->map; int sharp = vf->priv->sharp; int twoway = vf->priv->twoway; + mp_image_t *dmpi, *pmpi; - mp_image_t *dmpi=vf_get_image(vf->next,mpi->imgfmt, + if(!vf->priv->do_deinterlace) + return vf_next_put_image(vf, mpi, pts); + + dmpi=vf_get_image(vf->next,mpi->imgfmt, MP_IMGTYPE_IP, MP_IMGFLAG_ACCEPT_STRIDE, mpi->w,mpi->h); - mp_image_t *pmpi=vf_get_image(vf->next,mpi->imgfmt, + pmpi=vf_get_image(vf->next,mpi->imgfmt, MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, mpi->w,mpi->h); if(!dmpi) return 0; @@ -287,8 +292,22 @@ static int query_format(struct vf_instance_s* vf, unsigned int fmt){ return 0; } +static int control(struct vf_instance_s* vf, int request, void* data){ + switch (request) + { + case VFCTRL_GET_DEINTERLACE: + *(int*)data = vf->priv->do_deinterlace; + return CONTROL_OK; + case VFCTRL_SET_DEINTERLACE: + vf->priv->do_deinterlace = *(int*)data; + return CONTROL_OK; + } + return vf_next_control (vf, request, data); +} + static int open(vf_instance_t *vf, char* args){ + vf->control=control; vf->config=config; vf->put_image=put_image; vf->query_format=query_format; @@ -303,6 +322,7 @@ static int open(vf_instance_t *vf, char* args){ vf->priv->thresh = 10; vf->priv->sharp = 0; vf->priv->twoway = 0; + vf->priv->do_deinterlace=1; if (args) { |