MCPcopy Create free account
hub / github.com/deepch/RTSPtoWebRTC / RTSPWorkerLoop

Function RTSPWorkerLoop

stream.go:24–39  ·  view source on GitHub ↗
(name, url string, OnDemand, DisableAudio, Debug bool)

Source from the content-addressed store, hash-verified

22 }
23}
24func RTSPWorkerLoop(name, url string, OnDemand, DisableAudio, Debug bool) {
25 defer Config.RunUnlock(name)
26 for {
27 log.Println("Stream Try Connect", name)
28 err := RTSPWorker(name, url, OnDemand, DisableAudio, Debug)
29 if err != nil {
30 log.Println(err)
31 Config.LastError = err
32 }
33 if OnDemand && !Config.HasViewer(name) {
34 log.Println(ErrorStreamExitNoViewer)
35 return
36 }
37 time.Sleep(1 * time.Second)
38 }
39}
40func RTSPWorker(name, url string, OnDemand, DisableAudio, Debug bool) error {
41 keyTest := time.NewTimer(20 * time.Second)
42 clientTest := time.NewTimer(20 * time.Second)

Callers 2

serveStreamsFunction · 0.85
RunIFNotRunMethod · 0.85

Calls 3

RTSPWorkerFunction · 0.85
RunUnlockMethod · 0.80
HasViewerMethod · 0.80

Tested by

no test coverage detected