Gstreamer-LOG

相关连接:https://blog.****.net/knowledgebao/article/details/84621238


定义自己的LOG模块:

1,cat /etc/profile下增加GST_DEBUG变量(ffdecode,ffencode都是element,6是日志级别):

export GST_DEBUG=ffdecode:6,ffencode:6

2,element实现的.c文件开始位置增加如下代码:

GST_DEBUG_CATEGORY_STATIC (gst_ff_enc_ele_debug);
#define GST_CAT_DEFAULT gst_ff_enc_ele_debug

3,element的*_class_init函数增加如下代码:

  GST_DEBUG_CATEGORY_INIT(gst_ff_enc_ele_debug, "ffEnc",
      0, "ffmpeg Encode");


使用类似下边函数打印日志:

GST_LOG_OBJECT (gpointer obj, const char *format, ...)
GST_LOG (const char *format, ...)

...

日志级别定义:

https://gstreamer.freedesktop.org/documentation/tutorials/basic/debugging-tools.html

Gstreamer-LOG


遗留问题:

1,日志如何打印到文件?待补充

2,日志打印原理?待补充