FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Modules | Macros | Functions
Logging Facility
Common utility functions

Describe the class of an AVClass context structure. More...

Modules

 Logging Constants
 

Macros

#define av_dlog(pctx,...)   do { if (0) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0)
 Send the specified message to the log if the level is less than or equal to the current av_log_level.
 
#define av_dlog(pctx,...)   do { if (0) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0)
 Send the specified message to the log if the level is less than or equal to the current av_log_level.
 
#define av_dlog(pctx,...)   do { if (0) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0)
 Send the specified message to the log if the level is less than or equal to the current av_log_level.
 
#define av_dlog(pctx,...)   do { if (0) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0)
 Send the specified message to the log if the level is less than or equal to the current av_log_level.
 
#define AV_LOG_SKIP_REPEATED   1
 Skip repeated messages, this requires the user app to use av_log() instead of (f)printf as the 2 would otherwise interfere and lead to "Last message repeated x times" messages below (f)printf messages with some bad luck.
 
#define AV_LOG_SKIP_REPEATED   1
 Skip repeated messages, this requires the user app to use av_log() instead of (f)printf as the 2 would otherwise interfere and lead to "Last message repeated x times" messages below (f)printf messages with some bad luck.
 
#define AV_LOG_SKIP_REPEATED   1
 Skip repeated messages, this requires the user app to use av_log() instead of (f)printf as the 2 would otherwise interfere and lead to "Last message repeated x times" messages below (f)printf messages with some bad luck.
 
#define AV_LOG_SKIP_REPEATED   1
 Skip repeated messages, this requires the user app to use av_log() instead of (f)printf as the 2 would otherwise interfere and lead to "Last message repeated x times" messages below (f)printf messages with some bad luck.
 
#define av_dlog(pctx,...)   do { if (0) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0)
 av_dlog macros Useful to print debug messages that shouldn't get compiled in normally.
 
#define AV_LOG_SKIP_REPEATED   1
 Skip repeated messages, this requires the user app to use av_log() instead of (f)printf as the 2 would otherwise interfere and lead to "Last message repeated x times" messages below (f)printf messages with some bad luck.
 

Functions

void av_log (void *avcl, int level, const char *fmt,...) av_printf_format(3
 Send the specified message to the log if the level is less than or equal to the current av_log_level.
 
void void av_vlog (void *avcl, int level, const char *fmt, va_list vl)
 Send the specified message to the log if the level is less than or equal to the current av_log_level.
 
int av_log_get_level (void)
 Get the current log level.
 
void av_log_set_level (int level)
 Set the log level.
 
void av_log_set_callback (void(*callback)(void *, int, const char *, va_list))
 Set the logging callback.
 
void av_log_default_callback (void *avcl, int level, const char *fmt, va_list vl)
 Default logging callback.
 
const char * av_default_item_name (void *ctx)
 Return the context name.
 
AVClassCategory av_default_get_category (void *ptr)
 
void av_log_format_line (void *ptr, int level, const char *fmt, va_list vl, char *line, int line_size, int *print_prefix)
 Format a line of log the same way as the default callback.
 
void av_log_set_flags (int arg)
 

Detailed Description

Describe the class of an AVClass context structure.

That is an arbitrary struct of which the first field is a pointer to an AVClass struct (e.g. AVCodecContext, AVFormatContext etc.). The name of the class; usually it is the same name as the context structure type to which the AVClass is associated. A pointer to a function which returns the name of a context instance ctx associated with the class. a pointer to the first option specified in the class if any or NULL

See Also
av_set_default_options() LIBAVUTIL_VERSION with which this structure was created. This is used to allow fields to be added without requiring major version bumps everywhere. Offset in the structure where log_level_offset is stored. 0 means there is no such variable Offset in the structure where a pointer to the parent context for logging is stored. For example a decoder could pass its AVCodecContext to eval as such a parent context, which an av_log() implementation could then leverage to display the parent context. The offset can be NULL. Return next AVOptions-enabled child or NULL Return an AVClass corresponding to the next potential AVOptions-enabled child.

The difference between child_next and this is that child_next iterates over already existing objects, while child_class_next iterates over all possible children. Category used for visualization (like color) This is only set if the category is equal for all objects using this class. available since version (51 << 16 | 56 << 8 | 100) Callback to return the category. available since version (51 << 16 | 59 << 8 | 100) Callback to return the supported/allowed ranges. available since version (52.12)

Macro Definition Documentation

#define av_dlog (   pctx,
  ... 
)    do { if (0) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0)

