mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-07-07 04:08:13 +08:00
流量汇报事件添加客户端ip和端口参数
This commit is contained in:
@@ -28,8 +28,10 @@
|
||||
|
||||
namespace mediakit{
|
||||
|
||||
HlsCookieData::HlsCookieData(const MediaInfo &info) {
|
||||
HlsCookieData::HlsCookieData(const MediaInfo &info, const string &peer_ip, uint16_t peer_port) {
|
||||
_info = info;
|
||||
_peer_ip = peer_ip;
|
||||
_peer_port = peer_port;
|
||||
_added = std::make_shared<bool>(false);
|
||||
addReaderCount();
|
||||
}
|
||||
@@ -61,7 +63,7 @@ HlsCookieData::~HlsCookieData() {
|
||||
WarnL << "HLS播放器(" << _info._vhost << "/" << _info._app << "/" << _info._streamid << ")断开,播放时间:" << duration;
|
||||
GET_CONFIG(uint32_t, iFlowThreshold, General::kFlowThreshold);
|
||||
if (_bytes > iFlowThreshold * 1024) {
|
||||
NoticeCenter::Instance().emitEvent(Broadcast::kBroadcastFlowReport, _info, _bytes, duration, true);
|
||||
NoticeCenter::Instance().emitEvent(Broadcast::kBroadcastFlowReport, _info, _bytes, duration, true, _peer_ip, _peer_port);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ private:
|
||||
class HlsCookieData{
|
||||
public:
|
||||
typedef std::shared_ptr<HlsCookieData> Ptr;
|
||||
HlsCookieData(const MediaInfo &info);
|
||||
HlsCookieData(const MediaInfo &info, const string &peer_ip, uint16_t peer_port);
|
||||
~HlsCookieData();
|
||||
void addByteUsage(uint64_t bytes);
|
||||
private:
|
||||
@@ -100,6 +100,8 @@ private:
|
||||
private:
|
||||
uint64_t _bytes = 0;
|
||||
MediaInfo _info;
|
||||
string _peer_ip;
|
||||
uint16_t _peer_port;
|
||||
std::shared_ptr<bool> _added;
|
||||
weak_ptr<HlsMediaSource> _src;
|
||||
Ticker _ticker;
|
||||
|
||||
Reference in New Issue
Block a user