Libav 0.7.1
|
00001 /* 00002 * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at> 00003 * 00004 * This file is part of Libav. 00005 * 00006 * Libav is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU Lesser General Public 00008 * License as published by the Free Software Foundation; either 00009 * version 2.1 of the License, or (at your option) any later version. 00010 * 00011 * Libav is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 * Lesser General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU Lesser General Public 00017 * License along with Libav; if not, write to the Free Software 00018 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00019 */ 00020 00021 #ifndef AVUTIL_LOG_H 00022 #define AVUTIL_LOG_H 00023 00024 #include <stdarg.h> 00025 #include "avutil.h" 00026 00032 typedef struct { 00037 const char* class_name; 00038 00043 const char* (*item_name)(void* ctx); 00044 00050 const struct AVOption *option; 00051 00058 int version; 00059 00064 int log_level_offset_offset; 00065 00072 int parent_log_context_offset; 00073 00078 const struct AVOption* (*opt_find)(void *obj, const char *name, const char *unit, 00079 int opt_flags, int search_flags); 00080 } AVClass; 00081 00082 /* av_log API */ 00083 00084 #define AV_LOG_QUIET -8 00085 00089 #define AV_LOG_PANIC 0 00090 00096 #define AV_LOG_FATAL 8 00097 00102 #define AV_LOG_ERROR 16 00103 00108 #define AV_LOG_WARNING 24 00109 00110 #define AV_LOG_INFO 32 00111 #define AV_LOG_VERBOSE 40 00112 00116 #define AV_LOG_DEBUG 48 00117 00132 #ifdef __GNUC__ 00133 void av_log(void *avcl, int level, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 3, 4))); 00134 #else 00135 void av_log(void *avcl, int level, const char *fmt, ...); 00136 #endif 00137 00138 void av_vlog(void *avcl, int level, const char *fmt, va_list); 00139 int av_log_get_level(void); 00140 void av_log_set_level(int); 00141 void av_log_set_callback(void (*)(void*, int, const char*, va_list)); 00142 void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl); 00143 const char* av_default_item_name(void* ctx); 00144 00150 #ifdef DEBUG 00151 # define av_dlog(pctx, ...) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__) 00152 #else 00153 # define av_dlog(pctx, ...) 00154 #endif 00155 00164 #define AV_LOG_SKIP_REPEATED 1 00165 void av_log_set_flags(int arg); 00166 00167 #endif /* AVUTIL_LOG_H */