mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-05-07 07:37:12 +08:00
srt support tlpktdrop=0 feature
This commit is contained in:
@@ -2,9 +2,10 @@
|
||||
|
||||
namespace SRT {
|
||||
|
||||
PacketSendQueue::PacketSendQueue(uint32_t max_size, uint32_t latency)
|
||||
PacketSendQueue::PacketSendQueue(uint32_t max_size, uint32_t latency,uint32_t flag)
|
||||
: _pkt_cap(max_size)
|
||||
, _pkt_latency(latency) {}
|
||||
, _pkt_latency(latency)
|
||||
, _srt_flag(flag) {}
|
||||
|
||||
bool PacketSendQueue::drop(uint32_t num) {
|
||||
decltype(_pkt_cache.begin()) it;
|
||||
@@ -24,12 +25,16 @@ bool PacketSendQueue::inputPacket(DataPacket::Ptr pkt) {
|
||||
while (_pkt_cache.size() > _pkt_cap) {
|
||||
_pkt_cache.pop_front();
|
||||
}
|
||||
while (timeLatency() > _pkt_latency) {
|
||||
while (timeLatency() > _pkt_latency && TLPKTDrop()) {
|
||||
_pkt_cache.pop_front();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PacketSendQueue::TLPKTDrop(){
|
||||
return (_srt_flag&HSExtMessage::HS_EXT_MSG_TLPKTDROP) && (_srt_flag &HSExtMessage::HS_EXT_MSG_TSBPDSND);
|
||||
}
|
||||
|
||||
std::list<DataPacket::Ptr> PacketSendQueue::findPacketBySeq(uint32_t start, uint32_t end) {
|
||||
std::list<DataPacket::Ptr> re;
|
||||
decltype(_pkt_cache.begin()) it;
|
||||
|
||||
Reference in New Issue
Block a user