mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-29 06:12:22 +08:00
fix timelatency not take effect and avoid buffer is liner avoid cycle
This commit is contained in:
@@ -1,25 +1,25 @@
|
||||
#ifndef ZLMEDIAKIT_SRT_PACKET_QUEUE_H
|
||||
#define ZLMEDIAKIT_SRT_PACKET_QUEUE_H
|
||||
#include "Packet.hpp"
|
||||
#include <algorithm>
|
||||
#include <list>
|
||||
#include <memory>
|
||||
#include <map>
|
||||
#include <list>
|
||||
#include <utility>
|
||||
#include <tuple>
|
||||
#include <utility>
|
||||
|
||||
#include "Packet.hpp"
|
||||
namespace SRT {
|
||||
|
||||
namespace SRT{
|
||||
|
||||
class PacketQueue
|
||||
{
|
||||
// for recv
|
||||
class PacketQueue {
|
||||
public:
|
||||
using Ptr = std::shared_ptr<PacketQueue>;
|
||||
using LostPair = std::pair<uint32_t,uint32_t>;
|
||||
using LostPair = std::pair<uint32_t, uint32_t>;
|
||||
|
||||
PacketQueue(uint32_t max_size,uint32_t init_seq,uint32_t lantency);
|
||||
PacketQueue(uint32_t max_size, uint32_t init_seq, uint32_t lantency);
|
||||
~PacketQueue() = default;
|
||||
bool inputPacket(DataPacket::Ptr pkt);
|
||||
std::list<DataPacket::Ptr> tryGetPacket();
|
||||
bool inputPacket(DataPacket::Ptr pkt,std::list<DataPacket::Ptr>& out);
|
||||
|
||||
uint32_t timeLantency();
|
||||
std::list<LostPair> getLostSeq();
|
||||
|
||||
@@ -28,21 +28,20 @@ public:
|
||||
size_t getAvailableBufferSize();
|
||||
uint32_t getExpectedSeq();
|
||||
|
||||
bool dropForRecv(uint32_t first,uint32_t last);
|
||||
bool drop(uint32_t first, uint32_t last,std::list<DataPacket::Ptr>& out);
|
||||
|
||||
bool dropForSend(uint32_t num);
|
||||
|
||||
DataPacket::Ptr findPacketBySeq(uint32_t seq);
|
||||
std::string dump();
|
||||
private:
|
||||
std::map<uint32_t,DataPacket::Ptr> _pkt_map;
|
||||
void tryInsertPkt(DataPacket::Ptr pkt);
|
||||
private:
|
||||
|
||||
std::map<uint32_t, DataPacket::Ptr> _pkt_map;
|
||||
|
||||
uint32_t _pkt_expected_seq = 0;
|
||||
uint32_t _pkt_cap;
|
||||
uint32_t _pkt_lantency;
|
||||
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace SRT
|
||||
|
||||
#endif //ZLMEDIAKIT_SRT_PACKET_QUEUE_H
|
||||
#endif // ZLMEDIAKIT_SRT_PACKET_QUEUE_H
|
||||
Reference in New Issue
Block a user