1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

RTC: Fix rtc to rtmp sync timestamp using sender report. (#2470)

* fix annotation spell failed

* RTC to RTMP using SenderReport to sync av timestamp

* update pion/webrtc versio from v3.0.4 -> v3.0.13, auto config sender/receiver report

* Add rtc push flv play regression test

* Add unit test of ntp and av sync time

* Take flag CXX to makefile of utest

* Add annotation about rtc unit test

* Fix compiler error in C++98

* Add FFmpeg log callback funciton.
This commit is contained in:
john 2021-08-16 17:32:35 -05:00 committed by GitHub
parent 5e876277b6
commit ea8cff6163
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
301 changed files with 13882 additions and 8323 deletions

View file

@ -22,6 +22,48 @@ static const char* id2codec_name(SrsAudioCodecId id)
}
}
class SrsFFmpegLogHelper {
public:
SrsFFmpegLogHelper() {
av_log_set_callback(ffmpeg_log_callback);
av_log_set_level(AV_LOG_TRACE);
}
static void ffmpeg_log_callback(void*, int level, const char* fmt, va_list vl)
{
static char buf[4096] = {0};
int nbytes = vsnprintf(buf, sizeof(buf), fmt, vl);
if (nbytes > 0) {
// Srs log is always start with new line, replcae '\n' to '\0', make log easy to read.
if (buf[nbytes - 1] == '\n') {
buf[nbytes - 1] = '\0';
}
switch (level) {
case AV_LOG_PANIC:
case AV_LOG_FATAL:
case AV_LOG_ERROR:
srs_error("%s", buf);
break;
case AV_LOG_WARNING:
srs_warn("%s", buf);
break;
case AV_LOG_INFO:
srs_trace("%s", buf);
break;
case AV_LOG_VERBOSE:
case AV_LOG_DEBUG:
case AV_LOG_TRACE:
default:
srs_verbose("%s", buf);
break;
}
}
}
};
// Register FFmpeg log callback funciton.
SrsFFmpegLogHelper _srs_ffmpeg_log_helper;
SrsAudioTranscoder::SrsAudioTranscoder()
{
dec_ = NULL;