Send 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 stderr. This behavior can be altered by setting a different logging callback function.

See Also
av_log_set_callback
Parameters
avclA pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct.
levelThe importance level of the message expressed using a Logging Constant.
fmtThe format string (printf-compatible) that specifies how subsequent arguments are converted to output. Send 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 stderr. This behavior can be altered by setting a different logging callback function.
See Also
av_log_set_callback
Parameters
avclA pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct.
levelThe importance level of the message expressed using a Logging Constant.
fmtThe format string (printf-compatible) that specifies how subsequent arguments are converted to output.
vlThe arguments referenced by the format string. Get the current log level
See Also
Logging Constants
Returns
Current log level Set the log level
See Also
Logging Constants
Parameters
levelLogging level Set the logging callback
Note
The callback must be thread safe, even if the application does not use threads itself as some codecs are multithreaded.
See Also
av_log_default_callback
Parameters
callbackA logging function with a compatible signature. Default logging callback

It prints the message to stderr, optionally colorizing it.

Parameters
avclA pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct.
levelThe importance level of the message expressed using a Logging Constant.
fmtThe format string (printf-compatible) that specifies how subsequent arguments are converted to output.
vlThe arguments referenced by the format string. Return the context name
ctxThe AVClass context
Returns
The AVClass class_name Format a line of log the same way as the default callback.
Parameters
linebuffer to receive the formated line
line_sizesize of the buffer
print_prefixused to store whether the prefix must be printed; must point to a persistent integer initially set to 1 av_dlog macros Useful to print debug messages that shouldn't get compiled in normally.

Definition at line 18765 of file avcodec.h.

#define av_dlog (   pctx,
  ... 
)    do { if (0) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0)

Send 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 stderr. This behavior can be altered by setting a different logging callback function.

See Also
av_log_set_callback
Parameters
avclA pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct.
levelThe importance level of the message expressed using a Logging Constant.
fmtThe format string (printf-compatible) that specifies how subsequent arguments are converted to output. Send 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 stderr. This behavior can be altered by setting a different logging callback function.
See Also
av_log_set_callback
Parameters
avclA pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct.
levelThe importance level of the message expressed using a Logging Constant.
fmtThe format string (printf-compatible) that specifies how subsequent arguments are converted to output.
vlThe arguments referenced by the format string. Get the current log level
See Also
Logging Constants
Returns
Current log level Set the log level
See Also
Logging Constants
Parameters
levelLogging level Set the logging callback
Note
The callback must be thread safe, even if the application does not use threads itself as some codecs are multithreaded.
See Also
av_log_default_callback
Parameters
callbackA logging function with a compatible signature. Default logging callback

It prints the message to stderr, optionally colorizing it.

Parameters
avclA pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct.
levelThe importance level of the message expressed using a Logging Constant.
fmtThe format string (printf-compatible) that specifies how subsequent arguments are converted to output.
vlThe arguments referenced by the format string. Return the context name
ctxThe AVClass context
Returns
The AVClass class_name Format a line of log the same way as the default callback.
Parameters
linebuffer to receive the formated line
line_sizesize of the buffer
print_prefixused to store whether the prefix must be printed; must point to a persistent integer initially set to 1 av_dlog macros Useful to print debug messages that shouldn't get compiled in normally.

Definition at line 18765 of file avcodec.h.

#define av_dlog (   pctx,
  ... 
)    do { if (0) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0)

Send 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 stderr. This behavior can be altered by setting a different logging callback function.

See Also
av_log_set_callback
Parameters
avclA pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct.
levelThe importance level of the message expressed using a Logging Constant.
fmtThe format string (printf-compatible) that specifies how subsequent arguments are converted to output. Send 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 stderr. This behavior can be altered by setting a different logging callback function.
See Also
av_log_set_callback
Parameters
avclA pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct.
levelThe importance level of the message expressed using a Logging Constant.
fmtThe format string (printf-compatible) that specifies how subsequent arguments are converted to output.
vlThe arguments referenced by the format string. Get the current log level
See Also
Logging Constants
Returns
Current log level Set the log level
See Also
Logging Constants
Parameters
levelLogging level Set the logging callback
Note
The callback must be thread safe, even if the application does not use threads itself as some codecs are multithreaded.
See Also
av_log_default_callback
Parameters
callbackA logging function with a compatible signature. Default logging callback

