Commit 14b31852 by xia-chu

添加rtp rtmp个数统计

parent 62ba87dd
...@@ -1043,6 +1043,9 @@ void installWebApi() { ...@@ -1043,6 +1043,9 @@ void installWebApi() {
val["data"]["BufferRaw"] = (Json::UInt64)(ObjectStatistic<BufferRaw>::count()); val["data"]["BufferRaw"] = (Json::UInt64)(ObjectStatistic<BufferRaw>::count());
val["data"]["BufferLikeString"] = (Json::UInt64)(ObjectStatistic<BufferLikeString>::count()); val["data"]["BufferLikeString"] = (Json::UInt64)(ObjectStatistic<BufferLikeString>::count());
val["data"]["BufferList"] = (Json::UInt64)(ObjectStatistic<BufferList>::count()); val["data"]["BufferList"] = (Json::UInt64)(ObjectStatistic<BufferList>::count());
val["data"]["RtpPacket"] = (Json::UInt64)(ObjectStatistic<RtpPacket>::count());
val["data"]["RtmpPacket"] = (Json::UInt64)(ObjectStatistic<RtmpPacket>::count());
}); });
////////////以下是注册的Hook API//////////// ////////////以下是注册的Hook API////////////
......
...@@ -173,6 +173,8 @@ public: ...@@ -173,6 +173,8 @@ public:
uint32_t _pts = 0; uint32_t _pts = 0;
size_t _prefix_size = 0; size_t _prefix_size = 0;
BufferLikeString _buffer; BufferLikeString _buffer;
private:
//对象个数统计 //对象个数统计
ObjectStatistic<FrameImp> _statistic; ObjectStatistic<FrameImp> _statistic;
......
...@@ -147,3 +147,7 @@ RtmpPacket::Ptr RtmpPacket::create(){ ...@@ -147,3 +147,7 @@ RtmpPacket::Ptr RtmpPacket::create(){
} }
}//namespace mediakit }//namespace mediakit
namespace toolkit {
StatisticImp(mediakit::RtmpPacket);
}
\ No newline at end of file
...@@ -213,6 +213,10 @@ private: ...@@ -213,6 +213,10 @@ private:
RtmpPacket(){ RtmpPacket(){
clear(); clear();
} }
private:
//对象个数统计
ObjectStatistic<RtmpPacket> _statistic;
}; };
/** /**
......
...@@ -546,3 +546,7 @@ RtpPacket::Ptr RtpPacket::create(){ ...@@ -546,3 +546,7 @@ RtpPacket::Ptr RtpPacket::create(){
} }
}//namespace mediakit }//namespace mediakit
namespace toolkit {
StatisticImp(mediakit::RtpPacket);
}
\ No newline at end of file
...@@ -172,6 +172,10 @@ public: ...@@ -172,6 +172,10 @@ public:
private: private:
friend class ResourcePool_l<RtpPacket>; friend class ResourcePool_l<RtpPacket>;
RtpPacket() = default; RtpPacket() = default;
private:
//对象个数统计
ObjectStatistic<RtpPacket> _statistic;
}; };
class RtpPayload { class RtpPayload {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论