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

Alban Bedel albeu at free.fr
Sat Mar 15 11:20:35 CET 2003


Hi D Richard Felker III,

on Fri, 14 Mar 2003 20:12:14 -0500 you wrote:

> On Fri, Mar 14, 2003 at 08:06:37PM +0100, Alban Bedel wrote:
> > > > 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]?
> > The [] or {} are needed to distinct with the old syntax wich work.
> 
> My idea would just be to have the parser separate the arguments at :
> boundaries. Then, if a segment between : boundaries has an = sign in
> it, it's a new style option. Otherwise, it's interpreted as the next
> old-style option in the default order.

The problem is the flags option as they don't need a value, so no = sign.
Ex: let's say my filter have 3 options : flag1, flag2, flag3

with the new syntax : filter=flag2:flag3
with the old : filter=off:on:on

There no syntax difference, and we can't really forbid on/off (and their
varients in several languages) as options name. Another possibilty is to
requiere flag=on but that's will be confusing as suboptions doesn't work
that way.

This syntax story is annoying :((( but a solution has to be found. Whatever
for a solution we choose users will get confused from something that seems
strange. Forcing to use values for flags seems to me the best way to make
everybody happy. The syntax isn't crazy, we can mix new and old style in
the same option and the 'users confusion' should be minim as few filters
have flag type options afaik. If there is no new objection i'm going to
make it work that way.

Also yesterday i started a new option kind that will allow presets. So
for ex. scale=preset=pal could directly set w and h to the correct size.
This example is simple but for more complex filters with a lot of options
it could be really nice.
	Albeu


More information about the MPlayer-dev-eng mailing list