FFmpeg  1.2.4
log.h
Go to the documentation of this file.
1 /*
2  * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
3  *
4  * This file is part of FFmpeg.
5  *
6  * FFmpeg is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * FFmpeg is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with FFmpeg; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #ifndef AVUTIL_LOG_H
22 #define AVUTIL_LOG_H
23 
24 #include <stdarg.h>
25 #include "avutil.h"
26 #include "attributes.h"
27 
28 typedef enum {
42 
43 struct AVOptionRanges;
44 
50 typedef struct AVClass {
55  const char* class_name;
56 
61  const char* (*item_name)(void* ctx);
62 
68  const struct AVOption *option;
69 
76  int version;
77 
83 
92 
96  void* (*child_next)(void *obj, void *prev);
97 
106  const struct AVClass* (*child_class_next)(const struct AVClass *prev);
107 
114 
119  AVClassCategory (*get_category)(void* ctx);
120 
125  int (*query_ranges)(struct AVOptionRanges **, void *obj, const char *key, int flags);
126 } AVClass;
127 
128 /* av_log API */
129 
130 #define AV_LOG_QUIET -8
131 
135 #define AV_LOG_PANIC 0
136 
142 #define AV_LOG_FATAL 8
143 
148 #define AV_LOG_ERROR 16
149 
154 #define AV_LOG_WARNING 24
155 
156 #define AV_LOG_INFO 32
157 #define AV_LOG_VERBOSE 40
158 
162 #define AV_LOG_DEBUG 48
163 
164 #define AV_LOG_MAX_OFFSET (AV_LOG_DEBUG - AV_LOG_QUIET)
165 
180 void av_log(void *avcl, int level, const char *fmt, ...) av_printf_format(3, 4);
181 
182 void av_vlog(void *avcl, int level, const char *fmt, va_list);
183 int av_log_get_level(void);
184 void av_log_set_level(int);
185 void av_log_set_callback(void (*)(void*, int, const char*, va_list));
186 void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl);
187 const char* av_default_item_name(void* ctx);
189 
197 void av_log_format_line(void *ptr, int level, const char *fmt, va_list vl,
198  char *line, int line_size, int *print_prefix);
199 
205 #ifdef DEBUG
206 # define av_dlog(pctx, ...) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__)
207 #else
208 # define av_dlog(pctx, ...) do { if (0) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0)
209 #endif
210 
219 #define AV_LOG_SKIP_REPEATED 1
220 void av_log_set_flags(int arg);
221 
222 #endif /* AVUTIL_LOG_H */