diff --git a/src/Common/config.h b/src/Common/config.h index 3bbcca60..28c8b23b 100644 --- a/src/Common/config.h +++ b/src/Common/config.h @@ -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[]; diff --git a/src/Http/HttpSession.cpp b/src/Http/HttpSession.cpp index 57deda8f..6a09382b 100644 --- a/src/Http/HttpSession.cpp +++ b/src/Http/HttpSession.cpp @@ -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); } } diff --git a/src/Rtmp/RtmpSession.cpp b/src/Rtmp/RtmpSession.cpp index 7eb80dec..4cc74cc9 100644 --- a/src/Rtmp/RtmpSession.cpp +++ b/src/Rtmp/RtmpSession.cpp @@ -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); } } diff --git a/src/Rtsp/RtspSession.cpp b/src/Rtsp/RtspSession.cpp index 9d2ff603..12815b0a 100644 --- a/src/Rtsp/RtspSession.cpp +++ b/src/Rtsp/RtspSession.cpp @@ -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); } }