[MPlayer-dev-eng] stereo3d filter

Endre Kollár taxy443 at gmail.com
Mon Oct 18 10:25:00 CEST 2010


2010/10/17 Reimar Döffinger <Reimar.Doeffinger at gmx.de>:
> On Sun, Oct 17, 2010 at 09:50:45PM +0200, Reimar Döffinger wrote:
>> On Sun, Oct 17, 2010 at 09:09:46PM +0200, Endre Kollár wrote:
>> > From: Reimar Döffinger <Reimar.Doeffinger <at> gmx.de>
>> > > On Mon, Feb 01, 2010 at 05:19:21PM +0100, Gordon Schmidt wrote:
>> > > > +    if (args) {
>> > > > +        char *arg;
>> > > > +        //input code
>> > > > +        arg = strtok(args, ": \0\n");
>> > > > +        vf->priv->in.fmt = get_arg(arg);
>> > > > +        //output code
>> > > > +        arg = strtok(NULL, ": \0\n");
>> > > > +        vf->priv->out.fmt = get_arg(arg);
>> > > > +    }
>> > >
>> > > Look at e.g. vf_scale.c and there the vf_opts_fields
>> > > for how to reuse the parsing code MPlayer already has.
>> > > Actually vf_format is probably the simples example,
>> > > it contains almost no other code.
>> > > By adding m_struct_t to vf_info_t you also don't need
>> > > to alloc and initialize vf->priv manually
>> >
>> > I can not find adequate CONF_TYPE_ type in the m_option_t structure.
>> > CONF_TYPE_INT:
>> > We want to get a string.
>> > CONF_TYPE_STRING:
>> > No filter use this.There is no example. The pp filter neither.
>>
>> It is used a lot in cfg-common.h.
>> The usage (the whole config system) is the same between filters
>> and the "main" mplayer options.
>> Also from the config parsing side it should just be a matter of
>> changing the variable type from "int" to "char *" when you want
>> a CONF_TYPE_STRING instead of CONF_TYPE_INT.
>
> And btw. a CONF_TYPE_FUNC_PARAM that converts the string directly
> into an int might actually be more suitable.
> _______________________________________________
> MPlayer-dev-eng mailing list
> MPlayer-dev-eng at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
>

vf_opts_fields context use structure offset for addressing variables.
CONF_TYPE_FUNC_PARAM not set structure member.

Solved with CONF_TYPE_OBJ_PRESETS:

static const m_option_t vf_opts_fields[] = {
  {"stereo_in", 0, CONF_TYPE_OBJ_PRESETS, 0, 0, 0,
(m_obj_presets_t*)&format_preset_in},
  {"stereo_out", 0, CONF_TYPE_OBJ_PRESETS, 0, 0, 0,
(m_obj_presets_t*)&format_preset_out},
  {"in", ST_OFF(in.fmt), CONF_TYPE_INT, 0,0,0, NULL},
  {"out", ST_OFF(out.fmt), CONF_TYPE_INT, 0,0,0, NULL},
  { NULL, NULL, 0, 0, 0, 0,  NULL }
};

A bit far-fetched, but good.


More information about the MPlayer-dev-eng mailing list