[MPlayer-dev-eng] [PATCH PROPOSAL] -vf option, or soon no more scanf in the vf's

D Richard Felker III dalias at aerifal.cx
Fri Mar 14 18:56:23 CET 2003


On Fri, Mar 14, 2003 at 06:01:11PM +0100, Alban Bedel wrote:
> 
> Hi,
> 
> I wrote the needed stuff to have something better to configure the vf's.
> That is the vf will be able to just define their options and get a
> pre-filed struct at open.
> How it work : The vf_info struct is extended with a new field (it's shit
> i know but that's really needed) wich (optionaly) contain a pointer to a
> description of the filter parameters. The config parser use these
> descriptions to check that all options for each filter are valids. If all
> options are valids a list of the wanted filters and their options is
> build. Then when the filter chain in build a config struct is created for
> each filter and setted like needed. Finnaly the filter get the config
> struct filled with all users settings at the open call.
> 
> Now we have 2 ways to pass the config struct to the vf : either via the
> arg param of the open call or make the filter describe it's private struct
> and create it for him. The former seems more logical but it conflict with
> the current system (ie we can't sanly use the same params with completly
> differents arguments). Also most of the time the priv struct contain
> not much more than the users options, so most vf will end up in just
> copying it in their priv struct. So i choosed to create the priv struct
> for the vo as it also keep the changes small atm (ie. a vf that have an
> option description should check to see if the priv field is not NULL).

I'm not sure yet if this is a good idea. Comments, anyone?

> The syntax now ;) The list is now in the right order, otherwise it's
> the same syntax. But you can also put the parameters inside [] or {}
> and use  the same syntax as the suboptions. ex :
> -vf scale=[h=500:chr-drop=2],flip

What are [] or {} needed for? And does the old in-order params syntax
still work, i.e. scale=640:480 rather than scale=[w=640:h=480]?

> Also giving help as parameter will display a list of all options.

This is total nonsense, since you have to run a dummy movie to get
help. Even more nonsense if it exits mplayer and leaves the terminal
screwed up like the old -vop pp=help.

> PS: These 'new' things only work for vf that support it (with this patch
> only scale). Others can only use the old syntax.

They also work with -vop detc since it already works that way. :)

Rich




More information about the MPlayer-dev-eng mailing list