Commit 5d7ed153 by xiongziliang

流量汇报事件添加时长字段

parent cacd2412
......@@ -108,7 +108,7 @@ extern const char kBroadcastShellLogin[];
//停止rtsp/rtmp/http-flv会话后流量汇报事件广播
extern const char kBroadcastFlowReport[];
#define BroadcastFlowReportArgs const MediaInfo &args,const uint64_t &totalBytes,TcpSession &sender
#define BroadcastFlowReportArgs const MediaInfo &args,const uint64_t &totalBytes,const uint64_t &totalDuration,TcpSession &sender
//流量汇报事件流量阈值,单位KB,默认1MB
extern const char kFlowThreshold[];
......
......@@ -169,7 +169,11 @@ void HttpSession::onError(const SockException& err) {
GET_CONFIG_AND_REGISTER(uint32_t,iFlowThreshold,Broadcast::kFlowThreshold);
if(m_ui64TotalBytes > iFlowThreshold * 1024){
NoticeCenter::Instance().emitEvent(Broadcast::kBroadcastFlowReport,m_mediaInfo,m_ui64TotalBytes,*this);
NoticeCenter::Instance().emitEvent(Broadcast::kBroadcastFlowReport,
m_mediaInfo,
m_ui64TotalBytes,
m_ticker.createdTime()/1000,
*this);
}
}
......
......@@ -58,7 +58,11 @@ void RtmpSession::onError(const SockException& err) {
GET_CONFIG_AND_REGISTER(uint32_t,iFlowThreshold,Broadcast::kFlowThreshold);
if(m_ui64TotalBytes > iFlowThreshold * 1024){
NoticeCenter::Instance().emitEvent(Broadcast::kBroadcastFlowReport,m_mediaInfo,m_ui64TotalBytes,*this);
NoticeCenter::Instance().emitEvent(Broadcast::kBroadcastFlowReport,
m_mediaInfo,
m_ui64TotalBytes,
m_ticker.createdTime()/1000,
*this);
}
}
......
......@@ -122,7 +122,11 @@ void RtspSession::onError(const SockException& err) {
//流量统计事件广播
GET_CONFIG_AND_REGISTER(uint32_t,iFlowThreshold,Broadcast::kFlowThreshold);
if(m_ui64TotalBytes > iFlowThreshold * 1024){
NoticeCenter::Instance().emitEvent(Broadcast::kBroadcastFlowReport,m_mediaInfo,m_ui64TotalBytes,*this);
NoticeCenter::Instance().emitEvent(Broadcast::kBroadcastFlowReport,
m_mediaInfo,
m_ui64TotalBytes,
m_ticker.createdTime()/1000,
*this);
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论