* commit 'c253340ae6f74ffd8798bbd476e46d1b33a2d56e': log: Introduce a more verbose debug level Conflicts: doc/APIchanges doc/fftools-common-opts.texi libavutil/log.c libavutil/version.h
Unified · Split
| @@ -845,6 +845,7 @@ int opt_loglevel(void *optctx, const char *opt, const char *arg) · 844 unmodified lines | |||
| 845 | { "info" , AV_LOG_INFO }, | 845 | { "info" , AV_LOG_INFO }, |
| 846 | { "verbose", AV_LOG_VERBOSE }, | 846 | { "verbose", AV_LOG_VERBOSE }, |
| 847 | { "debug" , AV_LOG_DEBUG }, | 847 | { "debug" , AV_LOG_DEBUG }, |
| 848 | { "trace" , AV_LOG_TRACE }, | ||
| 848 | }; | 849 | }; |
| 849 | char *tail; | 850 | char *tail; |
| 850 | int level; | 851 | int level; |
| @@ -15,6 +15,9 @@ libavutil: 2014-08-09 · 14 unmodified lines | |||
| 15 | 15 | ||
| 16 | API changes, most recent first: | 16 | API changes, most recent first: |
| 17 | 17 | ||
| 18 | 2015-xx-xx - xxxxxxx - lavu 54.12.0 | ||
| 19 | Add AV_LOG_TRACE for extremely verbose debugging. | ||
| 20 | |||
| 18 | 2015-xx-xx - xxxxxxx - lavf 56.29.100 - avio.h | 21 | 2015-xx-xx - xxxxxxx - lavf 56.29.100 - avio.h |
| 19 | Add AVIODirEntryType.AVIO_ENTRY_SERVER. | 22 | Add AVIODirEntryType.AVIO_ENTRY_SERVER. |
| 20 | Add AVIODirEntryType.AVIO_ENTRY_SHARE. | 23 | Add AVIODirEntryType.AVIO_ENTRY_SHARE. |
| @@ -190,6 +190,7 @@ warnings and errors. This is the default value. · 189 unmodified lines | |||
| 190 | Same as @code{info}, except more verbose. | 190 | Same as @code{info}, except more verbose. |
| 191 | @item debug, 48 | 191 | @item debug, 48 |
| 192 | Show everything, including debugging information. | 192 | Show everything, including debugging information. |
| 193 | @item trace, 56 | ||
| 193 | @end table | 194 | @end table |
| 194 | 195 | ||
| 195 | By default the program logs to stderr, if coloring is supported by the | 196 | By default the program logs to stderr, if coloring is supported by the |
| @@ -50,6 +50,7 @@ static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; · 49 unmodified lines | |||
| 50 | static int av_log_level = AV_LOG_INFO; | 50 | static int av_log_level = AV_LOG_INFO; |
| 51 | static int flags; | 51 | static int flags; |
| 52 | 52 | ||
| 53 | #define NB_LEVELS 8 | ||
| 53 | #if defined(_WIN32) && !defined(__MINGW32CE__) && HAVE_SETCONSOLETEXTATTRIBUTE | 54 | #if defined(_WIN32) && !defined(__MINGW32CE__) && HAVE_SETCONSOLETEXTATTRIBUTE |
| 54 | #include <windows.h> | 55 | #include <windows.h> |
| 55 | static const uint8_t color[16 + AV_CLASS_CATEGORY_NB] = { | 56 | static const uint8_t color[16 + AV_CLASS_CATEGORY_NB] = { |
| @@ -60,6 +61,7 @@ static const uint8_t color[16 + AV_CLASS_CATEGORY_NB] = { · 4 unmodified lines | |||
| 60 | [AV_LOG_INFO /8] = 7, | 61 | [AV_LOG_INFO /8] = 7, |
| 61 | [AV_LOG_VERBOSE/8] = 10, | 62 | [AV_LOG_VERBOSE/8] = 10, |
| 62 | [AV_LOG_DEBUG /8] = 10, | 63 | [AV_LOG_DEBUG /8] = 10, |
| 64 | [AV_LOG_TRACE /8] = 8, | ||
| 63 | [16+AV_CLASS_CATEGORY_NA ] = 7, | 65 | [16+AV_CLASS_CATEGORY_NA ] = 7, |
| 64 | [16+AV_CLASS_CATEGORY_INPUT ] = 13, | 66 | [16+AV_CLASS_CATEGORY_INPUT ] = 13, |
| 65 | [16+AV_CLASS_CATEGORY_OUTPUT ] = 5, | 67 | [16+AV_CLASS_CATEGORY_OUTPUT ] = 5, |
| @@ -91,6 +93,7 @@ static const uint32_t color[16 + AV_CLASS_CATEGORY_NB] = { · 25 unmodified lines | |||
| 91 | [AV_LOG_INFO /8] = 253 << 8 | 0x09, | 93 | [AV_LOG_INFO /8] = 253 << 8 | 0x09, |
| 92 | [AV_LOG_VERBOSE/8] = 40 << 8 | 0x02, | 94 | [AV_LOG_VERBOSE/8] = 40 << 8 | 0x02, |
| 93 | [AV_LOG_DEBUG /8] = 34 << 8 | 0x02, | 95 | [AV_LOG_DEBUG /8] = 34 << 8 | 0x02, |
| 96 | [AV_LOG_TRACE /8] = 34 << 8 | 0x07, | ||
| 94 | [16+AV_CLASS_CATEGORY_NA ] = 250 << 8 | 0x09, | 97 | [16+AV_CLASS_CATEGORY_NA ] = 250 << 8 | 0x09, |
| 95 | [16+AV_CLASS_CATEGORY_INPUT ] = 219 << 8 | 0x15, | 98 | [16+AV_CLASS_CATEGORY_INPUT ] = 219 << 8 | 0x15, |
| 96 | [16+AV_CLASS_CATEGORY_OUTPUT ] = 201 << 8 | 0x05, | 99 | [16+AV_CLASS_CATEGORY_OUTPUT ] = 201 << 8 | 0x05, |
| @@ -328,9 +331,9 @@ void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl) · 231 unmodified lines | |||
| 328 | sanitize(part[1].str); | 331 | sanitize(part[1].str); |
| 329 | colored_fputs(type[1], 0, part[1].str); | 332 | colored_fputs(type[1], 0, part[1].str); |
| 330 | sanitize(part[2].str); | 333 | sanitize(part[2].str); |
| 331 | colored_fputs(av_clip(level >> 3, 0, 6), tint >> 8, part[2].str); | 334 | colored_fputs(av_clip(level >> 3, 0, NB_LEVELS - 1), tint >> 8, part[2].str); |
| 332 | sanitize(part[3].str); | 335 | sanitize(part[3].str); |
| 333 | colored_fputs(av_clip(level >> 3, 0, 6), tint >> 8, part[3].str); | 336 | colored_fputs(av_clip(level >> 3, 0, NB_LEVELS - 1), tint >> 8, part[3].str); |
| 334 | end: | 337 | end: |
| 335 | av_bprint_finalize(part+3, NULL); | 338 | av_bprint_finalize(part+3, NULL); |
| 336 | #if HAVE_PTHREADS | 339 | #if HAVE_PTHREADS |
| @@ -24,6 +24,7 @@ · 23 unmodified lines | |||
| 24 | #include <stdarg.h> | 24 | #include <stdarg.h> |
| 25 | #include "avutil.h" | 25 | #include "avutil.h" |
| 26 | #include "attributes.h" | 26 | #include "attributes.h" |
| 27 | #include "version.h" | ||
| 27 | 28 | ||
| 28 | typedef enum { | 29 | typedef enum { |
| 29 | AV_CLASS_CATEGORY_NA = 0, | 30 | AV_CLASS_CATEGORY_NA = 0, |
| @@ -197,6 +198,11 @@ typedef struct AVClass { · 167 unmodified lines | |||
| 197 | 198 | ||
| 198 | #define AV_LOG_MAX_OFFSET (AV_LOG_DEBUG - AV_LOG_QUIET) | 199 | #define AV_LOG_MAX_OFFSET (AV_LOG_DEBUG - AV_LOG_QUIET) |
| 199 | 200 | ||
| 201 | /** | ||
| 202 | * Extremely verbose debugging, useful for libav* development. | ||
| 203 | */ | ||
| 204 | #define AV_LOG_TRACE 56 | ||
| 205 | |||
| 200 | /** | 206 | /** |
| 201 | * @} | 207 | * @} |
| 202 | */ | 208 | */ |
| @@ -311,8 +317,10 @@ AVClassCategory av_default_get_category(void *ptr); · 108 unmodified lines | |||
| 311 | void av_log_format_line(void *ptr, int level, const char *fmt, va_list vl, | 317 | void av_log_format_line(void *ptr, int level, const char *fmt, va_list vl, |
| 312 | char *line, int line_size, int *print_prefix); | 318 | char *line, int line_size, int *print_prefix); |
| 313 | 319 | ||
| 320 | #if FF_API_DLOG | ||
| 314 | /** | 321 | /** |
| 315 | * av_dlog macros | 322 | * av_dlog macros |
| 323 | * @deprecated unused | ||
| 316 | * Useful to print debug messages that shouldn't get compiled in normally. | 324 | * Useful to print debug messages that shouldn't get compiled in normally. |
| 317 | */ | 325 | */ |
| 318 | 326 | ||
| @@ -321,6 +329,7 @@ void av_log_format_line(void *ptr, int level, const char *fmt, va_list vl, · 2 unmodified lines | |||
| 321 | #else | 329 | #else |
| 322 | # define av_dlog(pctx, ...) do { if (0) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0) | 330 | # define av_dlog(pctx, ...) do { if (0) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0) |
| 323 | #endif | 331 | #endif |
| 332 | #endif /* FF_API_DLOG */ | ||
| 324 | 333 | ||
| 325 | /** | 334 | /** |
| 326 | * Skip repeated messages, this requires the user app to use av_log() instead of | 335 | * Skip repeated messages, this requires the user app to use av_log() instead of |
| @@ -56,8 +56,8 @@ · 55 unmodified lines | |||
| 56 | */ | 56 | */ |
| 57 | 57 | ||
| 58 | #define LIBAVUTIL_VERSION_MAJOR 54 | 58 | #define LIBAVUTIL_VERSION_MAJOR 54 |
| 59 | #define LIBAVUTIL_VERSION_MINOR 22 | 59 | #define LIBAVUTIL_VERSION_MINOR 23 |
| 60 | #define LIBAVUTIL_VERSION_MICRO 101 | 60 | #define LIBAVUTIL_VERSION_MICRO 100 |
| 61 | 61 | ||
| 62 | #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ | 62 | #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ |
| 63 | LIBAVUTIL_VERSION_MINOR, \ | 63 | LIBAVUTIL_VERSION_MINOR, \ |
| @@ -119,6 +119,9 @@ · 55 unmodified lines | |||
| 119 | #ifndef FF_API_OPT_TYPE_METADATA | 119 | #ifndef FF_API_OPT_TYPE_METADATA |
| 120 | #define FF_API_OPT_TYPE_METADATA (LIBAVUTIL_VERSION_MAJOR < 55) | 120 | #define FF_API_OPT_TYPE_METADATA (LIBAVUTIL_VERSION_MAJOR < 55) |
| 121 | #endif | 121 | #endif |
| 122 | #ifndef FF_API_DLOG | ||
| 123 | #define FF_API_DLOG (LIBAVUTIL_VERSION_MAJOR < 55) | ||
| 124 | #endif | ||
| 122 | 125 | ||
| 123 | #ifndef FF_CONST_AVUTIL55 | 126 | #ifndef FF_CONST_AVUTIL55 |
| 124 | #if LIBAVUTIL_VERSION_MAJOR >= 55 | 127 | #if LIBAVUTIL_VERSION_MAJOR >= 55 |