| rev |
line source |
|
nengel@2
|
1 /*
|
|
nengel@2
|
2 * copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
|
|
nengel@2
|
3 *
|
|
nengel@2
|
4 * This file is part of FFmpeg.
|
|
nengel@2
|
5 *
|
|
nengel@2
|
6 * FFmpeg is free software; you can redistribute it and/or
|
|
nengel@2
|
7 * modify it under the terms of the GNU Lesser General Public
|
|
nengel@2
|
8 * License as published by the Free Software Foundation; either
|
|
nengel@2
|
9 * version 2.1 of the License, or (at your option) any later version.
|
|
nengel@2
|
10 *
|
|
nengel@2
|
11 * FFmpeg is distributed in the hope that it will be useful,
|
|
nengel@2
|
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
nengel@2
|
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
nengel@2
|
14 * Lesser General Public License for more details.
|
|
nengel@2
|
15 *
|
|
nengel@2
|
16 * You should have received a copy of the GNU Lesser General Public
|
|
nengel@2
|
17 * License along with FFmpeg; if not, write to the Free Software
|
|
nengel@2
|
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
nengel@2
|
19 */
|
|
nengel@2
|
20
|
|
nengel@2
|
21 #ifndef AVUTIL_LOG_H
|
|
nengel@2
|
22 #define AVUTIL_LOG_H
|
|
nengel@2
|
23
|
|
nengel@2
|
24 #include <stdarg.h>
|
|
nengel@2
|
25 //#include "avutil.h"
|
|
nengel@2
|
26
|
|
nengel@2
|
27 /**
|
|
nengel@2
|
28 * Describes the class of an AVClass context structure. That is an
|
|
nengel@2
|
29 * arbitrary struct of which the first field is a pointer to an
|
|
nengel@2
|
30 * AVClass struct (e.g. AVCodecContext, AVFormatContext etc.).
|
|
nengel@2
|
31 */
|
|
nengel@2
|
32 typedef struct {
|
|
nengel@2
|
33 /**
|
|
nengel@2
|
34 * The name of the class; usually it is the same name as the
|
|
nengel@2
|
35 * context structure type to which the AVClass is associated.
|
|
nengel@2
|
36 */
|
|
nengel@2
|
37 const char* class_name;
|
|
nengel@2
|
38
|
|
nengel@2
|
39 /**
|
|
nengel@2
|
40 * A pointer to a function which returns the name of a context
|
|
nengel@2
|
41 * instance ctx associated with the class.
|
|
nengel@2
|
42 */
|
|
nengel@2
|
43 const char* (*item_name)(void* ctx);
|
|
nengel@2
|
44
|
|
nengel@2
|
45 /**
|
|
nengel@2
|
46 * a pointer to the first option specified in the class if any or NULL
|
|
nengel@2
|
47 *
|
|
nengel@2
|
48 * @see av_set_default_options()
|
|
nengel@2
|
49 */
|
|
nengel@2
|
50 const struct AVOption *option;
|
|
nengel@2
|
51
|
|
nengel@2
|
52 /**
|
|
nengel@2
|
53 * LIBAVUTIL_VERSION with which this structure was created.
|
|
nengel@2
|
54 * This is used to allow fields to be added without requiring major
|
|
nengel@2
|
55 * version bumps everywhere.
|
|
nengel@2
|
56 */
|
|
nengel@2
|
57
|
|
nengel@2
|
58 int version;
|
|
nengel@2
|
59 } AVClass;
|
|
nengel@2
|
60
|
|
nengel@2
|
61 /* av_log API */
|
|
nengel@2
|
62
|
|
nengel@2
|
63 #define AV_LOG_QUIET -8
|
|
nengel@2
|
64
|
|
nengel@2
|
65 /**
|
|
nengel@2
|
66 * Something went really wrong and we will crash now.
|
|
nengel@2
|
67 */
|
|
nengel@2
|
68 #define AV_LOG_PANIC 0
|
|
nengel@2
|
69
|
|
nengel@2
|
70 /**
|
|
nengel@2
|
71 * Something went wrong and recovery is not possible.
|
|
nengel@2
|
72 * For example, no header was found for a format which depends
|
|
nengel@2
|
73 * on headers or an illegal combination of parameters is used.
|
|
nengel@2
|
74 */
|
|
nengel@2
|
75 #define AV_LOG_FATAL 8
|
|
nengel@2
|
76
|
|
nengel@2
|
77 /**
|
|
nengel@2
|
78 * Something went wrong and cannot losslessly be recovered.
|
|
nengel@2
|
79 * However, not all future data is affected.
|
|
nengel@2
|
80 */
|
|
nengel@2
|
81 #define AV_LOG_ERROR 16
|
|
nengel@2
|
82
|
|
nengel@2
|
83 /**
|
|
nengel@2
|
84 * Something somehow does not look correct. This may or may not
|
|
nengel@2
|
85 * lead to problems. An example would be the use of '-vstrict -2'.
|
|
nengel@2
|
86 */
|
|
nengel@2
|
87 #define AV_LOG_WARNING 24
|
|
nengel@2
|
88
|
|
nengel@2
|
89 #define AV_LOG_INFO 32
|
|
nengel@2
|
90 #define AV_LOG_VERBOSE 40
|
|
nengel@2
|
91
|
|
nengel@2
|
92 /**
|
|
nengel@2
|
93 * Stuff which is only useful for libav* developers.
|
|
nengel@2
|
94 */
|
|
nengel@2
|
95 #define AV_LOG_DEBUG 48
|
|
nengel@2
|
96
|
|
nengel@2
|
97 /**
|
|
nengel@2
|
98 * Sends the specified message to the log if the level is less than or equal
|
|
nengel@2
|
99 * to the current av_log_level. By default, all logging messages are sent to
|
|
nengel@2
|
100 * stderr. This behavior can be altered by setting a different av_vlog callback
|
|
nengel@2
|
101 * function.
|
|
nengel@2
|
102 *
|
|
nengel@2
|
103 * @param avcl A pointer to an arbitrary struct of which the first field is a
|
|
nengel@2
|
104 * pointer to an AVClass struct.
|
|
nengel@2
|
105 * @param level The importance level of the message, lower values signifying
|
|
nengel@2
|
106 * higher importance.
|
|
nengel@2
|
107 * @param fmt The format string (printf-compatible) that specifies how
|
|
nengel@2
|
108 * subsequent arguments are converted to output.
|
|
nengel@2
|
109 * @see av_vlog
|
|
nengel@2
|
110 */
|
|
nengel@2
|
111
|
|
nengel@2
|
112 void av_log(int level, const char *fmt, ...);
|
|
nengel@2
|
113
|
|
nengel@2
|
114 void av_vlog(int level, const char *fmt, va_list);
|
|
nengel@2
|
115 int av_log_get_level(void);
|
|
nengel@2
|
116 void av_log_set_level(int);
|
|
nengel@2
|
117 void av_log_set_callback(void (*)(int, const char*, va_list));
|
|
nengel@2
|
118 void av_log_default_callback(int level, const char* fmt, va_list vl);
|
|
nengel@2
|
119
|
|
nengel@2
|
120 #endif /* AVUTIL_LOG_H */
|