feat(whip): wire WHIPHandler into API — struct field, MergedHooks, NewWHIPHandler, serverConfig, cleanup
This commit is contained in:
parent
7f545962f6
commit
4ac63ddfc6
1 changed files with 8 additions and 1 deletions
|
|
@ -76,6 +76,7 @@ type api struct {
|
|||
srtserver srt.Server
|
||||
webrtcsub *appwebrtc.Subsystem
|
||||
webrtchandler *appwebrtc.Handler
|
||||
whiphandler *appwebrtc.WHIPHandler
|
||||
metrics monitor.HistoryMonitor
|
||||
prom prometheus.Metrics
|
||||
service service.Service
|
||||
|
|
@ -632,9 +633,10 @@ func (a *api) start() error {
|
|||
if werr != nil {
|
||||
a.log.logger.core.Warn().WithError(werr).Log("WebRTC subsystem disabled: construction failed")
|
||||
} else {
|
||||
a.restream.SetHooks(webrtcSub.Hooks())
|
||||
a.restream.SetHooks(webrtcSub.MergedHooks())
|
||||
a.webrtcsub = webrtcSub
|
||||
a.webrtchandler = appwebrtc.NewHandler(webrtcSub, 0)
|
||||
a.whiphandler = appwebrtc.NewWHIPHandler(webrtcSub, 0)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1036,6 +1038,7 @@ func (a *api) start() error {
|
|||
RTMP: a.rtmpserver,
|
||||
SRT: a.srtserver,
|
||||
WebRTC: a.webrtchandler,
|
||||
WHIP: a.whiphandler,
|
||||
JWT: a.httpjwt,
|
||||
Config: a.config.store,
|
||||
Sessions: a.sessions,
|
||||
|
|
@ -1382,6 +1385,10 @@ func (a *api) stop() {
|
|||
a.webrtchandler.Close()
|
||||
a.webrtchandler = nil
|
||||
}
|
||||
if a.whiphandler != nil {
|
||||
a.whiphandler.Close()
|
||||
a.whiphandler = nil
|
||||
}
|
||||
if a.webrtcsub != nil {
|
||||
a.webrtcsub.Close()
|
||||
a.webrtcsub = nil
|
||||
|
|
|
|||
Loading…
Reference in a new issue