aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-04-20 02:48:19 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-04-20 02:48:19 +0200
commit8e8219e0f0725116809cdd1c17c868cb08da0dec (patch)
treeeccf6f91c9ff4d49aaa71727640934cec80fcfa0
parent93db2708d3b0bcc1f1d87d23ae8adbedd8ea6660 (diff)
parentc253340ae6f74ffd8798bbd476e46d1b33a2d56e (diff)
downloadffmpeg-8e8219e0f0725116809cdd1c17c868cb08da0dec.tar.gz
Merge commit 'c253340ae6f74ffd8798bbd476e46d1b33a2d56e'
* commit 'c253340ae6f74ffd8798bbd476e46d1b33a2d56e': log: Introduce a more verbose debug level Conflicts: doc/APIchanges doc/fftools-common-opts.texi libavutil/log.c libavutil/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--cmdutils.c1
-rw-r--r--doc/APIchanges3
-rw-r--r--doc/fftools-common-opts.texi1
-rw-r--r--libavutil/log.c7
-rw-r--r--libavutil/log.h9
-rw-r--r--libavutil/version.h7
6 files changed, 24 insertions, 4 deletions
diff --git a/cmdutils.c b/cmdutils.c
index 7126ce8fa4..5a18cd5653 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -845,6 +845,7 @@ int opt_loglevel(void *optctx, const char *opt, const char *arg)
{ "info" , AV_LOG_INFO },
{ "verbose", AV_LOG_VERBOSE },
{ "debug" , AV_LOG_DEBUG },
+ { "trace" , AV_LOG_TRACE },
};
char *tail;
int level;
diff --git a/doc/APIchanges b/doc/APIchanges
index ae67e06e17..b422e290b8 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -15,6 +15,9 @@ libavutil: 2014-08-09
API changes, most recent first:
+2015-xx-xx - xxxxxxx - lavu 54.12.0
+ Add AV_LOG_TRACE for extremely verbose debugging.
+
2015-xx-xx - xxxxxxx - lavf 56.29.100 - avio.h
Add AVIODirEntryType.AVIO_ENTRY_SERVER.
Add AVIODirEntryType.AVIO_ENTRY_SHARE.
diff --git a/doc/fftools-common-opts.texi b/doc/fftools-common-opts.texi
index 2451cc4946..3b8581368d 100644
--- a/doc/fftools-common-opts.texi
+++ b/doc/fftools-common-opts.texi
@@ -190,6 +190,7 @@ warnings and errors. This is the default value.
Same as @code{info}, except more verbose.
@item debug, 48
Show everything, including debugging information.
+@item trace, 56
@end table
By default the program logs to stderr, if coloring is supported by the
diff --git a/libavutil/log.c b/libavutil/log.c
index 2091316957..b256d07624 100644
--- a/libavutil/log.c
+++ b/libavutil/log.c
@@ -50,6 +50,7 @@ static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
static int av_log_level = AV_LOG_INFO;
static int flags;
+#define NB_LEVELS 8
#if defined(_WIN32) && !defined(__MINGW32CE__) && HAVE_SETCONSOLETEXTATTRIBUTE
#include <windows.h>
static const uint8_t color[16 + AV_CLASS_CATEGORY_NB] = {
@@ -60,6 +61,7 @@ static const uint8_t color[16 + AV_CLASS_CATEGORY_NB] = {
[AV_LOG_INFO /8] = 7,
[AV_LOG_VERBOSE/8] = 10,
[AV_LOG_DEBUG /8] = 10,
+ [AV_LOG_TRACE /8] = 8,
[16+AV_CLASS_CATEGORY_NA ] = 7,
[16+AV_CLASS_CATEGORY_INPUT ] = 13,
[16+AV_CLASS_CATEGORY_OUTPUT ] = 5,
@@ -91,6 +93,7 @@ static const uint32_t color[16 + AV_CLASS_CATEGORY_NB] = {
[AV_LOG_INFO /8] = 253 << 8 | 0x09,
[AV_LOG_VERBOSE/8] = 40 << 8 | 0x02,
[AV_LOG_DEBUG /8] = 34 << 8 | 0x02,
+ [AV_LOG_TRACE /8] = 34 << 8 | 0x07,
[16+AV_CLASS_CATEGORY_NA ] = 250 << 8 | 0x09,
[16+AV_CLASS_CATEGORY_INPUT ] = 219 << 8 | 0x15,
[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)
sanitize(part[1].str);
colored_fputs(type[1], 0, part[1].str);
sanitize(part[2].str);
- colored_fputs(av_clip(level >> 3, 0, 6), tint >> 8, part[2].str);
+ colored_fputs(av_clip(level >> 3, 0, NB_LEVELS - 1), tint >> 8, part[2].str);
sanitize(part[3].str);
- colored_fputs(av_clip(level >> 3, 0, 6), tint >> 8, part[3].str);
+ colored_fputs(av_clip(level >> 3, 0, NB_LEVELS - 1), tint >> 8, part[3].str);
end:
av_bprint_finalize(part+3, NULL);
#if HAVE_PTHREADS
diff --git a/libavutil/log.h b/libavutil/log.h
index 993a4f5bed..51bc0a7b26 100644
--- a/libavutil/log.h
+++ b/libavutil/log.h
@@ -24,6 +24,7 @@
#include <stdarg.h>
#include "avutil.h"
#include "attributes.h"
+#include "version.h"
typedef enum {
AV_CLASS_CATEGORY_NA = 0,
@@ -198,6 +199,11 @@ typedef struct AVClass {
#define AV_LOG_MAX_OFFSET (AV_LOG_DEBUG - AV_LOG_QUIET)
/**
+ * Extremely verbose debugging, useful for libav* development.
+ */
+#define AV_LOG_TRACE 56
+
+/**
* @}
*/
@@ -311,8 +317,10 @@ AVClassCategory av_default_get_category(void *ptr);
void av_log_format_line(void *ptr, int level, const char *fmt, va_list vl,
char *line, int line_size, int *print_prefix);
+#if FF_API_DLOG
/**
* av_dlog macros
+ * @deprecated unused
* Useful to print debug messages that shouldn't get compiled in normally.
*/
@@ -321,6 +329,7 @@ void av_log_format_line(void *ptr, int level, const char *fmt, va_list vl,
#else
# define av_dlog(pctx, ...) do { if (0) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0)
#endif
+#endif /* FF_API_DLOG */
/**
* Skip repeated messages, this requires the user app to use av_log() instead of
diff --git a/libavutil/version.h b/libavutil/version.h
index a3d95d8c57..ec3f586ead 100644
--- a/libavutil/version.h
+++ b/libavutil/version.h
@@ -56,8 +56,8 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 54
-#define LIBAVUTIL_VERSION_MINOR 22
-#define LIBAVUTIL_VERSION_MICRO 101
+#define LIBAVUTIL_VERSION_MINOR 23
+#define LIBAVUTIL_VERSION_MICRO 100
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
LIBAVUTIL_VERSION_MINOR, \
@@ -119,6 +119,9 @@
#ifndef FF_API_OPT_TYPE_METADATA
#define FF_API_OPT_TYPE_METADATA (LIBAVUTIL_VERSION_MAJOR < 55)
#endif
+#ifndef FF_API_DLOG
+#define FF_API_DLOG (LIBAVUTIL_VERSION_MAJOR < 55)
+#endif
#ifndef FF_CONST_AVUTIL55
#if LIBAVUTIL_VERSION_MAJOR >= 55