mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2024-11-26 12:37:09 +08:00
流量统计添加isPlayer参数
This commit is contained in:
parent
f9f487bf61
commit
fbead02868
@ -199,6 +199,7 @@ void installWebHook(){
|
||||
body["id"] = sender.getIdentifier();
|
||||
body["totalBytes"] = (Json::UInt64)totalBytes;
|
||||
body["duration"] = (Json::UInt64)totalDuration;
|
||||
body["player"] = isPlayer;
|
||||
//执行hook
|
||||
do_http_hook(hook_flowreport,body, nullptr);
|
||||
});
|
||||
|
@ -110,7 +110,7 @@ extern const char kBroadcastShellLogin[];
|
||||
|
||||
//停止rtsp/rtmp/http-flv会话后流量汇报事件广播
|
||||
extern const char kBroadcastFlowReport[];
|
||||
#define BroadcastFlowReportArgs const MediaInfo &args,const uint64_t &totalBytes,const uint64_t &totalDuration,TcpSession &sender
|
||||
#define BroadcastFlowReportArgs const MediaInfo &args,const uint64_t &totalBytes,const uint64_t &totalDuration,const bool &isPlayer,TcpSession &sender
|
||||
|
||||
//未找到流后会广播该事件,请在监听该事件后去拉流或其他方式产生流,这样就能按需拉流了
|
||||
extern const char kBroadcastNotFoundStream[];
|
||||
|
@ -164,6 +164,7 @@ void HttpSession::onError(const SockException& err) {
|
||||
_mediaInfo,
|
||||
_ui64TotalBytes,
|
||||
_ticker.createdTime()/1000,
|
||||
true,
|
||||
*this);
|
||||
}
|
||||
}
|
||||
|
@ -56,10 +56,12 @@ void RtmpSession::onError(const SockException& err) {
|
||||
GET_CONFIG_AND_REGISTER(uint32_t,iFlowThreshold,Broadcast::kFlowThreshold);
|
||||
|
||||
if(_ui64TotalBytes > iFlowThreshold * 1024){
|
||||
bool isPlayer = !_pPublisherSrc;
|
||||
NoticeCenter::Instance().emitEvent(Broadcast::kBroadcastFlowReport,
|
||||
_mediaInfo,
|
||||
_ui64TotalBytes,
|
||||
_ticker.createdTime()/1000,
|
||||
isPlayer,
|
||||
*this);
|
||||
}
|
||||
}
|
||||
|
@ -99,10 +99,12 @@ void RtspSession::onError(const SockException& err) {
|
||||
//流量统计事件广播
|
||||
GET_CONFIG_AND_REGISTER(uint32_t,iFlowThreshold,Broadcast::kFlowThreshold);
|
||||
if(_ui64TotalBytes > iFlowThreshold * 1024){
|
||||
bool isPlayer = !_pushSrc;
|
||||
NoticeCenter::Instance().emitEvent(Broadcast::kBroadcastFlowReport,
|
||||
_mediaInfo,
|
||||
_ui64TotalBytes,
|
||||
_ticker.createdTime()/1000,
|
||||
isPlayer,
|
||||
*this);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user