[FFmpeg-devel] [PATCH] show-banner and show-license as cmdutils.c functions

Michael Niedermayer michaelni
Tue Aug 7 18:02:39 CEST 2007


On Tue, Aug 07, 2007 at 12:13:25PM +0200, Stefano Sabatini wrote:
[...]
> > [...]
> > > @@ -3780,6 +3781,11 @@
> > >  }
> > >  #endif
> > >  
> > > +/* required for the inclusion of cmdutils.h */
> > > +void parse_arg_file(const char *filename)
> > > +{
> > > +}
> > > +
> > 
> > ugly hack
> 
> Agree, but I couldn't find a better way to manage it.
> What about to make cmdutils.c:parse_options like this:
> 
> void parse_options(int argc, char **argv, const OptionDef *options,(void (*)(const char *))parse_arg_function)
>  
> when parse_arg_function specifyies which function has to be executed
> on a bare arg, and manage the case when is parse_arg_function ==
> NULL (as would be in the ffserver case)?

ok


> 
> > >  static int parse_ffconfig(const char *filename)
> > >  {
> > >      FILE *f;
> > > @@ -4441,14 +4447,9 @@
> > >          return 0;
> > >  }
> > >  
> > > -static void show_banner(void)
> > > -{
> > > -    printf("ffserver version " FFMPEG_VERSION ", Copyright (c) 2000-2006 Fabrice Bellard, et al.\n");
> > > -}
> > > -
> > >  static void show_help(void)
> > >  {
> > > -    show_banner();
> > > +    show_ffmpeg_banner(stderr);
> > 
> > stdout->stderr change
> > 
> > also ffmpeg != ffserver, the code does not display the same thing after this
> [...]
> 
> In all the ff* applications the banner shows FFMPEG_VERSION, in the
> case of ffmpeg it also displays the libav[cfu] versions, so it seems
> safe to me to have just a common banner function that shows them all: or
> eventually we can have an argument inside ffmpeg_show_banner that
> takes the name of the application as argument, like this:
> 
> void show_ffmpeg_banner(FILE *stream, const char* program_name)
> {
>     fprintf(stream, "%s version " FFMPEG_VERSION ", Copyright (c) 2000-2007 Fabrice Bellard, et al.\n", program_name);
>     fprintf(stream, "  configuration: " FFMPEG_CONFIGURATION "\n");
>     fprintf(stream, "  libavutil version: " AV_STRINGIFY(LIBAVUTIL_VERSION) "\n");
>     fprintf(stream, "  libavcodec version: " AV_STRINGIFY(LIBAVCODEC_VERSION) "\n");
>     fprintf(stream, "  libavformat version: " AV_STRINGIFY(LIBAVFORMAT_VERSION) "\n");
>     fprintf(stream, "  built on " __DATE__ " " __TIME__);
> #ifdef __GNUC__
>     fprintf(stream, ", gcc: " __VERSION__ "\n");
> #else
>     fprintf(stream, ", using a non-gcc compiler\n");
> #endif
> }
> 
> Where to print the banner?
> 
> Current situation:
> application | banner/version output destination |
> =================================================
> ffplay      | stdout
> ffserver    | stdout
> ffmpeg      | stderr
> 
> I prefer to print it on stderr, but on stdout when it is explicitly
> requested the version of the program (for example by a "-version"
> option), anyway the behaviour should be consistent across the various
> ff* tools.

ok


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

It is dangerous to be right in matters on which the established authorities
are wrong. -- Voltaire
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070807/0b493308/attachment.pgp>



More information about the ffmpeg-devel mailing list