diff --git a/trunk/src/app/srs_app_rtc_queue.cpp b/trunk/src/app/srs_app_rtc_queue.cpp index 3919e385d..21ba6c781 100644 --- a/trunk/src/app/srs_app_rtc_queue.cpp +++ b/trunk/src/app/srs_app_rtc_queue.cpp @@ -141,6 +141,14 @@ void SrsRtpRingBuffer::notify_drop_seq(uint16_t seq) { } +SrsNackOption::SrsNackOption() +{ + max_count = 10; + max_alive_time = 2 * SRS_UTIME_SECONDS; + first_nack_interval = 10 * SRS_UTIME_MILLISECONDS; + nack_interval = 400 * SRS_UTIME_MILLISECONDS; +} + SrsRtpNackInfo::SrsRtpNackInfo() { generate_time_ = srs_update_system_time(); @@ -148,6 +156,10 @@ SrsRtpNackInfo::SrsRtpNackInfo() req_nack_count_ = 0; } +bool SrsRtpNackForReceiver::SeqComp::operator()(const uint16_t& low, const uint16_t& high) const { + return srs_rtp_seq_distance(low, high) > 0; +} + SrsRtpNackForReceiver::SrsRtpNackForReceiver(SrsRtpRingBuffer* rtp, size_t queue_size) { max_queue_size_ = queue_size; diff --git a/trunk/src/app/srs_app_rtc_queue.hpp b/trunk/src/app/srs_app_rtc_queue.hpp index 09af76158..ecda676c9 100644 --- a/trunk/src/app/srs_app_rtc_queue.hpp +++ b/trunk/src/app/srs_app_rtc_queue.hpp @@ -101,39 +101,31 @@ public: struct SrsNackOption { - SrsNackOption() - { - // Default nack option. - max_count = 10; - max_alive_time = 2 * SRS_UTIME_SECONDS; - first_nack_interval = 10 * SRS_UTIME_MILLISECONDS; - nack_interval = 400 * SRS_UTIME_MILLISECONDS; - } int max_count; srs_utime_t max_alive_time; int64_t first_nack_interval; int64_t nack_interval; + + SrsNackOption(); }; struct SrsRtpNackInfo { - SrsRtpNackInfo(); - // Use to control the time of first nack req and the life of seq. srs_utime_t generate_time_; // Use to control nack interval. srs_utime_t pre_req_nack_time_; // Use to control nack times. int req_nack_count_; + + SrsRtpNackInfo(); }; class SrsRtpNackForReceiver { private: struct SeqComp { - bool operator()(const uint16_t& low, const uint16_t& high) const { - return srs_rtp_seq_distance(low, high) > 0; - } + bool operator()(const uint16_t& low, const uint16_t& high) const; }; private: // Nack queue, seq order, oldest to newest.