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

RTC: Refactor code

This commit is contained in:
winlin 2020-05-19 17:49:34 +08:00
parent 23ddcbdaed
commit e3d010113f
5 changed files with 47 additions and 25 deletions

View file

@ -183,10 +183,6 @@ SrsRtpNackInfo::SrsRtpNackInfo()
req_nack_count_ = 0;
}
bool SrsRtpNackForReceiver::SeqComp::operator()(const uint16_t& pre_value, const uint16_t& value) const {
return srs_rtp_seq_distance(pre_value, value) > 0;
}
SrsRtpNackForReceiver::SrsRtpNackForReceiver(SrsRtpRingBuffer* rtp, size_t queue_size)
{
max_queue_size_ = queue_size;

View file

@ -30,6 +30,8 @@
#include <vector>
#include <map>
#include <srs_kernel_rtc_rtp.hpp>
class SrsRtpPacket2;
class SrsRtpQueue;
class SrsRtpRingBuffer;
@ -111,13 +113,9 @@ struct SrsRtpNackInfo
class SrsRtpNackForReceiver
{
private:
struct SeqComp {
bool operator()(const uint16_t& pre_value, const uint16_t& value) const;
};
private:
// Nack queue, seq order, oldest to newest.
std::map<uint16_t, SrsRtpNackInfo, SeqComp> queue_;
std::map<uint16_t, SrsRtpNackInfo, SrsSeqCompareLess> queue_;
// Max nack count.
size_t max_queue_size_;
SrsRtpRingBuffer* rtp_;