[MPlayer-dev-eng] 'D' to deinterlace

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Mon Oct 16 21:46:35 CEST 2006


Hello,
On Mon, Oct 16, 2006 at 01:07:01AM +0000, Carl Eugen Hoyos wrote:
> +#define MP_CMD_DEINTERLACE 91

> +static int mp_property_deinterlace(m_option_t* prop,int action,void* arg) {
> +    if (!sh_video || !sh_video->vfilter) return M_PROPERTY_UNAVAILABLE;
> +    ((vf_instance_t*)sh_video->vfilter)->control
> +            (sh_video->vfilter, VFCTRL_DEINTERLACE, 0);
> +}

Both property and command is not a good idea. Property would be nicer,
but a bit more effort. This implementation would not work at all, you
need a switch(action) like most other property handlers have,
implementing M_PROPERTY_GET, M_PROPERTY_SET, M_PROPERTY_STEP_UP and
M_PROPERTY_STEP_DOWN should be enough (the later two obviously having
the same implementation).
You would at least need separate VFCTRL_GET_DEINTERLACE and
VFCTRL_SET_DEINTERLAY, with e.g. SET taking as arguments 0 for disable,
1 for enable and -1 for toggle, and the GET taking a int * where the
current state is returned.

> +    { "deinterlace", mp_property_deinterlace, CONF_TYPE_FLAG,
> +      0, 0, 0, NULL },
>      { "ontop", mp_property_ontop, CONF_TYPE_FLAG,
>        M_OPT_RANGE, 0, 1, NULL },

Other flags seems to use M_OPT_RANGE, 0, 1, so I'd do the same.

> +        bob_deinterlace = 1 - bob_deinterlace;

bob_deinterlace = !bob_deinterlace;

Greetings,
Reimar Döffinger



More information about the MPlayer-dev-eng mailing list