From 5d7ed1535525d70e89db83b75c1ada8700509ff1 Mon Sep 17 00:00:00 2001 From: xiongziliang <771730766@qq.com> Date: Tue, 9 Oct 2018 09:36:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=81=E9=87=8F=E6=B1=87=E6=8A=A5=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E6=B7=BB=E5=8A=A0=E6=97=B6=E9=95=BF=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Common/config.h | 2 +- src/Http/HttpSession.cpp | 6 +++++- src/Rtmp/RtmpSession.cpp | 6 +++++- src/Rtsp/RtspSession.cpp | 6 +++++- 4 files changed, 16 insertions(+), 4 deletions(-) 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); } }