mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-07-07 04:08:13 +08:00
整理命名空间 (#1409)
* feat: remove using namespace mediakit in header files. (cherry picked from commit d44aeb339a8a0e1f0455be82b21fe4b1b536299f) * feat: remove using namespace mediakit in FFmpegSource.h * feat: remove using namespace mediakit in RtpExt.h * feat: remove using namespace mediakit in header files. * feat: remove using namespace std in header files. * feat: remove using namespace std in header files when zltoolkit remove std in header * 补充命名空间 * 整理命名空间 * 整理命名空间2 * 修复macos ci * 修复编译问题 * 修复编译问题2 * 修复编译问题3 Co-authored-by: Johnny <hellojinqiang@gmail.com> Co-authored-by: Xiaofeng Wang <wasphin@gmail.com>
This commit is contained in:
@@ -14,30 +14,29 @@
|
||||
#include "Rtsp/Rtsp.h"
|
||||
#include "Rtcp/RtcpFCI.h"
|
||||
|
||||
using namespace mediakit;
|
||||
|
||||
class NackList {
|
||||
public:
|
||||
NackList() = default;
|
||||
~NackList() = default;
|
||||
|
||||
void push_back(RtpPacket::Ptr rtp);
|
||||
void for_each_nack(const FCI_NACK &nack, const function<void(const RtpPacket::Ptr &rtp)> &cb);
|
||||
void push_back(mediakit::RtpPacket::Ptr rtp);
|
||||
void for_each_nack(const mediakit::FCI_NACK &nack, const std::function<void(const mediakit::RtpPacket::Ptr &rtp)> &cb);
|
||||
|
||||
private:
|
||||
void pop_front();
|
||||
uint32_t get_cache_ms();
|
||||
RtpPacket::Ptr *get_rtp(uint16_t seq);
|
||||
mediakit::RtpPacket::Ptr *get_rtp(uint16_t seq);
|
||||
|
||||
private:
|
||||
deque<uint16_t> _nack_cache_seq;
|
||||
unordered_map<uint16_t, RtpPacket::Ptr> _nack_cache_pkt;
|
||||
std::deque<uint16_t> _nack_cache_seq;
|
||||
std::unordered_map<uint16_t, mediakit::RtpPacket::Ptr> _nack_cache_pkt;
|
||||
};
|
||||
|
||||
class NackContext {
|
||||
public:
|
||||
using Ptr = std::shared_ptr<NackContext>;
|
||||
using onNack = function<void(const FCI_NACK &nack)>;
|
||||
using onNack = std::function<void(const mediakit::FCI_NACK &nack)>;
|
||||
//最大保留的rtp丢包状态个数
|
||||
static constexpr auto kNackMaxSize = 1024;
|
||||
//rtp丢包状态最长保留时间
|
||||
@@ -56,14 +55,14 @@ public:
|
||||
|
||||
private:
|
||||
void eraseFrontSeq();
|
||||
void doNack(const FCI_NACK &nack, bool record_nack);
|
||||
void recordNack(const FCI_NACK &nack);
|
||||
void doNack(const mediakit::FCI_NACK &nack, bool record_nack);
|
||||
void recordNack(const mediakit::FCI_NACK &nack);
|
||||
void onRtx(uint16_t seq);
|
||||
|
||||
private:
|
||||
int _rtt = 50;
|
||||
onNack _cb;
|
||||
set<uint16_t> _seq;
|
||||
std::set<uint16_t> _seq;
|
||||
uint16_t _last_max_seq = 0;
|
||||
|
||||
struct NackStatus{
|
||||
@@ -71,7 +70,7 @@ private:
|
||||
uint64_t update_stamp;
|
||||
int nack_count = 0;
|
||||
};
|
||||
map<uint16_t/*seq*/, NackStatus > _nack_send_status;
|
||||
std::map<uint16_t/*seq*/, NackStatus > _nack_send_status;
|
||||
};
|
||||
|
||||
#endif //ZLMEDIAKIT_NACK_H
|
||||
|
||||
Reference in New Issue
Block a user