[FFmpeg-devel] [PATCH 1/5] Change eval internal functions, ff_parse_expr() and ff_parse_and_eval_expr() interface.
Wed Apr 21 23:36:05 CEST 2010
On Wed, Apr 21, 2010 at 02:22:58AM +0200, Stefano Sabatini wrote:
> On date Tuesday 2010-04-20 02:37:55 +0200, Michael Niedermayer encoded:
> > On Tue, Apr 20, 2010 at 01:18:01AM +0200, Stefano Sabatini wrote:
> > > > > A possible solution would be to add a simple flag log_error to
> > > > > ff_parse_expr()/ff_parse_and_eval_expr().
> > > >
> > > > iam against this, its unreasonable unflexible, even a offset to the
> > > > log level would be better
> > >
> > > Problem with the map is that we don't have just 8 values for log, it
> > > is an int ranging from -8 to 48, that's why I can't grasp the 8 entry
> > > array map idea, please elaborate.
> > right, sorry, i meant something like:
> > level += map[av_clip(level>>3,...)]
> If I understood it correctly this would mean to set an ad-hoc log
> level for each log context, right?
it would allow to compensate the log level per context.
without it or a equialent system av_log() can not be used in generic utility
code ever. This also would mean all uses in libavutil would have to be
the global log level, that is for example "print errors" breaks down once
you go down into a function of some generic util, its error might not be
an error for the main application at all or it might be it all depends on
what the failure of such util means in each specific instance to the main
> > > Other ideas:
> > > // write the error message to the user-provided error buffer, allows
> > > // ad-hoc context-sensitive messages
> > > int av_parse_expr(..., const char *error, size_t error_size);
> > >
> > > or maybe we could just provide more than one interface:
> > > av_parse_expr (..., void *log_ctx);
> > > av_parse_expr2(..., const char *error, size_t error_size);
> > >
> > > Please tell me what you consider acceptable.
> > i dont like multiple interfaces, things are complex enough already
> So what about the other solution:
> int av_parse_expr(..., const char *error, size_t error_size);
this would not allow debug and warnings to be printed
av_parse_expr(..., int log_level_offset)
would still be the clearly better choice
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Old school: Use the lowest level language in which you can solve the problem
New school: Use the highest level language in which the latest supercomputer
can solve the problem without the user falling asleep waiting.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: Digital signature
More information about the ffmpeg-devel