[mod_av] print I-frame

This commit is contained in:
wangxiaoli 2019-04-12 13:50:47 +08:00 committed by Andrey Volk
parent f7ed53b58d
commit 693a264487
1 changed files with 15 additions and 1 deletions

View File

@ -119,7 +119,21 @@ static void log_callback(void *ptr, int level, const char *fmt, va_list vl)
}
// switch_level = SWITCH_LOG_ERROR; // hardcoded for debug
switch_log_vprintf(SWITCH_CHANNEL_LOG_CLEAN, switch_level, fmt, vl);
if (mod_av_globals.debug < 7) {
switch_log_vprintf(SWITCH_CHANNEL_LOG_CLEAN, switch_level, fmt, vl);
} else {
char buffer[1024] = {0};
char *s = NULL;
vsprintf(buffer, fmt, vl);
s = strstr(buffer, "nal_unit_type");
if (!zstr(s) && *(s+15) == '7') {
switch_log_printf(SWITCH_CHANNEL_LOG, switch_level, "Read SPS\n");
} else if (!zstr(s) && *(s+15) == '8') {
switch_log_printf(SWITCH_CHANNEL_LOG, switch_level, "Read PPS\n");
} else if (!zstr(s) && *(s+15) == '5') {
switch_log_printf(SWITCH_CHANNEL_LOG, switch_level, "Read I-frame\n");
}
}
}