2006-09-10 17:02:42 +03:00
|
|
|
/*
|
|
|
|
* copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
|
|
|
|
*
|
2006-10-07 18:30:46 +03:00
|
|
|
* This file is part of FFmpeg.
|
|
|
|
*
|
|
|
|
* FFmpeg is free software; you can redistribute it and/or
|
2006-09-10 17:02:42 +03:00
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
2006-10-07 18:30:46 +03:00
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
2006-09-10 17:02:42 +03:00
|
|
|
*
|
2006-10-07 18:30:46 +03:00
|
|
|
* FFmpeg is distributed in the hope that it will be useful,
|
2006-09-10 17:02:42 +03:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
2006-10-07 18:30:46 +03:00
|
|
|
* License along with FFmpeg; if not, write to the Free Software
|
2006-09-10 17:02:42 +03:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*/
|
|
|
|
|
2008-08-31 10:39:47 +03:00
|
|
|
#ifndef AVUTIL_LOG_H
|
|
|
|
#define AVUTIL_LOG_H
|
2006-07-18 14:00:55 +03:00
|
|
|
|
|
|
|
#include <stdarg.h>
|
2009-01-13 02:14:43 +02:00
|
|
|
#include "avutil.h"
|
2006-07-18 14:00:55 +03:00
|
|
|
|
|
|
|
/**
|
2009-01-29 01:03:17 +02:00
|
|
|
* Describes the class of an AVClass context structure. That is an
|
2008-04-24 13:13:38 +03:00
|
|
|
* arbitrary struct of which the first field is a pointer to an
|
|
|
|
* AVClass struct (e.g. AVCodecContext, AVFormatContext etc.).
|
2006-07-18 14:00:55 +03:00
|
|
|
*/
|
|
|
|
typedef struct AVCLASS AVClass;
|
|
|
|
struct AVCLASS {
|
2008-04-24 13:13:38 +03:00
|
|
|
/**
|
2008-05-06 11:41:13 +03:00
|
|
|
* The name of the class; usually it is the same name as the
|
2008-05-06 11:03:30 +03:00
|
|
|
* context structure type to which the AVClass is associated.
|
2008-04-24 13:13:38 +03:00
|
|
|
*/
|
2006-07-18 14:00:55 +03:00
|
|
|
const char* class_name;
|
2008-04-24 13:13:38 +03:00
|
|
|
|
|
|
|
/**
|
2009-01-29 01:03:17 +02:00
|
|
|
* A pointer to a function which returns the name of a context
|
|
|
|
* instance \p ctx associated with the class.
|
2008-04-24 13:13:38 +03:00
|
|
|
*/
|
|
|
|
const char* (*item_name)(void* ctx);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* a pointer to the first option specified in the class if any or NULL
|
|
|
|
*
|
|
|
|
* @see av_set_default_options()
|
|
|
|
*/
|
2006-11-16 02:29:15 +02:00
|
|
|
const struct AVOption *option;
|
2006-07-18 14:00:55 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
/* av_log API */
|
|
|
|
|
2007-01-21 22:47:10 +02:00
|
|
|
#if LIBAVUTIL_VERSION_INT < (50<<16)
|
2006-07-18 14:00:55 +03:00
|
|
|
#define AV_LOG_QUIET -1
|
2007-01-21 22:47:10 +02:00
|
|
|
#define AV_LOG_FATAL 0
|
2006-07-18 14:00:55 +03:00
|
|
|
#define AV_LOG_ERROR 0
|
2007-01-21 22:47:10 +02:00
|
|
|
#define AV_LOG_WARNING 1
|
2006-07-18 14:00:55 +03:00
|
|
|
#define AV_LOG_INFO 1
|
2007-01-21 22:47:10 +02:00
|
|
|
#define AV_LOG_VERBOSE 1
|
2006-07-18 14:00:55 +03:00
|
|
|
#define AV_LOG_DEBUG 2
|
2007-01-21 22:47:10 +02:00
|
|
|
#else
|
|
|
|
#define AV_LOG_QUIET -8
|
|
|
|
|
|
|
|
/**
|
2009-01-29 01:03:17 +02:00
|
|
|
* Something went really wrong and we will crash now.
|
2007-01-21 22:47:10 +02:00
|
|
|
*/
|
|
|
|
#define AV_LOG_PANIC 0
|
|
|
|
|
|
|
|
/**
|
|
|
|
* something went wrong and recovery is not possible
|
|
|
|
* like no header in a format which depends on it or a combination
|
|
|
|
* of parameters which are not allowed
|
|
|
|
*/
|
|
|
|
#define AV_LOG_FATAL 8
|
|
|
|
|
|
|
|
/**
|
|
|
|
* something went wrong and cannot losslessly be recovered
|
|
|
|
* but not all future data is affected
|
|
|
|
*/
|
|
|
|
#define AV_LOG_ERROR 16
|
|
|
|
|
|
|
|
/**
|
|
|
|
* something somehow does not look correct / something which may or may not
|
|
|
|
* lead to some problems like use of -vstrict -2
|
|
|
|
*/
|
|
|
|
#define AV_LOG_WARNING 24
|
|
|
|
|
|
|
|
#define AV_LOG_INFO 32
|
|
|
|
#define AV_LOG_VERBOSE 40
|
|
|
|
|
|
|
|
/**
|
2009-01-29 01:03:17 +02:00
|
|
|
* Stuff which is only useful for libav* developers.
|
2007-01-21 22:47:10 +02:00
|
|
|
*/
|
|
|
|
#define AV_LOG_DEBUG 48
|
|
|
|
#endif
|
2007-12-12 23:48:50 +02:00
|
|
|
|
|
|
|
#if LIBAVUTIL_VERSION_INT < (50<<16)
|
2006-07-20 14:55:08 +03:00
|
|
|
extern int av_log_level;
|
2007-12-12 23:48:50 +02:00
|
|
|
#endif
|
2006-07-18 14:00:55 +03:00
|
|
|
|
2007-03-05 01:04:49 +02:00
|
|
|
/**
|
2009-01-29 01:03:17 +02:00
|
|
|
* Sends the specified message to the log if the level is less than or equal
|
|
|
|
* to the current av_log_level. By default, all logging messages are sent to
|
2007-03-05 01:04:49 +02:00
|
|
|
* stderr. This behavior can be altered by setting a different av_vlog callback
|
|
|
|
* function.
|
|
|
|
*
|
|
|
|
* @param avcl A pointer to an arbitrary struct of which the first field is a
|
|
|
|
* pointer to an AVClass struct.
|
|
|
|
* @param level The importance level of the message, lower values signifying
|
|
|
|
* higher importance.
|
|
|
|
* @param fmt The format string (printf-compatible) that specifies how
|
|
|
|
* subsequent arguments are converted to output.
|
|
|
|
* @see av_vlog
|
|
|
|
*/
|
2006-07-18 14:00:55 +03:00
|
|
|
#ifdef __GNUC__
|
2008-04-11 17:18:33 +03:00
|
|
|
void av_log(void*, int level, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 3, 4)));
|
2006-07-18 14:00:55 +03:00
|
|
|
#else
|
2008-04-11 17:18:33 +03:00
|
|
|
void av_log(void*, int level, const char *fmt, ...);
|
2006-07-18 14:00:55 +03:00
|
|
|
#endif
|
|
|
|
|
2008-04-11 17:18:33 +03:00
|
|
|
void av_vlog(void*, int level, const char *fmt, va_list);
|
|
|
|
int av_log_get_level(void);
|
|
|
|
void av_log_set_level(int);
|
|
|
|
void av_log_set_callback(void (*)(void*, int, const char*, va_list));
|
|
|
|
void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl);
|
2006-07-18 14:00:55 +03:00
|
|
|
|
2008-08-31 10:39:47 +03:00
|
|
|
#endif /* AVUTIL_LOG_H */
|