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

add NACK suport, remove debug code, verbose log

This commit is contained in:
xiaozhihong 2020-03-14 22:11:01 +08:00
parent 6c88f58079
commit 2b56f9ee59
7 changed files with 404 additions and 62 deletions

View file

@ -62,6 +62,7 @@ class SrsBuffer;
#ifdef SRS_AUTO_HDS
class SrsHds;
#endif
class SrsRtpSharedPacket;
// The time jitter algorithm:
// 1. full, to ensure stream start at zero, and ensure stream monotonically increasing.
@ -324,6 +325,28 @@ public:
virtual SrsSharedPtrMessage* pop();
};
class SrsRtpPacketQueue
{
private:
struct SeqComp
{
bool operator()(const uint16_t& l, const uint16_t& r) const
{
return ((int16_t)(r - l)) > 0;
}
};
private:
std::map<uint16_t, SrsRtpSharedPacket*, SeqComp> pkt_queue;
public:
SrsRtpPacketQueue();
virtual ~SrsRtpPacketQueue();
public:
void clear();
void push(std::vector<SrsRtpSharedPacket*>& pkts);
void insert(const uint16_t& sequence, SrsRtpSharedPacket* pkt);
SrsRtpSharedPacket* find(const uint16_t& sequence);
};
// The hub for origin is a collection of utilities for origin only,
// For example, DVR, HLS, Forward and Transcode are only available for origin,
// they are meanless for edge server.
@ -499,6 +522,8 @@ private:
bool mix_correct;
// The mix queue to implements the mix correct algorithm.
SrsMixQueue* mix_queue;
// rtp packet queue
SrsRtpPacketQueue* rtp_queue;
// For play, whether enabled atc.
// The atc(use absolute time and donot adjust time),
// directly use msg time and donot adjust if atc is true,
@ -587,6 +612,9 @@ public:
virtual void on_edge_proxy_unpublish();
public:
virtual std::string get_curr_origin();
public:
// Find rtp packet by sequence
SrsRtpSharedPacket* find_rtp_packet(const uint16_t& seq);
};
#endif