1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
| #include <android/log.h> static int use_log_report = 0;
#define FF_LOG_TAG "FFmpeg_VideoEditor"
#define FF_LOG_UNKNOWN ANDROID_LOG_UNKNOWN #define FF_LOG_DEFAULT ANDROID_LOG_DEFAULT
#define FF_LOG_VERBOSE ANDROID_LOG_VERBOSE #define FF_LOG_DEBUG ANDROID_LOG_DEBUG #define FF_LOG_INFO ANDROID_LOG_INFO #define FF_LOG_WARN ANDROID_LOG_WARN #define FF_LOG_ERROR ANDROID_LOG_ERROR #define FF_LOG_FATAL ANDROID_LOG_FATAL #define FF_LOG_SILENT ANDROID_LOG_SILENT
#define VLOG(level, TAG, ...) ((void)__android_log_vprint(level, TAG, __VA_ARGS__)) #define VLOGV(...) VLOG(FF_LOG_VERBOSE, FF_LOG_TAG, __VA_ARGS__) #define VLOGD(...) VLOG(FF_LOG_DEBUG, FF_LOG_TAG, __VA_ARGS__) #define VLOGI(...) VLOG(FF_LOG_INFO, FF_LOG_TAG, __VA_ARGS__) #define VLOGW(...) VLOG(FF_LOG_WARN, FF_LOG_TAG, __VA_ARGS__) #define VLOGE(...) VLOG(FF_LOG_ERROR, FF_LOG_TAG, __VA_ARGS__)
#define ALOG(level, TAG, ...) ((void)__android_log_print(level, TAG, __VA_ARGS__)) #define ALOGV(...) ALOG(FF_LOG_VERBOSE, FF_LOG_TAG, __VA_ARGS__) #define ALOGD(...) ALOG(FF_LOG_DEBUG, FF_LOG_TAG, __VA_ARGS__) #define ALOGI(...) ALOG(FF_LOG_INFO, FF_LOG_TAG, __VA_ARGS__) #define ALOGW(...) ALOG(FF_LOG_WARN, FF_LOG_TAG, __VA_ARGS__) #define ALOGE(...) ALOG(FF_LOG_ERROR, FF_LOG_TAG, __VA_ARGS__)
#define LOGE(format, ...) __android_log_print(ANDROID_LOG_ERROR, FF_LOG_TAG, format, ##__VA_ARGS__) #define LOGI(format, ...) __android_log_print(ANDROID_LOG_INFO, FF_LOG_TAG, format, ##__VA_ARGS__)
static void ffp_log_callback_brief(void *ptr, int level, const char *fmt, va_list vl) { int ffplv = FF_LOG_VERBOSE; if (level <= AV_LOG_ERROR) ffplv = FF_LOG_ERROR; else if (level <= AV_LOG_WARNING) ffplv = FF_LOG_WARN; else if (level <= AV_LOG_INFO) ffplv = FF_LOG_INFO; else if (level <= AV_LOG_VERBOSE) ffplv = FF_LOG_VERBOSE; else ffplv = FF_LOG_DEBUG;
if (level <= AV_LOG_INFO) VLOG(ffplv, FF_LOG_TAG, fmt, vl); }
static void ffp_log_callback_report(void *ptr, int level, const char *fmt, va_list vl) { int ffplv = FF_LOG_VERBOSE; if (level <= AV_LOG_ERROR) ffplv = FF_LOG_ERROR; else if (level <= AV_LOG_WARNING) ffplv = FF_LOG_WARN; else if (level <= AV_LOG_INFO) ffplv = FF_LOG_INFO; else if (level <= AV_LOG_VERBOSE) ffplv = FF_LOG_VERBOSE; else ffplv = FF_LOG_DEBUG;
va_list vl2; char line[1024]; static int print_prefix = 1;
va_copy(vl2, vl); av_log_format_line(ptr, level, fmt, vl2, line, sizeof(line), &print_prefix); va_end(vl2);
ALOG(ffplv, FF_LOG_TAG, "%s", line); }
|