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
00043 struct AVOptionRanges;
00044
00050 typedef struct AVClass {
00055 const char* class_name;
00056
00061 const char* (*item_name)(void* ctx);
00062
00068 const struct AVOption *option;
00069
00076 int version;
00077
00082 int log_level_offset_offset;
00083
00090 int parent_log_context_offset;
00091
00095 void* (*child_next)(void *obj, void *prev);
00096
00105 const struct AVClass* (*child_class_next)(const struct AVClass *prev);
00106
00112 AVClassCategory category;
00113
00118 AVClassCategory (*get_category)(void* ctx);
00119
00124 int (*query_ranges)(struct AVOptionRanges **, void *obj, const char *key, int flags);
00125 } AVClass;
00126
00127
00128
00129 #define AV_LOG_QUIET -8
00130
00134 #define AV_LOG_PANIC 0
00135
00141 #define AV_LOG_FATAL 8
00142
00147 #define AV_LOG_ERROR 16
00148
00153 #define AV_LOG_WARNING 24
00154
00155 #define AV_LOG_INFO 32
00156 #define AV_LOG_VERBOSE 40
00157
00161 #define AV_LOG_DEBUG 48
00162
00163 #define AV_LOG_MAX_OFFSET (AV_LOG_DEBUG - AV_LOG_QUIET)
00164
00179 void av_log(void *avcl, int level, const char *fmt, ...) av_printf_format(3, 4);
00180
00181 void av_vlog(void *avcl, int level, const char *fmt, va_list);
00182 int av_log_get_level(void);
00183 void av_log_set_level(int);
00184 void av_log_set_callback(void (*)(void*, int, const char*, va_list));
00185 void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl);
00186 const char* av_default_item_name(void* ctx);
00187 AVClassCategory av_default_get_category(void *ptr);
00188
00196 void av_log_format_line(void *ptr, int level, const char *fmt, va_list vl,
00197 char *line, int line_size, int *print_prefix);
00198
00204 #ifdef DEBUG
00205 # define av_dlog(pctx, ...) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__)
00206 #else
00207 # define av_dlog(pctx, ...) do { if (0) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0)
00208 #endif
00209
00218 #define AV_LOG_SKIP_REPEATED 1
00219 void av_log_set_flags(int arg);
00220
00221 #endif