diff mplayer.c @ 20973:c0bcec5150a3

Add deinterlace property, patch by Carl Eugen Hoyos (cehoyos [at] rainbow studorg tuwien ac at) with small modifications by me.
author reimar
date Fri, 17 Nov 2006 18:16:21 +0000
parents fdc42ef57a58
children 123cdf4a0f73
line wrap: on
line diff
--- a/mplayer.c	Fri Nov 17 17:44:51 2006 +0000
+++ b/mplayer.c	Fri Nov 17 18:16:21 2006 +0000
@@ -1926,6 +1926,29 @@
     }
 }
 
+static int mp_property_deinterlace(m_option_t* prop,int action,void* arg) {
+    int toggle = -1;
+    vf_instance_t *vf;
+    if (!sh_video || !sh_video->vfilter) return M_PROPERTY_UNAVAILABLE;
+    vf = sh_video->vfilter;
+    switch(action) {
+    case M_PROPERTY_GET:
+        if(!arg) return M_PROPERTY_ERROR;
+        vf->control(sh_video->vfilter, VFCTRL_GET_DEINTERLACE, arg);
+        return M_PROPERTY_OK;
+    case M_PROPERTY_SET:
+        if(!arg) return M_PROPERTY_ERROR;
+        M_PROPERTY_CLAMP(prop,*(int*)arg);
+        vf->control(sh_video->vfilter, VFCTRL_SET_DEINTERLACE, arg);
+        return M_PROPERTY_OK;
+    case M_PROPERTY_STEP_UP:
+    case M_PROPERTY_STEP_DOWN:
+        vf->control(sh_video->vfilter, VFCTRL_SET_DEINTERLACE, &toggle);
+        return M_PROPERTY_OK;
+    }
+    return M_PROPERTY_NOT_IMPLEMENTED;
+}
+
 /// Panscan (RW)
 static int mp_property_panscan(m_option_t* prop,int action,void* arg) {
 
@@ -2470,6 +2493,8 @@
     // Video
     { "fullscreen", mp_property_fullscreen, CONF_TYPE_FLAG,
       M_OPT_RANGE, 0, 1, NULL },
+    { "deinterlace", mp_property_deinterlace, CONF_TYPE_FLAG,
+      M_OPT_RANGE, 0, 1, NULL },
     { "ontop", mp_property_ontop, CONF_TYPE_FLAG,
       M_OPT_RANGE, 0, 1, NULL },
     { "rootwin", mp_property_rootwin, CONF_TYPE_FLAG,