mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-07-04 01:37:33 +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:
@@ -17,8 +17,6 @@
|
||||
#include "RtpCodec.h"
|
||||
#include "RtspMediaSource.h"
|
||||
#include "Common/Stamp.h"
|
||||
using namespace std;
|
||||
using namespace toolkit;
|
||||
|
||||
namespace mediakit {
|
||||
|
||||
@@ -28,7 +26,7 @@ public:
|
||||
PacketSortor() = default;
|
||||
~PacketSortor() = default;
|
||||
|
||||
void setOnSort(function<void(SEQ seq, T &packet)> cb) {
|
||||
void setOnSort(std::function<void(SEQ seq, T &packet)> cb) {
|
||||
_cb = std::move(cb);
|
||||
}
|
||||
|
||||
@@ -116,7 +114,7 @@ private:
|
||||
_pkt_sort_cache_map.erase(it);
|
||||
}
|
||||
|
||||
void popIterator(typename map<SEQ, T>::iterator it) {
|
||||
void popIterator(typename std::map<SEQ, T>::iterator it) {
|
||||
auto seq = it->first;
|
||||
auto data = std::move(it->second);
|
||||
_pkt_sort_cache_map.erase(it);
|
||||
@@ -156,14 +154,14 @@ private:
|
||||
//排序缓存长度
|
||||
size_t _max_sort_size = kMin;
|
||||
//pkt排序缓存,根据seq排序
|
||||
map<SEQ, T> _pkt_sort_cache_map;
|
||||
std::map<SEQ, T> _pkt_sort_cache_map;
|
||||
//回调
|
||||
function<void(SEQ seq, T &packet)> _cb;
|
||||
std::function<void(SEQ seq, T &packet)> _cb;
|
||||
};
|
||||
|
||||
class RtpTrack : private PacketSortor<RtpPacket::Ptr>{
|
||||
public:
|
||||
class BadRtpException : public invalid_argument {
|
||||
class BadRtpException : public std::invalid_argument {
|
||||
public:
|
||||
template<typename Type>
|
||||
BadRtpException(Type &&type) : invalid_argument(std::forward<Type>(type)) {}
|
||||
@@ -185,14 +183,14 @@ protected:
|
||||
private:
|
||||
bool _disable_ntp = false;
|
||||
uint32_t _ssrc = 0;
|
||||
Ticker _ssrc_alive;
|
||||
toolkit::Ticker _ssrc_alive;
|
||||
NtpStamp _ntp_stamp;
|
||||
};
|
||||
|
||||
class RtpTrackImp : public RtpTrack{
|
||||
public:
|
||||
using OnSorted = function<void(RtpPacket::Ptr)>;
|
||||
using BeforeSorted = function<void(const RtpPacket::Ptr &)>;
|
||||
using OnSorted = std::function<void(RtpPacket::Ptr)>;
|
||||
using BeforeSorted = std::function<void(const RtpPacket::Ptr &)>;
|
||||
|
||||
RtpTrackImp() = default;
|
||||
~RtpTrackImp() override = default;
|
||||
|
||||
Reference in New Issue
Block a user