It prints the message to stderr, optionally colorizing it.

Parameters
avclA pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct.
levelThe importance level of the message expressed using a Logging Constant.
fmtThe format string (printf-compatible) that specifies how subsequent arguments are converted to output.
vlThe arguments referenced by the format string. Return the context name
ctxThe AVClass context
Returns
The AVClass class_name Format a line of log the same way as the default callback.
Parameters
linebuffer to receive the formated line
line_sizesize of the buffer
print_prefixused to store whether the prefix must be printed; must point to a persistent integer initially set to 1 av_dlog macros Useful to print debug messages that shouldn't get compiled in normally.

Definition at line 18765 of file avcodec.h.

#define av_dlog (   pctx,
  ... 
)    do { if (0) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0)

Send 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 stderr. This behavior can be altered by setting a different logging callback function.

See Also
av_log_set_callback
Parameters
avclA pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct.
levelThe importance level of the message expressed using a Logging Constant.
fmtThe format string (printf-compatible) that specifies how subsequent arguments are converted to output. Send 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 stderr. This behavior can be altered by setting a different logging callback function.
See Also
av_log_set_callback
Parameters
avclA pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct.
levelThe importance level of the message expressed using a Logging Constant.
fmtThe format string (printf-compatible) that specifies how subsequent arguments are converted to output.
vlThe arguments referenced by the format string. Get the current log level
See Also
Logging Constants
Returns
Current log level Set the log level
See Also
Logging Constants
Parameters
levelLogging level Set the logging callback
Note
The callback must be thread safe, even if the application does not use threads itself as some codecs are multithreaded.
See Also
av_log_default_callback
Parameters
callbackA logging function with a compatible signature. Default logging callback

It prints the message to stderr, optionally colorizing it.

Parameters
avclA pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct.
levelThe importance level of the message expressed using a Logging Constant.
fmtThe format string (printf-compatible) that specifies how subsequent arguments are converted to output.
vlThe arguments referenced by the format string. Return the context name
ctxThe AVClass context
Returns
The AVClass class_name Format a line of log the same way as the default callback.
Parameters
linebuffer to receive the formated line
line_sizesize of the buffer
print_prefixused to store whether the prefix must be printed; must point to a persistent integer initially set to 1 av_dlog macros Useful to print debug messages that shouldn't get compiled in normally.

Definition at line 18765 of file avcodec.h.

#define AV_LOG_SKIP_REPEATED   1

Skip repeated messages, this requires the user app to use av_log() instead of (f)printf as the 2 would otherwise interfere and lead to "Last message repeated x times" messages below (f)printf messages with some bad luck.

Also to receive the last, "last repeated" line if any, the user app must call av_log(NULL, AV_LOG_QUIET, "%s", ""); at the end

Definition at line 18776 of file avcodec.h.

Referenced by av_log_default_callback(), main(), and opt_loglevel().

#define AV_LOG_SKIP_REPEATED   1

Skip repeated messages, this requires the user app to use av_log() instead of (f)printf as the 2 would otherwise interfere and lead to "Last message repeated x times" messages below (f)printf messages with some bad luck.

Also to receive the last, "last repeated" line if any, the user app must call av_log(NULL, AV_LOG_QUIET, "%s", ""); at the end

Definition at line 18776 of file avcodec.h.

#define AV_LOG_SKIP_REPEATED   1

Skip repeated messages, this requires the user app to use av_log() instead of (f)printf as the 2 would otherwise interfere and lead to "Last message repeated x times" messages below (f)printf messages with some bad luck.

Also to receive the last, "last repeated" line if any, the user app must call av_log(NULL, AV_LOG_QUIET, "%s", ""); at the end

Definition at line 18776 of file avcodec.h.

#define AV_LOG_SKIP_REPEATED   1

Skip repeated messages, this requires the user app to use av_log() instead of (f)printf as the 2 would otherwise interfere and lead to "Last message repeated x times" messages below (f)printf messages with some bad luck.

