FFMPEG研究: Android调试FFMPEG程序

来源:互联网 发布:高中数学辅导书 知乎 编辑:程序博客网 时间:2024/06/18 01:28

为了方便在Android中调试基于FFMPEG的程序,需要对FFMPEG的log工具进行修改:

原来的av_log函数在log.h / log.c中声明和定义,如下

/** * 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 or NULL if general log. * @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);

先把它定向到Android 系统log中,修改如下


#ifdef MTK_ANDROID_LOG#define av_log(avcl, level, fmt, args...)  __android_log_print(ANDROID_LOG_INFO, "ALONG_FFMPEG", fmt, ##args)//void av_log(void* avcl, int level, const char *fmt, ...);#elsevoid av_log(void *avcl, int level, const char *fmt, ...) av_printf_format(3, 4);#endif










0 0