RTC: Refine NACK check, interval, time

pull/2199/head
winlin 4 years ago
parent 627688c582
commit 5919865e5d

@ -2295,8 +2295,7 @@ void SrsRtcConnection::check_send_nacks(SrsRtpNackForReceiver* nack, uint32_t ss
rtcpNack.set_media_ssrc(ssrc);
nack->get_nack_seqs(rtcpNack, timeout_nacks);
sent_nacks = rtcpNack.get_lost_sns().size();
if(!sent_nacks){
if(rtcpNack.empty()){
return;
}

@ -190,7 +190,7 @@ SrsNackOption::SrsNackOption()
max_nack_interval = 500 * SRS_UTIME_MILLISECONDS;
min_nack_interval = 20 * SRS_UTIME_MILLISECONDS;
nack_check_interval = 3 * SRS_UTIME_MILLISECONDS;
nack_check_interval = 20 * SRS_UTIME_MILLISECONDS;
//TODO: FIXME: audio and video using diff nack strategy
// video:
@ -259,8 +259,7 @@ void SrsRtpNackForReceiver::check_queue_size()
void SrsRtpNackForReceiver::get_nack_seqs(SrsRtcpNack& seqs, uint32_t& timeout_nacks)
{
// TODO: FIXME: Use packet as tick count, not clock.
srs_utime_t now = srs_update_system_time();
srs_utime_t now = srs_get_system_time();
srs_utime_t interval = now - pre_check_time_;
if (interval < opts_.nack_check_interval) {

@ -1212,6 +1212,11 @@ vector<uint16_t> SrsRtcpNack::get_lost_sns() const
return sn;
}
bool SrsRtcpNack::empty()
{
return lost_sns_.empty();
}
void SrsRtcpNack::set_media_ssrc(uint32_t ssrc)
{
media_ssrc_ = ssrc;

@ -345,6 +345,7 @@ public:
uint32_t get_media_ssrc() const;
std::vector<uint16_t> get_lost_sns() const;
bool empty();
void set_media_ssrc(uint32_t ssrc);
void add_lost_sn(uint16_t sn);

Loading…
Cancel
Save