FFmpeg
Loading...
Searching...
No Matches
log.c
Go to the documentation of this file.
1/*
2 * log functions
3 * Copyright (c) 2003 Michel Bardiaux
4 *
5 * This file is part of FFmpeg.
6 *
7 * FFmpeg is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * FFmpeg is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with FFmpeg; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22/**
23 * @file
24 * logging functions
25 */
26
27#include "config.h"
28
29#if HAVE_UNISTD_H
30#include <unistd.h>
31#endif
32#if HAVE_IO_H
33#include <io.h>
34#endif
35#include <inttypes.h>
36#include <stdarg.h>
37#include <stdatomic.h>
38#include <stdio.h>
39#include <stdlib.h>
40#include <string.h>
41#include "bprint.h"
42#include "common.h"
43#include "internal.h"
44#include "log.h"
45#include "thread.h"
46#include "time.h"
47#include "time_internal.h"
48
50
51#define LINE_SZ 1024
52
53#if HAVE_VALGRIND_VALGRIND_H && CONFIG_VALGRIND_BACKTRACE
54#include <valgrind/valgrind.h>
55/* this is the log level at which valgrind will output a full backtrace */
56#define BACKTRACE_LOGLEVEL AV_LOG_ERROR
57#endif
58
61
62#define NB_LEVELS 8
63#if defined(_WIN32) && HAVE_SETCONSOLETEXTATTRIBUTE && HAVE_GETSTDHANDLE
64#include <windows.h>
65static const uint8_t win_color[16 + AV_CLASS_CATEGORY_NB] = {
66 [AV_LOG_PANIC /8] = 12,
67 [AV_LOG_FATAL /8] = 12,
68 [AV_LOG_ERROR /8] = 12,
69 [AV_LOG_WARNING/8] = 14,
70 [AV_LOG_INFO /8] = 7,
71 [AV_LOG_VERBOSE/8] = 10,
72 [AV_LOG_DEBUG /8] = 10,
73 [AV_LOG_TRACE /8] = 8,
74 [16+AV_CLASS_CATEGORY_NA ] = 7,
75 [16+AV_CLASS_CATEGORY_INPUT ] = 13,
77 [16+AV_CLASS_CATEGORY_MUXER ] = 13,
81 [16+AV_CLASS_CATEGORY_FILTER ] = 10,
92};
93
94static int16_t background, attr_orig;
95static HANDLE con;
96#endif
97
98static const uint32_t color[16 + AV_CLASS_CATEGORY_NB] = {
99 [AV_LOG_PANIC /8] = 52 << 16 | 196 << 8 | 0x41,
100 [AV_LOG_FATAL /8] = 208 << 8 | 0x41,
101 [AV_LOG_ERROR /8] = 196 << 8 | 0x11,
102 [AV_LOG_WARNING/8] = 226 << 8 | 0x03,
103 [AV_LOG_INFO /8] = 253 << 8 | 0x09,
104 [AV_LOG_VERBOSE/8] = 40 << 8 | 0x02,
105 [AV_LOG_DEBUG /8] = 34 << 8 | 0x02,
106 [AV_LOG_TRACE /8] = 34 << 8 | 0x07,
107 [16+AV_CLASS_CATEGORY_NA ] = 250 << 8 | 0x09,
108 [16+AV_CLASS_CATEGORY_INPUT ] = 219 << 8 | 0x15,
109 [16+AV_CLASS_CATEGORY_OUTPUT ] = 201 << 8 | 0x05,
110 [16+AV_CLASS_CATEGORY_MUXER ] = 213 << 8 | 0x15,
111 [16+AV_CLASS_CATEGORY_DEMUXER ] = 207 << 8 | 0x05,
112 [16+AV_CLASS_CATEGORY_ENCODER ] = 51 << 8 | 0x16,
113 [16+AV_CLASS_CATEGORY_DECODER ] = 39 << 8 | 0x06,
114 [16+AV_CLASS_CATEGORY_FILTER ] = 155 << 8 | 0x12,
115 [16+AV_CLASS_CATEGORY_BITSTREAM_FILTER] = 192 << 8 | 0x14,
116 [16+AV_CLASS_CATEGORY_SWSCALER ] = 153 << 8 | 0x14,
117 [16+AV_CLASS_CATEGORY_SWRESAMPLER ] = 147 << 8 | 0x14,
118 [16+AV_CLASS_CATEGORY_HWDEVICE ] = 214 << 8 | 0x13,
119 [16+AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT ] = 213 << 8 | 0x15,
120 [16+AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT ] = 207 << 8 | 0x05,
121 [16+AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT ] = 213 << 8 | 0x15,
122 [16+AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT ] = 207 << 8 | 0x05,
123 [16+AV_CLASS_CATEGORY_DEVICE_OUTPUT ] = 213 << 8 | 0x15,
124 [16+AV_CLASS_CATEGORY_DEVICE_INPUT ] = 207 << 8 | 0x05,
125};
126
127static int use_color = -1;
128
129#if defined(_WIN32) && HAVE_SETCONSOLETEXTATTRIBUTE && HAVE_GETSTDHANDLE
130static void win_console_puts(const char *str)
131{
132 const uint8_t *q = str;
133 uint16_t line[LINE_SZ];
134
135 while (*q) {
136 uint16_t *buf = line;
137 DWORD nb_chars = 0;
138 DWORD written;
139
140 while (*q && nb_chars < LINE_SZ - 1) {
141 uint32_t ch;
142 uint16_t tmp;
143
144 GET_UTF8(ch, *q ? *q++ : 0, ch = 0xfffd; goto continue_on_invalid;)
145continue_on_invalid:
146 PUT_UTF16(ch, tmp, *buf++ = tmp; nb_chars++;)
147 }
148
149 WriteConsoleW(con, line, nb_chars, &written, NULL);
150 }
151}
152#endif
153
154static void check_color_terminal(void)
155{
156 char *term = getenv("TERM");
157
158#if defined(_WIN32) && HAVE_SETCONSOLETEXTATTRIBUTE && HAVE_GETSTDHANDLE
159 CONSOLE_SCREEN_BUFFER_INFO con_info;
160 DWORD dummy;
161 con = GetStdHandle(STD_ERROR_HANDLE);
162 if (con != INVALID_HANDLE_VALUE && !GetConsoleMode(con, &dummy))
163 con = INVALID_HANDLE_VALUE;
164 if (con != INVALID_HANDLE_VALUE) {
165 GetConsoleScreenBufferInfo(con, &con_info);
166 attr_orig = con_info.wAttributes;
167 background = attr_orig & 0xF0;
168 }
169#endif
170
171 if (getenv("AV_LOG_FORCE_NOCOLOR")) {
172 use_color = 0;
173 } else if (getenv("AV_LOG_FORCE_COLOR")) {
174 use_color = 1;
175 } else {
176#if defined(_WIN32) && HAVE_SETCONSOLETEXTATTRIBUTE && HAVE_GETSTDHANDLE
177 use_color = (con != INVALID_HANDLE_VALUE);
178#elif HAVE_ISATTY
179 use_color = (term && isatty(2));
180#else
181 use_color = 0;
182#endif
183 }
184
185 if (getenv("AV_LOG_FORCE_256COLOR") || term && strstr(term, "256color"))
186 use_color *= 256;
187}
188
189static void ansi_fputs(int level, int tint, const char *str, int local_use_color)
190{
191 if (local_use_color == 1) {
192 uint32_t intensity = (color[level] >> 4) & 15;
193 uint32_t fg = color[level] & 15;
194#if defined(_WIN32)
195 /* Piped stderr is 8-color ANSI. Linux keeps 0;33m; Windows console
196 * already uses win_color 14 (bright yellow), so match that here. */
197 if (level == AV_LOG_WARNING / 8)
198 intensity = 1;
199#endif
200 fprintf(stderr,
201 "\033[%"PRIu32";3%"PRIu32"m%s\033[0m",
202 intensity, fg, str);
203 } else if (tint && use_color == 256) {
204 fprintf(stderr,
205 "\033[48;5;%"PRIu32"m\033[38;5;%dm%s\033[0m",
206 (color[level] >> 16) & 0xff,
207 tint,
208 str);
209 } else if (local_use_color == 256) {
210 fprintf(stderr,
211 "\033[48;5;%"PRIu32"m\033[38;5;%"PRIu32"m%s\033[0m",
212 (color[level] >> 16) & 0xff,
213 (color[level] >> 8) & 0xff,
214 str);
215 } else
216 fputs(str, stderr);
217}
218
219static void colored_fputs(int level, int tint, const char *str)
220{
221 int local_use_color;
222 if (!*str)
223 return;
224
225 if (use_color < 0)
227
228 if (level == AV_LOG_INFO/8) local_use_color = 0;
229 else local_use_color = use_color;
230
231#if defined(_WIN32) && HAVE_SETCONSOLETEXTATTRIBUTE && HAVE_GETSTDHANDLE
232 if (con != INVALID_HANDLE_VALUE) {
233 if (local_use_color)
234 SetConsoleTextAttribute(con, background | win_color[level]);
235 win_console_puts(str);
236 if (local_use_color)
237 SetConsoleTextAttribute(con, attr_orig);
238 } else {
239 ansi_fputs(level, tint, str, local_use_color);
240 }
241#else
242 ansi_fputs(level, tint, str, local_use_color);
243#endif
244
245}
246
247const char *av_default_item_name(void *ptr)
248{
249 return (*(AVClass **) ptr)->class_name;
250}
251
253{
254 return (*(AVClass **) ptr)->category;
255}
256
257static void sanitize(uint8_t *line){
258 while(*line){
259 if(*line < 0x08 || (*line > 0x0D && *line < 0x20))
260 *line='?';
261 line++;
262 }
263}
264
265static int get_category(void *ptr){
266 AVClass *avc = *(AVClass **) ptr;
267 if( !avc
268 || (avc->version&0xFF)<100
269 || avc->version < (51 << 16 | 59 << 8)
270 || avc->category >= AV_CLASS_CATEGORY_NB) return AV_CLASS_CATEGORY_NA + 16;
271
272 if(avc->get_category)
273 return avc->get_category(ptr) + 16;
274
275 return avc->category + 16;
276}
277
278static const char *get_level_str(int level)
279{
280 switch (level) {
281 case AV_LOG_QUIET:
282 return "quiet";
283 case AV_LOG_DEBUG:
284 return "debug";
285 case AV_LOG_TRACE:
286 return "trace";
287 case AV_LOG_VERBOSE:
288 return "verbose";
289 case AV_LOG_INFO:
290 return "info";
291 case AV_LOG_WARNING:
292 return "warning";
293 case AV_LOG_ERROR:
294 return "error";
295 case AV_LOG_FATAL:
296 return "fatal";
297 case AV_LOG_PANIC:
298 return "panic";
299 default:
300 return "";
301 }
302}
303
304static const char *item_name(void *obj, const AVClass *cls)
305{
306 return (cls->item_name ? cls->item_name : av_default_item_name)(obj);
307}
308
309static void format_date_now(AVBPrint* bp_time, int include_date)
310{
311 struct tm *ptm, tmbuf;
312 const int64_t time_us = av_gettime();
313 const int64_t time_ms = time_us / 1000;
314 const time_t time_s = time_ms / 1000;
315 const int millisec = time_ms - (time_s * 1000);
316 ptm = localtime_r(&time_s, &tmbuf);
317 if (ptm) {
318 if (include_date)
319 av_bprint_strftime(bp_time, "%Y-%m-%d ", ptm);
320
321 av_bprint_strftime(bp_time, "%H:%M:%S", ptm);
322 av_bprintf(bp_time, ".%03d ", millisec);
323 }
324}
325
326static void format_line(void *avcl, int level, const char *fmt, va_list vl,
327 AVBPrint part[5], int *print_prefix, int type[2])
328{
329 AVClass* avc = avcl ? *(AVClass **) avcl : NULL;
333 av_bprint_init(part+3, 0, 65536);
336
337 if(type) type[0] = type[1] = AV_CLASS_CATEGORY_NA + 16;
338 if (*print_prefix && avc) {
339 if (avc->parent_log_context_offset) {
340 AVClass** parent = *(AVClass ***) (((uint8_t *) avcl) +
342 if (parent && *parent) {
343 av_bprintf(part+0, "[%s @ %p] ",
344 item_name(parent, *parent), parent);
345 if(type) type[0] = get_category(parent);
346 }
347 }
348 av_bprintf(part+1, "[%s @ %p] ",
349 item_name(avcl, avc), avcl);
350 if(type) type[1] = get_category(avcl);
351 }
352
353 if (*print_prefix && (level > AV_LOG_QUIET) && (flags & (AV_LOG_PRINT_TIME | AV_LOG_PRINT_DATETIME)))
355
356 if (*print_prefix && (level > AV_LOG_QUIET) && (flags & AV_LOG_PRINT_LEVEL))
357 av_bprintf(part+2, "[%s] ", get_level_str(level));
358
359 av_vbprintf(part+3, fmt, vl);
360
361 if(*part[0].str || *part[1].str || *part[2].str || *part[3].str) {
362 char lastc = part[3].len && part[3].len <= part[3].size ? part[3].str[part[3].len - 1] : 0;
363 *print_prefix = lastc == '\n' || lastc == '\r';
364 }
365}
366
367void av_log_format_line(void *ptr, int level, const char *fmt, va_list vl,
368 char *line, int line_size, int *print_prefix)
369{
370 av_log_format_line2(ptr, level, fmt, vl, line, line_size, print_prefix);
371}
372
373int av_log_format_line2(void *ptr, int level, const char *fmt, va_list vl,
374 char *line, int line_size, int *print_prefix)
375{
376 AVBPrint part[5];
377 int ret;
378
379 format_line(ptr, level, fmt, vl, part, print_prefix, NULL);
380 ret = snprintf(line, line_size, "%s%s%s%s", part[0].str, part[1].str, part[2].str, part[3].str);
381 av_bprint_finalize(part+3, NULL);
382 return ret;
383}
384
385void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl)
386{
387 static int print_prefix = 1;
388 static int count;
389 static char prev[LINE_SZ];
390 AVBPrint part[5];
391 char line[LINE_SZ];
392 static int is_atty;
393 int type[2];
394 unsigned tint = 0;
395
396 if (level >= 0) {
397 tint = level & 0xff00;
398 level &= 0xff;
399 }
400
402 return;
404
405 format_line(ptr, level, fmt, vl, part, &print_prefix, type);
406 snprintf(line, sizeof(line), "%s%s%s%s", part[0].str, part[1].str, part[2].str, part[3].str);
407
408#if HAVE_ISATTY
409 if (!is_atty)
410 is_atty = isatty(2) ? 1 : -1;
411#endif
412
413 if (print_prefix && (atomic_load_explicit(&av_log_flags, memory_order_relaxed) & AV_LOG_SKIP_REPEATED) && !strcmp(line, prev) &&
414 *line && line[strlen(line) - 1] != '\r'){
415 count++;
416 if (is_atty == 1)
417 fprintf(stderr, " Last message repeated %d times\r", count);
418 goto end;
419 }
420 if (count > 0) {
421 fprintf(stderr, " Last message repeated %d times\n", count);
422 count = 0;
423 }
424 strcpy(prev, line);
425
426 sanitize(part[4].str);
427 colored_fputs(7, 0, part[4].str);
428 sanitize(part[0].str);
429 colored_fputs(type[0], 0, part[0].str);
430 sanitize(part[1].str);
431 colored_fputs(type[1], 0, part[1].str);
432 sanitize(part[2].str);
433 colored_fputs(av_clip(level >> 3, 0, NB_LEVELS - 1), tint >> 8, part[2].str);
434 sanitize(part[3].str);
435 colored_fputs(av_clip(level >> 3, 0, NB_LEVELS - 1), tint >> 8, part[3].str);
436
437#if CONFIG_VALGRIND_BACKTRACE
438 if (level <= BACKTRACE_LOGLEVEL)
439 VALGRIND_PRINTF_BACKTRACE("%s", "");
440#endif
441end:
442 av_bprint_finalize(part+3, NULL);
444}
445
446static void (*_Atomic av_log_callback)(void*, int, const char*, va_list) = av_log_default_callback;
447
448void av_log(void* avcl, int level, const char *fmt, ...)
449{
450 va_list vl;
451 va_start(vl, fmt);
452 av_vlog(avcl, level, fmt, vl);
453 va_end(vl);
454}
455
456void av_log_once(void* avcl, int initial_level, int subsequent_level, int *state, const char *fmt, ...)
457{
458 va_list vl;
459 va_start(vl, fmt);
460 av_vlog(avcl, *state ? subsequent_level : initial_level, fmt, vl);
461 va_end(vl);
462 *state = 1;
463}
464
465void av_vlog(void* avcl, int level, const char *fmt, va_list vl)
466{
467 AVClass* avc = avcl ? *(AVClass **) avcl : NULL;
468 void (*log_callback)(void*, int, const char*, va_list) =
470 if (avc && avc->version >= (50 << 16 | 15 << 8 | 2) &&
472 level += *(int *) (((uint8_t *) avcl) + avc->log_level_offset_offset);
473 if (log_callback)
474 log_callback(avcl, level, fmt, vl);
475}
476
481
486
491
496
497void av_log_set_callback(void (*callback)(void*, int, const char*, va_list))
498{
500}
501
502static void missing_feature_sample(int sample, void *avc, const char *msg,
503 va_list argument_list)
504{
505 av_vlog(avc, AV_LOG_WARNING, msg, argument_list);
506 av_log(avc, AV_LOG_WARNING, " is not implemented. Update your FFmpeg "
507 "version to the newest one from Git. If the problem still "
508 "occurs, it means that your file has a feature which has not "
509 "been implemented.\n");
510 if (sample)
511 av_log(avc, AV_LOG_WARNING, "If you want to help, upload a sample "
512 "of this file to https://streams.videolan.org/upload/ "
513 "and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)\n");
514}
515
516void avpriv_request_sample(void *avc, const char *msg, ...)
517{
518 va_list argument_list;
519
520 va_start(argument_list, msg);
521 missing_feature_sample(1, avc, msg, argument_list);
522 va_end(argument_list);
523}
524
525void avpriv_report_missing_feature(void *avc, const char *msg, ...)
526{
527 va_list argument_list;
528
529 va_start(argument_list, msg);
530 missing_feature_sample(0, avc, msg, argument_list);
531 va_end(argument_list);
532}
void av_bprintf(AVBPrint *buf, const char *fmt,...)
Definition bprint.c:121
void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max)
Definition bprint.c:68
AVBPrint public header.
#define AV_BPRINT_SIZE_AUTOMATIC
#define flags(name, subs,...)
Definition cbs_h264.c:74
common internal and external API header
#define GET_UTF8(val, GET_BYTE, ERROR)
Convert a UTF-8 character (up to 4 bytes) to its 32-bit UCS-4 encoded form.
Definition common.h:477
#define PUT_UTF16(val, tmp, PUT_16BIT)
Convert a 32-bit Unicode character to its UTF-16 encoded form (2 or 4 bytes).
Definition common.h:564
#define av_clip
Definition common.h:100
#define NULL
Definition coverity.c:32
long long int64_t
Definition coverity.c:34
static void callback(void *priv_data, int index, uint8_t *buf, int buf_size, int64_t time, enum dshowDeviceType devtype)
Definition dshow.c:342
static struct @346255127015250356166251341105367306144006377143 state
int ret
Definition ffplay.c:391
static int dummy
Definition ffplay.c:4417
static void log_callback(void *ptr, int level, const char *fmt, va_list vl)
Definition ffprobe.c:419
#define sample
int av_bprint_finalize(AVBPrint *buf, char **ret_str)
Finalize a print buffer.
Definition bprint.c:234
void av_bprint_strftime(AVBPrint *buf, const char *fmt, const struct tm *tm)
Append a formatted date and time to a print buffer.
Definition bprint.c:165
void av_vbprintf(AVBPrint *buf, const char *fmt, va_list vl_arg)
Append a formatted string to a print buffer.
Definition bprint.c:98
#define AV_LOG_TRACE
Extremely verbose debugging, useful for libav* development.
Definition log.h:236
#define AV_LOG_PANIC
Something went really wrong and we will crash now.
Definition log.h:197
#define AV_LOG_QUIET
Print no output.
Definition log.h:192
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
Definition log.h:231
#define AV_LOG_WARNING
Something somehow does not look correct.
Definition log.h:216
#define AV_LOG_FATAL
Something went wrong and recovery is not possible.
Definition log.h:204
#define AV_LOG_VERBOSE
Detailed information.
Definition log.h:226
#define AV_LOG_INFO
Standard information.
Definition log.h:221
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition log.h:210
#define AV_LOG_PRINT_DATETIME
Include system date and time in log output.
Definition log.h:418
int av_log_format_line2(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.
Definition log.c:373
void av_log_set_callback(void(*callback)(void *, int, const char *, va_list))
Set the logging callback.
Definition log.c:497
#define AV_LOG_PRINT_TIME
Include system time in log output.
Definition log.h:413
const char * av_default_item_name(void *ptr)
Return the context name.
Definition log.c:247
void av_log_set_level(int level)
Set the log level.
Definition log.c:482
void av_log_default_callback(void *ptr, int level, const char *fmt, va_list vl)
Default logging callback.
Definition log.c:385
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.
Definition log.c:465
#define AV_LOG_SKIP_REPEATED
Skip repeated messages, this requires the user app to use av_log() instead of (f)printf as the 2 woul...
Definition log.h:400
AVClassCategory av_default_get_category(void *ptr)
Definition log.c:252
int av_log_get_flags(void)
Definition log.c:492
#define AV_LOG_PRINT_LEVEL
Include the log severity in messages originating from codecs.
Definition log.h:408
int av_log_get_level(void)
Get the current log level.
Definition log.c:477
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.
Definition log.c:367
void av_log_set_flags(int arg)
Definition log.c:487
uint32_t type
Definition jpegmpfenc.c:80
const char * arg
Definition jacosubdec.c:66
common internal API header
#define AV_MUTEX_INITIALIZER
Definition thread.h:185
static int ff_mutex_unlock(AVMutex *mutex)
Definition thread.h:189
static int ff_mutex_lock(AVMutex *mutex)
Definition thread.h:188
#define AVMutex
Definition thread.h:184
item_name
Definition libkvazaar.c:311
static void check_color_terminal(void)
Definition log.c:154
static void colored_fputs(int level, int tint, const char *str)
Definition log.c:219
static int get_category(void *ptr)
Definition log.c:265
static void missing_feature_sample(int sample, void *avc, const char *msg, va_list argument_list)
Definition log.c:502
static atomic_int av_log_level
Definition log.c:59
void av_log_once(void *avcl, int initial_level, int subsequent_level, int *state, const char *fmt,...)
Definition log.c:456
#define LINE_SZ
Definition log.c:51
static int use_color
Definition log.c:127
static const char * get_level_str(int level)
Definition log.c:278
static void ansi_fputs(int level, int tint, const char *str, int local_use_color)
Definition log.c:189
static atomic_int av_log_flags
Definition log.c:60
static void format_date_now(AVBPrint *bp_time, int include_date)
Definition log.c:309
void avpriv_report_missing_feature(void *avc, const char *msg,...)
Definition log.c:525
static void format_line(void *avcl, int level, const char *fmt, va_list vl, AVBPrint part[5], int *print_prefix, int type[2])
Definition log.c:326
static void sanitize(uint8_t *line)
Definition log.c:257
AVClassCategory
Definition log.h:28
@ AV_CLASS_CATEGORY_INPUT
Definition log.h:30
@ AV_CLASS_CATEGORY_MUXER
Definition log.h:32
@ AV_CLASS_CATEGORY_SWSCALER
Definition log.h:38
@ AV_CLASS_CATEGORY_BITSTREAM_FILTER
Definition log.h:37
@ AV_CLASS_CATEGORY_DEVICE_OUTPUT
Definition log.h:45
@ AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT
Definition log.h:43
@ AV_CLASS_CATEGORY_NB
not part of ABI/API
Definition log.h:47
@ AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT
Definition log.h:41
@ AV_CLASS_CATEGORY_NA
Definition log.h:29
@ AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT
Definition log.h:42
@ AV_CLASS_CATEGORY_FILTER
Definition log.h:36
@ AV_CLASS_CATEGORY_DEMUXER
Definition log.h:33
@ AV_CLASS_CATEGORY_OUTPUT
Definition log.h:31
@ AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT
Definition log.h:44
@ AV_CLASS_CATEGORY_DEVICE_INPUT
Definition log.h:46
@ AV_CLASS_CATEGORY_SWRESAMPLER
Definition log.h:39
@ AV_CLASS_CATEGORY_ENCODER
Definition log.h:34
@ AV_CLASS_CATEGORY_DECODER
Definition log.h:35
@ AV_CLASS_CATEGORY_HWDEVICE
Definition log.h:40
static const char * obj
Definition mscl.c:57
#define NB_LEVELS
Definition pixlet.c:35
static AVMutex mutex
Definition resman.c:61
@ memory_order_relaxed
Definition stdatomic.h:29
int atomic_int
Definition stdatomic.h:63
#define atomic_load_explicit(object, order)
Definition stdatomic.h:247
#define _Atomic
Definition stdatomic.h:117
#define atomic_store_explicit(object, desired, order)
Definition stdatomic.h:253
Describe the class of an AVClass context structure.
Definition log.h:76
AVClassCategory(* get_category)(void *ctx)
Callback to return the instance category.
Definition log.h:140
AVClassCategory category
Category used for visualization (like color).
Definition log.h:133
int version
LIBAVUTIL_VERSION with which this structure was created.
Definition log.h:104
int parent_log_context_offset
Offset in the structure where a pointer to the parent context for logging is stored.
Definition log.h:124
const char *(* item_name)(void *ctx)
A pointer to a function which returns the name of a context instance ctx associated with the class.
Definition log.h:87
int log_level_offset_offset
Offset in the structure where the log level offset is stored.
Definition log.h:113
uint8_t level
Definition svq3.c:208
#define avpriv_request_sample(...)
#define av_log(a,...)
static uint8_t tmp[40]
Definition aes_ctr.c:52
int64_t av_gettime(void)
Get the current time in microseconds.
Definition time.c:40
#define localtime_r