And deprecate av_dlog macro.
Unified · Split
| @@ -724,6 +724,7 @@ int opt_loglevel(void *optctx, const char *opt, const char *arg) · 723 unmodified lines | ||
| 724 | 724 | { "info" , AV_LOG_INFO }, |
| 725 | 725 | { "verbose", AV_LOG_VERBOSE }, |
| 726 | 726 | { "debug" , AV_LOG_DEBUG }, |
| 727 | + { "trace" , AV_LOG_TRACE }, | |
| 727 | 728 | }; |
| 728 | 729 | char *tail; |
| 729 | 730 | int level; |
| @@ -13,6 +13,9 @@ libavutil: 2014-08-09 · 12 unmodified lines | ||
| 13 | 13 | |
| 14 | 14 | API changes, most recent first: |
| 15 | 15 | |
| 16 | +2015-xx-xx - xxxxxxx - lavu 54.12.0 | |
| 17 | + Add AV_LOG_TRACE for extremely verbose debugging. | |
| 18 | + | |
| 16 | 19 | 2015-xx-xx - xxxxxxx - lavu 54.11.0 |
| 17 | 20 | Add av_small_strptime(). |
| 18 | 21 | |
| @@ -145,6 +145,7 @@ Set the logging level used by the library. · 144 unmodified lines | ||
| 145 | 145 | @item info |
| 146 | 146 | @item verbose |
| 147 | 147 | @item debug |
| 148 | +@item trace | |
| 148 | 149 | @end table |
| 149 | 150 | |
| 150 | 151 | By default the program logs to stderr, if coloring is supported by the |
| @@ -43,16 +43,19 @@ · 42 unmodified lines | ||
| 43 | 43 | static int av_log_level = AV_LOG_INFO; |
| 44 | 44 | static int flags; |
| 45 | 45 | |
| 46 | +#define NB_LEVELS 8 | |
| 46 | 47 | #if HAVE_SETCONSOLETEXTATTRIBUTE |
| 47 | 48 | #include <windows.h> |
| 48 | −static const uint8_t color[] = { 12, 12, 12, 14, 7, 10, 11 }; | |
| 49 | +static const uint8_t color[NB_LEVELS] = { 12, 12, 12, 14, 7, 10, 11, 8}; | |
| 49 | 50 | static int16_t background, attr_orig; |
| 50 | 51 | static HANDLE con; |
| 51 | 52 | #define set_color(x) SetConsoleTextAttribute(con, background | color[x]) |
| 52 | 53 | #define reset_color() SetConsoleTextAttribute(con, attr_orig) |
| 53 | 54 | #define print_256color(x) |
| 54 | 55 | #else |
| 55 | −static const uint8_t color[] = { 0x41, 0x41, 0x11, 0x03, 9, 0x02, 0x06 }; | |
| 56 | +static const uint8_t color[NB_LEVELS] = { | |
| 57 | + 0x41, 0x41, 0x11, 0x03, 9, 0x02, 0x06, 0x07 | |
| 58 | +}; | |
| 56 | 59 | #define set_color(x) fprintf(stderr, "\033[%d;3%dm", color[x] >> 4, color[x]&15) |
| 57 | 60 | #define print_256color(x) fprintf(stderr, "\033[38;5;%dm", x) |
| 58 | 61 | #define reset_color() fprintf(stderr, "\033[0m") |
| @@ -159,7 +162,7 @@ void av_log_default_callback(void *avcl, int level, const char *fmt, va_list vl) · 100 unmodified lines | ||
| 159 | 162 | fprintf(stderr, " Last message repeated %d times\n", count); |
| 160 | 163 | count = 0; |
| 161 | 164 | } |
| 162 | − colored_fputs(av_clip(level >> 3, 0, 6), tint >> 8, line); | |
| 165 | + colored_fputs(av_clip(level >> 3, 0, NB_LEVELS - 1), tint >> 8, line); | |
| 163 | 166 | av_strlcpy(prev, line, sizeof line); |
| 164 | 167 | } |
| 165 | 168 | |
| @@ -24,6 +24,7 @@ · 23 unmodified lines | ||
| 24 | 24 | #include <stdarg.h> |
| 25 | 25 | #include "avutil.h" |
| 26 | 26 | #include "attributes.h" |
| 27 | +#include "version.h" | |
| 27 | 28 | |
| 28 | 29 | /** |
| 29 | 30 | * Describe the class of an AVClass context structure. That is an |
| @@ -143,6 +144,11 @@ typedef struct AVClass { · 113 unmodified lines | ||
| 143 | 144 | */ |
| 144 | 145 | #define AV_LOG_DEBUG 48 |
| 145 | 146 | |
| 147 | +/** | |
| 148 | + * Extremely verbose debugging, useful for libav* development. | |
| 149 | + */ | |
| 150 | +#define AV_LOG_TRACE 56 | |
| 151 | + | |
| 146 | 152 | /** |
| 147 | 153 | * @} |
| 148 | 154 | */ |
| @@ -243,8 +249,10 @@ void av_log_default_callback(void *avcl, int level, const char *fmt, · 94 unmodified lines | ||
| 243 | 249 | */ |
| 244 | 250 | const char* av_default_item_name(void* ctx); |
| 245 | 251 | |
| 252 | +#if FF_API_DLOG | |
| 246 | 253 | /** |
| 247 | 254 | * av_dlog macros |
| 255 | + * @deprecated unused | |
| 248 | 256 | * Useful to print debug messages that shouldn't get compiled in normally. |
| 249 | 257 | */ |
| 250 | 258 | |
| @@ -253,6 +261,7 @@ const char* av_default_item_name(void* ctx); · 2 unmodified lines | ||
| 253 | 261 | #else |
| 254 | 262 | # define av_dlog(pctx, ...) |
| 255 | 263 | #endif |
| 264 | +#endif /* FF_API_DLOG */ | |
| 256 | 265 | |
| 257 | 266 | /** |
| 258 | 267 | * Skip repeated messages, this requires the user app to use av_log() instead of |
| @@ -54,7 +54,7 @@ · 53 unmodified lines | ||
| 54 | 54 | */ |
| 55 | 55 | |
| 56 | 56 | #define LIBAVUTIL_VERSION_MAJOR 54 |
| 57 | −#define LIBAVUTIL_VERSION_MINOR 11 | |
| 57 | +#define LIBAVUTIL_VERSION_MINOR 12 | |
| 58 | 58 | #define LIBAVUTIL_VERSION_MICRO 0 |
| 59 | 59 | |
| 60 | 60 | #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ |
| @@ -111,6 +111,9 @@ · 50 unmodified lines | ||
| 111 | 111 | #ifndef FF_API_OPT_TYPE_METADATA |
| 112 | 112 | #define FF_API_OPT_TYPE_METADATA (LIBAVUTIL_VERSION_MAJOR < 55) |
| 113 | 113 | #endif |
| 114 | +#ifndef FF_API_DLOG | |
| 115 | +#define FF_API_DLOG (LIBAVUTIL_VERSION_MAJOR < 55) | |
| 116 | +#endif | |
| 114 | 117 | |
| 115 | 118 | |
| 116 | 119 | /** |