[FFmpeg-cvslog] r23059 - in trunk/libavutil: avutil.h log.c log.h

michael subversion
Sat May 8 22:41:20 CEST 2010


Author: michael
Date: Sat May  8 22:41:20 2010
New Revision: 23059

Log:
Add means to adjust the log level per context.

Modified:
   trunk/libavutil/avutil.h
   trunk/libavutil/log.c
   trunk/libavutil/log.h

Modified: trunk/libavutil/avutil.h
==============================================================================
--- trunk/libavutil/avutil.h	Sat May  8 18:32:05 2010	(r23058)
+++ trunk/libavutil/avutil.h	Sat May  8 22:41:20 2010	(r23059)
@@ -41,7 +41,7 @@
 
 #define LIBAVUTIL_VERSION_MAJOR 50
 #define LIBAVUTIL_VERSION_MINOR 15
-#define LIBAVUTIL_VERSION_MICRO  1
+#define LIBAVUTIL_VERSION_MICRO  2
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
                                                LIBAVUTIL_VERSION_MINOR, \

Modified: trunk/libavutil/log.c
==============================================================================
--- trunk/libavutil/log.c	Sat May  8 18:32:05 2010	(r23058)
+++ trunk/libavutil/log.c	Sat May  8 22:41:20 2010	(r23059)
@@ -89,8 +89,11 @@ static void (*av_log_callback)(void*, in
 
 void av_log(void* avcl, int level, const char *fmt, ...)
 {
+    AVClass* avc= avcl ? *(AVClass**)avcl : NULL;
     va_list vl;
     va_start(vl, fmt);
+    if(avc && avc->version >= (50<<16 | 15<<8 | 2) && avc->log_level_offset_offset && level>=AV_LOG_FATAL)
+        level += *(int*)(((uint8_t*)avcl) + avc->log_level_offset_offset);
     av_vlog(avcl, level, fmt, vl);
     va_end(vl);
 }

Modified: trunk/libavutil/log.h
==============================================================================
--- trunk/libavutil/log.h	Sat May  8 18:32:05 2010	(r23058)
+++ trunk/libavutil/log.h	Sat May  8 22:41:20 2010	(r23059)
@@ -56,6 +56,12 @@ typedef struct {
      */
 
     int version;
+
+    /**
+     * Offset in the structure where log_level_offset is stored.
+     * 0 means there is no such variable
+     */
+    int log_level_offset_offset;
 } AVClass;
 
 /* av_log API */



More information about the ffmpeg-cvslog mailing list