FFmpeg  1.2.4
Macros | Functions | Variables
log.c File Reference

logging functions More...

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

Go to the source code of this file.

Macros

#define LINE_SZ   1024
#define set_color(x)   fprintf(stderr, "\033[%d;3%dm", (color[x] >> 4) & 15, color[x] & 15)
#define set_256color(x)   fprintf(stderr, "\033[48;5;%dm\033[38;5;%dm", (color[x] >> 16) & 0xff, (color[x] >> 8) & 0xff)
#define reset_color()   fprintf(stderr, "\033[0m")

Functions

static void colored_fputs (int level, const char *str)
const char * av_default_item_name (void *ptr)
AVClassCategory av_default_get_category (void *ptr)
static void sanitize (uint8_t *line)
static int get_category (void *ptr)
static void format_line (void *ptr, int level, const char *fmt, va_list vl, char part[3][LINE_SZ], int part_size, 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)
void av_log (void *avcl, int level, const char *fmt,...)
void av_vlog (void *avcl, int level, const char *fmt, va_list vl)
int av_log_get_level (void)
void av_log_set_level (int level)
void av_log_set_flags (int arg)
void av_log_set_callback (void(*callback)(void *, int, const char *, va_list))

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 40 of file log.c.

Referenced by av_log_default_callback(), and av_log_format_line().

#define reset_color ( )    fprintf(stderr, "\033[0m")

Definition at line 98 of file log.c.

Referenced by colored_fputs().

#define set_256color (   x)    fprintf(stderr, "\033[48;5;%dm\033[38;5;%dm", (color[x] >> 16) & 0xff, (color[x] >> 8) & 0xff)

Definition at line 97 of file log.c.

Referenced by colored_fputs().

#define set_color (   x)    fprintf(stderr, "\033[%d;3%dm", (color[x] >> 4) & 15, color[x] & 15)

Definition at line 96 of file log.c.

Referenced by colored_fputs().

Function Documentation

AVClassCategory av_default_get_category ( void ptr)

Definition at line 142 of file log.c.

const char* av_default_item_name ( void ptr)

Definition at line 137 of file log.c.

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

Definition at line 244 of file log.c.

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

Definition at line 202 of file log.c.

Referenced by log_callback_report().

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 194 of file log.c.

Referenced by log_callback_report().

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

Definition at line 277 of file log.c.

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

void av_log_set_flags ( int  arg)

Definition at line 272 of file log.c.

Referenced by main().

void av_log_set_level ( int  level)

Definition at line 267 of file log.c.

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

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

Definition at line 256 of file log.c.

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

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

Definition at line 102 of file log.c.

Referenced by av_log_default_callback().

static void format_line ( void ptr,
int  level,
const char *  fmt,
va_list  vl,
char  part[3][LINE_SZ],
int  part_size,
int *  print_prefix,
int  type[2] 
)
static

Definition at line 168 of file log.c.

Referenced by av_log_default_callback(), and av_log_format_line().

static int get_category ( void ptr)
static

Definition at line 155 of file log.c.

Referenced by format_line().

static void sanitize ( uint8_t line)
static

Definition at line 147 of file log.c.

Referenced by av_log_default_callback().

Variable Documentation

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

Definition at line 241 of file log.c.

Referenced by av_log_set_callback(), and av_vlog().

int av_log_level = AV_LOG_INFO
static

Definition at line 42 of file log.c.

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

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,
}

Definition at line 75 of file log.c.

Referenced by avfilter_register_all(), caca_write_header(), calc_coefficients(), cdg_border_preset(), cdg_load_palette(), cdg_scroll(), cdg_tile_block(), config_input(), config_props(), copy_color_mask(), count_colors(), dc_test(), decode_0(), decode_format80(), decode_hextile(), decode_i2_frame(), decode_mvc2(), decode_rle(), draw_line(), dvb_encode_rle2(), dvb_encode_rle4(), dvb_encode_rle8(), dvd_encode_rle(), ff_ass_split_override_codes(), ff_snow_pred_block(), fill_frame(), filter_frame(), guess_dc(), init(), iterative_me(), microdvd_init(), mm_decode_inter(), mm_decode_intra(), modplug_read_packet(), mp_get_yuv_from_rgb(), mp_read_changes_map(), mp_set_rgb_from_yuv(), overlay_ass_image(), paint_rect(), ring1_test(), rle_decode(), select_palette(), super2xsai(), write_pixel_15_7(), and xsub_encode_rle().

int flags
static

Definition at line 43 of file log.c.

Referenced by av_log_default_callback(), and av_log_set_flags().

int use_color = -1
static

Definition at line 100 of file log.c.

Referenced by colored_fputs().