mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
This commit is contained in:
commit
60c8b37f05
10 changed files with 421 additions and 134 deletions
|
@ -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.
|
||||
|
@ -510,6 +533,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,
|
||||
|
@ -598,6 +623,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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue