av_log 怎么使用?
来源:互联网 发布:java课程内容 编辑:程序博客网 时间:2024/04/29 06:16
我们使用ffmpeg的开发包进行开发时,可能会过多过少的使用 av_log ,同时也想观测下SDK API的日志情况,
这个时候,我们可以设置日志等级:
av_log_set_level
可是我们仍然发现,没有日志被显示?why ?
我们来看看 log.h
/**
* 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 av_log_set_callback** @param avcl A pointer to an arbitrary struct of which the first field is a* pointer to an AVClass struct.* @param level The importance level of the message expressed using a @ref* lavu_log_constants "Logging Constant".* @param fmt The format string (printf-compatible) that specifies how* subsequent arguments are converted to output.*/void av_log(void *avcl, int level, const char *fmt, ...) av_printf_format(3, 4);
默认的情况下,所有的日志被送到了 stderr。如果我们设置一个回调函数,则可以把日志回调到我们自定义的函数里。
我们来看看 av_log_set_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 av_log_default_callback** @param callback A logging function with a compatible signature.*/void av_log_set_callback(void (*callback)(void*, int, const char*, va_list));
也就是说,我们只需要设置一个线程安全的日志回调函数即可。
void logFF(void *, int level, const char *fmt, va_list ap){
}
av_log_set_callback(&logFF);
这样就可以了,不信你试试?^_^
0 0
- av_log 怎么使用?
- ffmpg,av_log
- ffmpeg 日志系统av_log()
- : undefined reference to `av_log' ffmpeg 编译例程出错 解决方法
- FFmpeg源代码简单分析:日志输出系统(av_log()等)
- FFmpeg源代码简单分析:日志输出系统(av_log()等)
- ffmpeg之将av_log,av_log_set_level的用法和意义
- ffmpeg源码简析(九)av_log(),AVClass,AVOption
- FFmpeg源代码简单分析:日志输出系统(av_log()等)
- [网络] 怎么使用CIDR
- 测试怎么使用TrackBack
- 怎么使用SSL
- UpdateData()函数怎么使用
- 怎么使用Mysql-Front
- 怎么使用Outlook Express
- UrlRewrite.NET怎么使用?
- 怎么使用InputStreamReader
- 怎么使用CTreeListCtrl
- poj 2080
- (13)Android之Adapter用法总结
- cocos2dx 3.2版本 ccsMac版RAPIDJSON_ASSERT(IsObject());报错解决办法
- OpenWrt(busybox版)配置dnspod动态域名客户端
- 居中的设置
- av_log 怎么使用?
- svn隐藏文件夹下内容
- hdoj 2050 折线分割平面
- UIView(UIViewAnimation) 的介绍
- Dijkstra模板题图论书p133
- 计算一个对象占用的内存
- 排排时间挺有意思
- <模板>米勒拉宾素数判定 题目是hdu4910
- NS3学习安排,随时更新