00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef AVUTIL_LOG_H
00022 #define AVUTIL_LOG_H
00023
00024 #include <stdarg.h>
00025 #include "avutil.h"
00026 #include "attributes.h"
00027
00028 typedef enum {
00029 AV_CLASS_CATEGORY_NA = 0,
00030 AV_CLASS_CATEGORY_INPUT,
00031 AV_CLASS_CATEGORY_OUTPUT,
00032 AV_CLASS_CATEGORY_MUXER,
00033 AV_CLASS_CATEGORY_DEMUXER,
00034 AV_CLASS_CATEGORY_ENCODER,
00035 AV_CLASS_CATEGORY_DECODER,
00036 AV_CLASS_CATEGORY_FILTER,
00037 AV_CLASS_CATEGORY_BITSTREAM_FILTER,
00038 AV_CLASS_CATEGORY_SWSCALER,
00039 AV_CLASS_CATEGORY_SWRESAMPLER,
00040 AV_CLASS_CATEGORY_NB,
00041 }AVClassCategory;
00042
00048 typedef struct AVClass {
00053 const char* class_name;
00054
00059 const char* (*item_name)(void* ctx);
00060
00066 const struct AVOption *option;
00067
00074 int version;
00075
00080 int log_level_offset_offset;
00081
00088 int parent_log_context_offset;
00089
00093 void* (*child_next)(void *obj, void *prev);
00094
00103 const struct AVClass* (*child_class_next)(const struct AVClass *prev);
00104
00110 AVClassCategory category;
00111
00116 AVClassCategory (*get_category)(void* ctx);
00117 } AVClass;
00118
00119
00120
00121 #define AV_LOG_QUIET -8
00122
00126 #define AV_LOG_PANIC 0
00127
00133 #define AV_LOG_FATAL 8
00134
00139 #define AV_LOG_ERROR 16
00140
00145 #define AV_LOG_WARNING 24
00146
00147 #define AV_LOG_INFO 32
00148 #define AV_LOG_VERBOSE 40
00149
00153 #define AV_LOG_DEBUG 48
00154
00155 #define AV_LOG_MAX_OFFSET (AV_LOG_DEBUG - AV_LOG_QUIET)
00156
00171 void av_log(void *avcl, int level, const char *fmt, ...) av_printf_format(3, 4);
00172
00173 void av_vlog(void *avcl, int level, const char *fmt, va_list);
00174 int av_log_get_level(void);
00175 void av_log_set_level(int);
00176 void av_log_set_callback(void (*)(void*, int, const char*, va_list));
00177 void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl);
00178 const char* av_default_item_name(void* ctx);
00179 AVClassCategory av_default_get_category(void *ptr);
00180
00188 void av_log_format_line(void *ptr, int level, const char *fmt, va_list vl,
00189 char *line, int line_size, int *print_prefix);
00190
00196 #ifdef DEBUG
00197 # define av_dlog(pctx, ...) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__)
00198 #else
00199 # define av_dlog(pctx, ...) do { if (0) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0)
00200 #endif
00201
00210 #define AV_LOG_SKIP_REPEATED 1
00211 void av_log_set_flags(int arg);
00212
00213 #endif