summaryrefslogtreecommitdiffstats
path: root/libmpcodecs
diff options
context:
space:
mode:
authorgpoirier <gpoirier@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-11-19 19:17:51 +0000
committergpoirier <gpoirier@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-11-19 19:17:51 +0000
commitdbbe73116c5b2f09a2d72e5f8fe2069a8657e1ea (patch)
tree18d7c754024795309a1e1a2e3a9cd557ab55725e /libmpcodecs
parentcb6ba13ba97d4c9d9b1f6fc841acda3b23eab0c2 (diff)
downloadmpv-dbbe73116c5b2f09a2d72e5f8fe2069a8657e1ea.tar.bz2
mpv-dbbe73116c5b2f09a2d72e5f8fe2069a8657e1ea.tar.xz
allows to de- and reactivate yadif on the fly
Patch by Carl Eugen Hoyos % cehoyos A rainbow P studorg P tuwien P ac P at % Original thread: date: Nov 17, 2006 7:38 PM subject: [MPlayer-dev-eng] De- and reactivate yadif git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@21076 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/vf_yadif.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/libmpcodecs/vf_yadif.c b/libmpcodecs/vf_yadif.c
index 522918b463..7f505cf27e 100644
--- a/libmpcodecs/vf_yadif.c
+++ b/libmpcodecs/vf_yadif.c
@@ -54,6 +54,7 @@ struct vf_priv_s {
mp_image_t *buffered_mpi;
int stride[3];
uint8_t *ref[4][3];
+ int do_deinterlace;
};
static void (*filter_line)(struct vf_priv_s *p, uint8_t *dst, uint8_t *prev, uint8_t *cur, uint8_t *next, int w, int refs, int parity);
@@ -410,7 +411,9 @@ static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts){
vf->priv->buffered_i = 0;
vf->priv->buffered_pts = pts;
- return continue_buffered_image(vf);
+ return vf->priv->do_deinterlace?
+ continue_buffered_image(vf):
+ vf_next_put_image(vf, mpi, pts);
}
static int continue_buffered_image(struct vf_instance_s *vf)
@@ -469,6 +472,18 @@ 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->config=config;
@@ -476,10 +491,12 @@ static int open(vf_instance_t *vf, char* args){
vf->query_format=query_format;
vf->uninit=uninit;
vf->priv=malloc(sizeof(struct vf_priv_s));
+ vf->control=control;
memset(vf->priv, 0, sizeof(struct vf_priv_s));
vf->priv->mode=0;
vf->priv->parity= -1;
+ vf->priv->do_deinterlace=1;
if (args) sscanf(args, "%d:%d", &vf->priv->mode, &vf->priv->parity);