[Ffmpeg-devel] [PATCH] Pass a context to av_log() in libswscale

Michael Niedermayer michaelni
Fri Jan 5 15:42:39 CET 2007


Hi

On Fri, Jan 05, 2007 at 10:20:36AM +0100, Luca Abeni wrote:
> Hi Michael,
> 
> On Thu, 2007-01-04 at 17:48 +0100, Michael Niedermayer wrote:
> [...]
> > >  
> > > -    MSG_WARN("No accelerated colorspace conversion found\n");
> > > +    av_log(c, AV_LOG_DEBUG, "No accelerated colorspace conversion found\n");
> > 
> > hmm, shuldnt WARN->INFO rather?
> Well, in the patch I respected the current mapping, that is
> WARN  -> DEBUG
> FATAL -> ERROR
> ERR   -> ERROR
> V     -> INFO
> DBG2  -> DEBUG
> INFO  -> INFO
> 
> Is "WARN->INFO" the only needed change, or should some other mapping be
> changed? Let me know, and I'll update the patch.
> 
> > maybe we should also consider to increase the number of AV_LOG_* iam not sure
> > though
> We currently have: QUIET, ERROR, INFO, DEBUG. To have a 1->1 mapping
> with the levels used in libswscale, we would need to add FATAL, WARNING,
> and VERBOSE. I think this would result in an ABI incompatibility, so I
> am not sure if it is worth doing it.
> Anyway, if we decide to add some debug levels I'd like to do it before
> committing this patch (otherwise, I would have to change the libswscale
> code 2 times :).

hmm id suggest someting like

#if LIBAVUTIL_VERSION_INT  < (50<<16)
#define AV_LOG_QUIET -1
#define AV_LOG_FATAL 0
#define AV_LOG_ERROR 0
#define AV_LOG_WARN  1
#define AV_LOG_INFO  1
#define AV_LOG_VERBOSE 1
#define AV_LOG_DEBUG 2
#else
#define AV_LOG_QUIET    -8

/**
 * something went really wrong and we will crash now
 */
#define AV_LOG_PANIC     0

/**
 * something went wrong and recovery is not possible
 * like no header in a format which depends on it or a combination
 * of parameters which are not allowed
 */
#define AV_LOG_FATAL     8

/**
 * something went wrong and cannot losslessly be recovered but not all future data is affected
 */
#define AV_LOG_ERROR    16

/**
 * something somehow doesnt look correct / something which may or may not
 * lead to some problems like use of -vstrict -2
 */
#define AV_LOG_WARN     24

#define AV_LOG_INFO     32
#define AV_LOG_VERBOSE  40

/**
 * stuff which is only usefull for libav* developers
 */
#define AV_LOG_DEBUG    48
#endif

comments welcome (probably this should be disscussed in a seperate thread
though)


[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Breaking DRM is a little like attempting to break through a door even
though the window is wide open and the only thing in the house is a bunch
of things you dont want and which you would get tomorrow for free anyway
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070105/6be702ec/attachment.pgp>



More information about the ffmpeg-devel mailing list