添加rtp rtmp个数统计

This commit is contained in:
xia-chu 2021-02-05 16:49:11 +08:00
parent 62ba87dd0f
commit 14b318525e
6 changed files with 23 additions and 2 deletions

View File

@ -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////////////

View File

@ -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;

View File

@ -146,4 +146,8 @@ RtmpPacket::Ptr RtmpPacket::create(){
#endif #endif
} }
}//namespace mediakit }//namespace mediakit
namespace toolkit {
StatisticImp(mediakit::RtmpPacket);
}

View File

@ -213,6 +213,10 @@ private:
RtmpPacket(){ RtmpPacket(){
clear(); clear();
} }
private:
//对象个数统计
ObjectStatistic<RtmpPacket> _statistic;
}; };
/** /**

View File

@ -545,4 +545,8 @@ RtpPacket::Ptr RtpPacket::create(){
#endif #endif
} }
}//namespace mediakit }//namespace mediakit
namespace toolkit {
StatisticImp(mediakit::RtpPacket);
}

View File

@ -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 {