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

@ -1521,10 +1521,10 @@ srs_error_t SrsRtcPublishStream::on_rtcp_sr(SrsRtcpSR* rtcp)
srs_error_t err = srs_success;
SrsNtp srs_ntp = SrsNtp::to_time_ms(rtcp->get_ntp());
srs_verbose("sender report, ssrc_of_sender=%u, rtp_time=%u, sender_packet_count=%u, sender_octec_count=%u",
rtcp->get_ssrc(), rtcp->get_rtp_ts(), rtcp->get_rtp_send_packets(), rtcp->get_rtp_send_bytes());
srs_verbose("sender report, ssrc_of_sender=%u, rtp_time=%u, sender_packet_count=%u, sender_octec_count=%u, ms=%u",
rtcp->get_ssrc(), rtcp->get_rtp_ts(), rtcp->get_rtp_send_packets(), rtcp->get_rtp_send_bytes(), srs_ntp.system_ms_);
update_send_report_time(rtcp->get_ssrc(), srs_ntp);
update_send_report_time(rtcp->get_ssrc(), srs_ntp, rtcp->get_rtp_ts());
return err;
}
@ -1664,16 +1664,16 @@ void SrsRtcPublishStream::update_rtt(uint32_t ssrc, int rtt)
}
}
void SrsRtcPublishStream::update_send_report_time(uint32_t ssrc, const SrsNtp& ntp)
void SrsRtcPublishStream::update_send_report_time(uint32_t ssrc, const SrsNtp& ntp, uint32_t rtp_time)
{
SrsRtcVideoRecvTrack* video_track = get_video_track(ssrc);
if (video_track) {
return video_track->update_send_report_time(ntp);
return video_track->update_send_report_time(ntp, rtp_time);
}
SrsRtcAudioRecvTrack* audio_track = get_audio_track(ssrc);
if (audio_track) {
return audio_track->update_send_report_time(ntp);
return audio_track->update_send_report_time(ntp, rtp_time);
}
}