[FFmpeg-devel] [PATCH] Implement a cmdutils functions for listing available elements

Stefano Sabatini stefano.sabatini-lala
Wed Nov 18 21:09:34 CET 2009


On date Wednesday 2009-11-18 00:43:40 +0100, Michael Niedermayer encoded:
> On Sun, Nov 15, 2009 at 12:40:21PM +0100, Stefano Sabatini wrote:
> > On date Sunday 2009-11-15 01:38:28 +0100, Michael Niedermayer encoded:
> > > On Sun, Nov 15, 2009 at 12:51:56AM +0100, Stefano Sabatini wrote:
> > > > On date Sunday 2009-11-15 00:10:22 +0100, Michael Niedermayer encoded:
> > > > > On Sat, Nov 14, 2009 at 05:35:28PM +0100, Stefano Sabatini wrote:
> > > > > > On date Saturday 2009-11-14 11:53:30 +0100, Michael Niedermayer encoded:
> > > [...]
> > > > > > +
> > > > > > +    return 0;
> > > > > > +}
> > > > > > +
> > > > > >  int opt_loglevel(const char *opt, const char *arg)
> > > > > >  {
> > > > > >      const struct { const char *name; int level; } log_levels[] = {
> > > > > > Index: ffmpeg/cmdutils.h
> > > > > > ===================================================================
> > > > > > --- ffmpeg.orig/cmdutils.h	2009-11-14 17:09:02.000000000 +0100
> > > > > > +++ ffmpeg/cmdutils.h	2009-11-14 17:09:25.000000000 +0100
> > > > > > @@ -56,6 +56,15 @@
> > > > > >  int opt_loglevel(const char *opt, const char *arg);
> > > > > >  
> > > > > >  /**
> > > > > > + * Lists available elements. Exits from the application if the
> > > > > > + * value in arg is not supported.
> > > > > > + *
> > > > > > + * @param opt the name of the option associated to the function
> > > > > > + * @param arg the name of the elements to show
> > > > > > + */
> > > > > > +int opt_list(const char *opt, const char *arg);
> > > > > 
> > > > > This function does not do what you describe
> > 
> > To me it looks correct, 
> 
> > now it just implements the second part of the
> > description " Exits from the application if the value in arg is not
> > supported.".
> 
> thats like saying printf() is correctly implemented if it just returns

Would be acceptable to define the function only when defining the
first handler? I avoided that in the first time because I was trying to
minimize each patch.

> > > > Furthermore this trial-and-error process has proved frustrating and
> > > > time-consumming, and you still didn't make clear if you are going to
> > > > accept the overall change (having a -list option replacing the
> > > > -formats one, rationale in the first mail), if we don't agree on that
> > > > then there is no point for me into continuing to push patches.
> > > 
> > > iam ok with the idea of formats -> several lists
> 
> several lists like -list-codecs -list-...

What's the advantage of having many options rather than just one? Also
having one option would allow tricks of the kind: -list help or -list
formats+codecs -list all.

Also if you're trying to keep the -formats option we can do like in
the attached patch.

First patch makes the bitstreams listing in -formats show one entry per
line, makes it more readable and consistent with the other listing.

Regards.
-- 
FFmpeg = Forgiving & Faithless Mystic Pitiless Eager Ghost
-------------- next part --------------
A non-text attachment was scrubbed...
Name: print-bsf-one-per-line.patch
Type: text/x-diff
Size: 459 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20091118/394adc3c/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: impl-opt-list.patch
Type: text/x-diff
Size: 4463 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20091118/394adc3c/attachment-0001.patch>



More information about the ffmpeg-devel mailing list