pull/272/head
q191201771 2 years ago
parent e04528baf9
commit fdb65e9ff7

@ -146,18 +146,22 @@ func NewGroup(appName string, streamName string, config *Config, observer IGroup
StreamName: streamName,
AppName: appName,
},
exitChan: make(chan struct{}, 1),
rtmpSubSessionSet: make(map[*rtmp.ServerSession]struct{}),
httpflvSubSessionSet: make(map[*httpflv.SubSession]struct{}),
httptsSubSessionSet: make(map[*httpts.SubSession]struct{}),
rtspSubSessionSet: make(map[*rtsp.SubSession]struct{}),
waitRtspSubSessionSet: make(map[*rtsp.SubSession]struct{}),
hlsSubSessionSet: make(map[*hls.SubSession]struct{}),
rtmpGopCache: remux.NewGopCache("rtmp", uk, config.RtmpConfig.GopNum, config.RtmpConfig.SingleGopMaxFrameNum),
httpflvGopCache: remux.NewGopCache("httpflv", uk, config.HttpflvConfig.GopNum, config.HttpflvConfig.SingleGopMaxFrameNum),
httptsGopCache: remux.NewGopCacheMpegts(uk, config.HttptsConfig.GopNum, config.HttptsConfig.SingleGopMaxFrameNum),
psPubPrevInactiveCheckTick: -1,
hlsCalcSessionStatIntervalSec: uint32(config.HlsConfig.FragmentDurationMs/100),
exitChan: make(chan struct{}, 1),
rtmpSubSessionSet: make(map[*rtmp.ServerSession]struct{}),
httpflvSubSessionSet: make(map[*httpflv.SubSession]struct{}),
httptsSubSessionSet: make(map[*httpts.SubSession]struct{}),
rtspSubSessionSet: make(map[*rtsp.SubSession]struct{}),
waitRtspSubSessionSet: make(map[*rtsp.SubSession]struct{}),
hlsSubSessionSet: make(map[*hls.SubSession]struct{}),
rtmpGopCache: remux.NewGopCache("rtmp", uk, config.RtmpConfig.GopNum, config.RtmpConfig.SingleGopMaxFrameNum),
httpflvGopCache: remux.NewGopCache("httpflv", uk, config.HttpflvConfig.GopNum, config.HttpflvConfig.SingleGopMaxFrameNum),
httptsGopCache: remux.NewGopCacheMpegts(uk, config.HttptsConfig.GopNum, config.HttptsConfig.SingleGopMaxFrameNum),
psPubPrevInactiveCheckTick: -1,
}
g.hlsCalcSessionStatIntervalSec = uint32(config.HlsConfig.FragmentDurationMs / 100) // equals to (ms/1000) * 10
if g.hlsCalcSessionStatIntervalSec == 0 {
g.hlsCalcSessionStatIntervalSec = defaultHlsCalcSessionStatIntervalSec
}
g.initRelayPushByConfig()

@ -28,3 +28,7 @@ var (
//
checkSessionAliveIntervalSec uint32 = 10
)
const (
defaultHlsCalcSessionStatIntervalSec uint32 = 10
)

Loading…
Cancel
Save