nengel@2: /* nengel@2: * copyright (c) 2006 Michael Niedermayer nengel@2: * nengel@2: * This file is part of FFmpeg. nengel@2: * nengel@2: * FFmpeg is free software; you can redistribute it and/or nengel@2: * modify it under the terms of the GNU Lesser General Public nengel@2: * License as published by the Free Software Foundation; either nengel@2: * version 2.1 of the License, or (at your option) any later version. nengel@2: * nengel@2: * FFmpeg is distributed in the hope that it will be useful, nengel@2: * but WITHOUT ANY WARRANTY; without even the implied warranty of nengel@2: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU nengel@2: * Lesser General Public License for more details. nengel@2: * nengel@2: * You should have received a copy of the GNU Lesser General Public nengel@2: * License along with FFmpeg; if not, write to the Free Software nengel@2: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA nengel@2: */ nengel@2: nengel@2: #ifndef AVUTIL_LOG_H nengel@2: #define AVUTIL_LOG_H nengel@2: nengel@2: #include nengel@2: //#include "avutil.h" nengel@2: nengel@2: /** nengel@2: * Describes the class of an AVClass context structure. That is an nengel@2: * arbitrary struct of which the first field is a pointer to an nengel@2: * AVClass struct (e.g. AVCodecContext, AVFormatContext etc.). nengel@2: */ nengel@2: typedef struct { nengel@2: /** nengel@2: * The name of the class; usually it is the same name as the nengel@2: * context structure type to which the AVClass is associated. nengel@2: */ nengel@2: const char* class_name; nengel@2: nengel@2: /** nengel@2: * A pointer to a function which returns the name of a context nengel@2: * instance ctx associated with the class. nengel@2: */ nengel@2: const char* (*item_name)(void* ctx); nengel@2: nengel@2: /** nengel@2: * a pointer to the first option specified in the class if any or NULL nengel@2: * nengel@2: * @see av_set_default_options() nengel@2: */ nengel@2: const struct AVOption *option; nengel@2: nengel@2: /** nengel@2: * LIBAVUTIL_VERSION with which this structure was created. nengel@2: * This is used to allow fields to be added without requiring major nengel@2: * version bumps everywhere. nengel@2: */ nengel@2: nengel@2: int version; nengel@2: } AVClass; nengel@2: nengel@2: /* av_log API */ nengel@2: nengel@2: #define AV_LOG_QUIET -8 nengel@2: nengel@2: /** nengel@2: * Something went really wrong and we will crash now. nengel@2: */ nengel@2: #define AV_LOG_PANIC 0 nengel@2: nengel@2: /** nengel@2: * Something went wrong and recovery is not possible. nengel@2: * For example, no header was found for a format which depends nengel@2: * on headers or an illegal combination of parameters is used. nengel@2: */ nengel@2: #define AV_LOG_FATAL 8 nengel@2: nengel@2: /** nengel@2: * Something went wrong and cannot losslessly be recovered. nengel@2: * However, not all future data is affected. nengel@2: */ nengel@2: #define AV_LOG_ERROR 16 nengel@2: nengel@2: /** nengel@2: * Something somehow does not look correct. This may or may not nengel@2: * lead to problems. An example would be the use of '-vstrict -2'. nengel@2: */ nengel@2: #define AV_LOG_WARNING 24 nengel@2: nengel@2: #define AV_LOG_INFO 32 nengel@2: #define AV_LOG_VERBOSE 40 nengel@2: nengel@2: /** nengel@2: * Stuff which is only useful for libav* developers. nengel@2: */ nengel@2: #define AV_LOG_DEBUG 48 nengel@2: nengel@2: /** nengel@2: * Sends the specified message to the log if the level is less than or equal nengel@2: * to the current av_log_level. By default, all logging messages are sent to nengel@2: * stderr. This behavior can be altered by setting a different av_vlog callback nengel@2: * function. nengel@2: * nengel@2: * @param avcl A pointer to an arbitrary struct of which the first field is a nengel@2: * pointer to an AVClass struct. nengel@2: * @param level The importance level of the message, lower values signifying nengel@2: * higher importance. nengel@2: * @param fmt The format string (printf-compatible) that specifies how nengel@2: * subsequent arguments are converted to output. nengel@2: * @see av_vlog nengel@2: */ nengel@2: nengel@2: void av_log(int level, const char *fmt, ...); nengel@2: nengel@2: void av_vlog(int level, const char *fmt, va_list); nengel@2: int av_log_get_level(void); nengel@2: void av_log_set_level(int); nengel@2: void av_log_set_callback(void (*)(int, const char*, va_list)); nengel@2: void av_log_default_callback(int level, const char* fmt, va_list vl); nengel@2: nengel@2: #endif /* AVUTIL_LOG_H */