FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions | Variables
log.c File Reference

logging functions More...

#include "config.h"
#include <stdarg.h>
#include <stdlib.h>
#include "avutil.h"
#include "bprint.h"
#include "common.h"
#include "internal.h"
#include "log.h"

Go to the source code of this file.

Macros

#define LINE_SZ   1024
 

Functions

static void check_color_terminal (void)
 
static void colored_fputs (int level, int tint, const char *str)
 
const char * av_default_item_name (void *ptr)
 Return the context name.
 
AVClassCategory av_default_get_category (void *ptr)
 
static void sanitize (uint8_t *line)
 
static int get_category (void *ptr)
 
static const char * get_level_str (int level)
 
static void format_line (void *avcl, int level, const char *fmt, va_list vl, AVBPrint part[4], int *print_prefix, int type[2])
 
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_default_callback (void *ptr, int level, const char *fmt, va_list vl)
 Default logging callback.
 
void av_log (void *avcl, int level, const char *fmt,...)
 
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_flags (int arg)
 
int av_log_get_flags (void)
 
void av_log_set_callback (void(*callback)(void *, int, const char *, va_list))
 Set the logging callback.
 
static void missing_feature_sample (int sample, void *avc, const char *msg, va_list argument_list)
 
void avpriv_request_sample (void *avc, const char *msg,...)
 
void avpriv_report_missing_feature (void *avc, const char *msg,...)
 

Variables

static int av_log_level = AV_LOG_INFO
 
static int flags
 
static const uint32_t color [16+AV_CLASS_CATEGORY_NB]
 
static int use_color = -1
 
static void(* av_log_callback )(void *, int, const char *, va_list)
 

Detailed Description

logging functions

Definition in file log.c.

Macro Definition Documentation

#define LINE_SZ   1024

Definition at line 48 of file log.c.

Referenced by av_log_default_callback().

Function Documentation

static void check_color_terminal ( void  )
static

Definition at line 116 of file log.c.

Referenced by colored_fputs().

static void colored_fputs ( int  level,
int  tint,
const char *  str 
)
static

Definition at line 141 of file log.c.

Referenced by av_log_default_callback().

static void sanitize ( uint8_t line)
static

Definition at line 194 of file log.c.

Referenced by av_log_default_callback().

static int get_category ( void ptr)
static

Definition at line 202 of file log.c.

Referenced by format_line().

static const char* get_level_str ( int  level)
static

Definition at line 215 of file log.c.

Referenced by format_line().

static void format_line ( void avcl,
int  level,
const char *  fmt,
va_list  vl,
AVBPrint  part[4],
int *  print_prefix,
int  type[2] 
)
static

Definition at line 239 of file log.c.

Referenced by av_log_default_callback(), and av_log_format_line().

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

Definition at line 344 of file log.c.

static void missing_feature_sample ( int  sample,
void avc,
const char *  msg,
va_list  argument_list 
)
static

Definition at line 388 of file log.c.

Referenced by avpriv_report_missing_feature(), and avpriv_request_sample().

void avpriv_request_sample ( void avc,
const char *  msg,
  ... 
)

Definition at line 402 of file log.c.

void avpriv_report_missing_feature ( void avc,
const char *  msg,
  ... 
)

Definition at line 411 of file log.c.

Variable Documentation

int av_log_level = AV_LOG_INFO
static

Definition at line 50 of file log.c.

Referenced by av_log_default_callback(), av_log_get_level(), and av_log_set_level().

int flags
static

Definition at line 51 of file log.c.

Referenced by av_log_default_callback(), av_log_get_flags(), av_log_set_flags(), and format_line().

const uint32_t color[16+AV_CLASS_CATEGORY_NB]
static
Initial value:
= {
[AV_LOG_PANIC /8] = 52 << 16 | 196 << 8 | 0x41,
[AV_LOG_FATAL /8] = 208 << 8 | 0x41,
[AV_LOG_ERROR /8] = 196 << 8 | 0x11,
[AV_LOG_WARNING/8] = 226 << 8 | 0x03,
[AV_LOG_INFO /8] = 253 << 8 | 0x09,
[AV_LOG_VERBOSE/8] = 40 << 8 | 0x02,
[AV_LOG_DEBUG /8] = 34 << 8 | 0x02,
[16+AV_CLASS_CATEGORY_NA ] = 250 << 8 | 0x09,
[16+AV_CLASS_CATEGORY_INPUT ] = 219 << 8 | 0x15,
[16+AV_CLASS_CATEGORY_OUTPUT ] = 201 << 8 | 0x05,
[16+AV_CLASS_CATEGORY_MUXER ] = 213 << 8 | 0x15,
[16+AV_CLASS_CATEGORY_DEMUXER ] = 207 << 8 | 0x05,
[16+AV_CLASS_CATEGORY_ENCODER ] = 51 << 8 | 0x16,
[16+AV_CLASS_CATEGORY_DECODER ] = 39 << 8 | 0x06,
[16+AV_CLASS_CATEGORY_FILTER ] = 155 << 8 | 0x12,
[16+AV_CLASS_CATEGORY_BITSTREAM_FILTER] = 192 << 8 | 0x14,
[16+AV_CLASS_CATEGORY_SWSCALER ] = 153 << 8 | 0x14,
[16+AV_CLASS_CATEGORY_SWRESAMPLER ] = 147 << 8 | 0x14,
[16+AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT ] = 213 << 8 | 0x15,
[16+AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT ] = 207 << 8 | 0x05,
[16+AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT ] = 213 << 8 | 0x15,
[16+AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT ] = 207 << 8 | 0x05,
[16+AV_CLASS_CATEGORY_DEVICE_OUTPUT ] = 213 << 8 | 0x15,
[16+AV_CLASS_CATEGORY_DEVICE_INPUT ] = 207 << 8 | 0x05,
}

Definition at line 86 of file log.c.

Referenced by av_get_known_color_name(), cdg_load_palette(), cdg_scroll(), cdg_tile_block(), color_get(), color_inc(), config_props(), copy_color_mask(), decode_format80(), decode_hextile(), decode_rle(), draw_line(), dvb_encode_rle2(), dvb_encode_rle4(), dvb_encode_rle8(), dvd_encode_rle(), ff_snow_pred_block(), fill_frame(), guess_dc(), mm_decode_inter(), mm_decode_intra(), modplug_read_packet(), mp_get_yuv_from_rgb(), mp_set_rgb_from_yuv(), overlay_ass_image(), rle_decode(), select_palette(), and set_frame().

int use_color = -1
static

Definition at line 114 of file log.c.

Referenced by check_color_terminal(), and colored_fputs().

void(* av_log_callback)(void *, int, const char *, va_list)
static
Initial value:

Definition at line 341 of file log.c.

Referenced by av_log_set_callback(), and av_vlog().