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 | { "info" , AV_LOG_INFO }, | 724 | { "info" , AV_LOG_INFO }, |
| 725 | { "verbose", AV_LOG_VERBOSE }, | 725 | { "verbose", AV_LOG_VERBOSE }, |
| 726 | { "debug" , AV_LOG_DEBUG }, | 726 | { "debug" , AV_LOG_DEBUG }, |
| 727 | { "trace" , AV_LOG_TRACE }, | ||
| 727 | }; | 728 | }; |
| 728 | char *tail; | 729 | char *tail; |
| 729 | int level; | 730 | int level; |
| @@ -13,6 +13,9 @@ libavutil: 2014-08-09 · 12 unmodified lines | |||
| 13 | 13 | ||
| 14 | API changes, most recent first: | 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 | 2015-xx-xx - xxxxxxx - lavu 54.11.0 | 19 | 2015-xx-xx - xxxxxxx - lavu 54.11.0 |
| 17 | Add av_small_strptime(). | 20 | Add av_small_strptime(). |
| 18 | 21 | ||
| @@ -145,6 +145,7 @@ Set the logging level used by the library. · 144 unmodified lines | |||
| 145 | @item info | 145 | @item info |
| 146 | @item verbose | 146 | @item verbose |
| 147 | @item debug | 147 | @item debug |
| 148 | @item trace | ||
| 148 | @end table | 149 | @end table |
| 149 | 150 | ||
| 150 | By default the program logs to stderr, if coloring is supported by the | 151 | By default the program logs to stderr, if coloring is supported by the |
| @@ -43,16 +43,19 @@ · 42 unmodified lines | |||
| 43 | static int av_log_level = AV_LOG_INFO; | 43 | static int av_log_level = AV_LOG_INFO; |
| 44 | static int flags; | 44 | static int flags; |
| 45 | 45 | ||
| 46 | #define NB_LEVELS 8 | ||
| 46 | #if HAVE_SETCONSOLETEXTATTRIBUTE | 47 | #if HAVE_SETCONSOLETEXTATTRIBUTE |
| 47 | #include <windows.h> | 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 | static int16_t background, attr_orig; | 50 | static int16_t background, attr_orig; |
| 50 | static HANDLE con; | 51 | static HANDLE con; |
| 51 | #define set_color(x) SetConsoleTextAttribute(con, background | color[x]) | 52 | #define set_color(x) SetConsoleTextAttribute(con, background | color[x]) |
| 52 | #define reset_color() SetConsoleTextAttribute(con, attr_orig) | 53 | #define reset_color() SetConsoleTextAttribute(con, attr_orig) |
| 53 | #define print_256color(x) | 54 | #define print_256color(x) |
| 54 | #else | 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 | #define set_color(x) fprintf(stderr, "\033[%d;3%dm", color[x] >> 4, color[x]&15) | 59 | #define set_color(x) fprintf(stderr, "\033[%d;3%dm", color[x] >> 4, color[x]&15) |
| 57 | #define print_256color(x) fprintf(stderr, "\033[38;5;%dm", x) | 60 | #define print_256color(x) fprintf(stderr, "\033[38;5;%dm", x) |
| 58 | #define reset_color() fprintf(stderr, "\033[0m") | 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 | fprintf(stderr, " Last message repeated %d times\n", count); | 162 | fprintf(stderr, " Last message repeated %d times\n", count); |
| 160 | count = 0; | 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 | av_strlcpy(prev, line, sizeof line); | 166 | av_strlcpy(prev, line, sizeof line); |
| 164 | } | 167 | } |
| 165 | 168 | ||
| @@ -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 | /** | 29 | /** |
| 29 | * Describe the class of an AVClass context structure. That is an | 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 | #define AV_LOG_DEBUG 48 | 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 | const char* av_default_item_name(void* ctx); | 250 | const char* av_default_item_name(void* ctx); |
| 245 | 251 | ||
| 252 | #if FF_API_DLOG | ||
| 246 | /** | 253 | /** |
| 247 | * av_dlog macros | 254 | * av_dlog macros |
| 255 | * @deprecated unused | ||
| 248 | * Useful to print debug messages that shouldn't get compiled in normally. | 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 | #else | 261 | #else |
| 254 | # define av_dlog(pctx, ...) | 262 | # define av_dlog(pctx, ...) |
| 255 | #endif | 263 | #endif |
| 264 | #endif /* FF_API_DLOG */ | ||
| 256 | 265 | ||
| 257 | /** | 266 | /** |
| 258 | * Skip repeated messages, this requires the user app to use av_log() instead of | 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 | #define LIBAVUTIL_VERSION_MAJOR 54 | 56 | #define LIBAVUTIL_VERSION_MAJOR 54 |
| 57 | #define LIBAVUTIL_VERSION_MINOR 11 | 57 | #define LIBAVUTIL_VERSION_MINOR 12 |
| 58 | #define LIBAVUTIL_VERSION_MICRO 0 | 58 | #define LIBAVUTIL_VERSION_MICRO 0 |
| 59 | 59 | ||
| 60 | #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ | 60 | #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ |
| @@ -111,6 +111,9 @@ · 50 unmodified lines | |||
| 111 | #ifndef FF_API_OPT_TYPE_METADATA | 111 | #ifndef FF_API_OPT_TYPE_METADATA |
| 112 | #define FF_API_OPT_TYPE_METADATA (LIBAVUTIL_VERSION_MAJOR < 55) | 112 | #define FF_API_OPT_TYPE_METADATA (LIBAVUTIL_VERSION_MAJOR < 55) |
| 113 | #endif | 113 | #endif |
| 114 | #ifndef FF_API_DLOG | ||
| 115 | #define FF_API_DLOG (LIBAVUTIL_VERSION_MAJOR < 55) | ||
| 116 | #endif | ||
| 114 | 117 | ||
| 115 | 118 | ||
| 116 | /** | 119 | /** |