Also to receive the last, "last repeated" line if any, the user app must call av_log(NULL, AV_LOG_QUIET, "%s", ""); at the end

Definition at line 18776 of file avcodec.h.

#define av_dlog (   pctx,
  ... 
)    do { if (0) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0)

av_dlog macros Useful to print debug messages that shouldn't get compiled in normally.

Definition at line 296 of file log.h.

#define AV_LOG_SKIP_REPEATED   1

Skip repeated messages, this requires the user app to use av_log() instead of (f)printf as the 2 would otherwise interfere and lead to "Last message repeated x times" messages below (f)printf messages with some bad luck.

Also to receive the last, "last repeated" line if any, the user app must call av_log(NULL, AV_LOG_QUIET, "%s", ""); at the end

Definition at line 307 of file log.h.

Function Documentation

void av_log ( void avcl,
int  level,
const char *  fmt,
  ... 
)

Send 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 stderr. This behavior can be altered by setting a different logging callback function.

See Also
av_log_set_callback
Parameters
avclA pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct.
levelThe importance level of the message expressed using a Logging Constant.
fmtThe format string (printf-compatible) that specifies how subsequent arguments are converted to output.
void void av_vlog ( void avcl,
int  level,
const char *  fmt,
va_list  vl 
)

Send 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 stderr. This behavior can be altered by setting a different logging callback function.

See Also
av_log_set_callback
Parameters
avclA pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct.
levelThe importance level of the message expressed using a Logging Constant.
fmtThe format string (printf-compatible) that specifies how subsequent arguments are converted to output.
vlThe arguments referenced by the format string.

Definition at line 293 of file log.c.

Referenced by ass_log(), av_log(), av_log_ask_for_sample(), ff_mp_msg(), missing_feature_sample(), report_config_error(), rtmp_log(), vs_2_av_log_wrapper(), X264_log(), and XAVS_log().

int av_log_get_level ( void  )

Get the current log level.

See Also
Logging Constants
Returns
Current log level

Definition at line 300 of file log.c.

Referenced by avcodec_string(), check_keyboard_interaction(), filter_frame(), hex_log(), http_av_log(), init(), print_report(), and rtmp_open().

void av_log_set_level ( int  level)

Set the log level.

See Also
Logging Constants
Parameters
levelLogging level

Definition at line 305 of file log.c.

Referenced by check_keyboard_interaction(), main(), opt_default(), and opt_loglevel().

void av_log_set_callback ( void(*)(void *, int, const char *, va_list)  callback)

Set the logging callback.

Note
The callback must be thread safe, even if the application does not use threads itself as some codecs are multithreaded.
See Also
av_log_default_callback
Parameters
callbackA logging function with a compatible signature.

Definition at line 315 of file log.c.

Referenced by init_report(), main(), show_buildconf(), show_help(), show_help_default(), and show_version().

void av_log_default_callback ( void avcl,
int  level,
const char *  fmt,
va_list  vl 
)

Default logging callback.

It prints the message to stderr, optionally colorizing it.

Parameters
avclA pointer to an arbitrary struct of which the first field is a pointer to an AVClass struct.
levelThe importance level of the message expressed using a Logging Constant.
fmtThe format string (printf-compatible) that specifies how subsequent arguments are converted to output.
vlThe arguments referenced by the format string.

Definition at line 229 of file log.c.

Referenced by log_callback_report().

const char* av_default_item_name ( void ctx)

Return the context name.

Parameters
ctxThe AVClass context
Returns
The AVClass class_name

Definition at line 157 of file log.c.

Referenced by av_parse_cpu_caps(), av_parse_cpu_flags(), and vs_2_av_log_wrapper().

AVClassCategory av_default_get_category ( void ptr)

Definition at line 162 of file log.c.

void av_log_format_line ( void ptr,
int  level,
const char *  fmt,
va_list  vl,
char *  line,
int  line_size,
int *  print_prefix 
)

Format a line of log the same way as the default callback.

Parameters
linebuffer to receive the formated line
line_sizesize of the buffer
print_prefixused to store whether the prefix must be printed; must point to a persistent integer initially set to 1

Definition at line 220 of file log.c.

Referenced by log_callback_report().

void av_log_set_flags ( int  arg)

Definition at line 310 of file log.c.

Referenced by main(), and opt_loglevel().