mirror of
https://github.com/asticode/go-astiav.git
synced 2025-09-26 20:21:15 +08:00
26 lines
534 B
C
26 lines
534 B
C
#include "log.h"
|
|
#include <libavutil/log.h>
|
|
#include <stdio.h>
|
|
|
|
void astiavLogCallback(void *ptr, int level, const char *fmt, va_list vl)
|
|
{
|
|
if (level > av_log_get_level()) return;
|
|
char msg[1024];
|
|
vsprintf(msg, fmt, vl);
|
|
goAstiavLogCallback(ptr, level, (char*)(fmt), msg);
|
|
}
|
|
|
|
void astiavSetLogCallback()
|
|
{
|
|
av_log_set_callback(astiavLogCallback);
|
|
}
|
|
|
|
void astiavResetLogCallback()
|
|
{
|
|
av_log_set_callback(av_log_default_callback);
|
|
}
|
|
|
|
void astiavLog(void* ptr, int level, const char *fmt, char* arg)
|
|
{
|
|
av_log(ptr, level, fmt, arg);
|
|
} |