mirror of
https://github.com/m1k1o/neko.git
synced 2025-07-21 18:47:55 +02:00
Add ability to restart broadcast
This commit is contained in:
parent
a5830dc440
commit
acc3c286a1
10 changed files with 60 additions and 27 deletions
|
@ -14,9 +14,10 @@ type BroacastManagerCtx struct {
|
|||
logger zerolog.Logger
|
||||
mu sync.Mutex
|
||||
|
||||
pipeline *gst.Pipeline
|
||||
pipelineMu sync.Mutex
|
||||
pipelineFn func(url string) (string, error)
|
||||
pipeline *gst.Pipeline
|
||||
pipelineMu sync.Mutex
|
||||
pipelineFn func(url string) (string, error)
|
||||
pipelineRestart chan bool
|
||||
|
||||
url string
|
||||
started bool
|
||||
|
@ -29,10 +30,11 @@ func broadcastNew(pipelineFn func(url string) (string, error), defaultUrl string
|
|||
Logger()
|
||||
|
||||
return &BroacastManagerCtx{
|
||||
logger: logger,
|
||||
pipelineFn: pipelineFn,
|
||||
url: defaultUrl,
|
||||
started: defaultUrl != "",
|
||||
logger: logger,
|
||||
pipelineFn: pipelineFn,
|
||||
pipelineRestart: make(chan bool),
|
||||
url: defaultUrl,
|
||||
started: defaultUrl != "",
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -71,6 +73,10 @@ func (manager *BroacastManagerCtx) Started() bool {
|
|||
return manager.started
|
||||
}
|
||||
|
||||
func (manager *BroacastManagerCtx) GetRestart() chan bool {
|
||||
return manager.pipelineRestart
|
||||
}
|
||||
|
||||
func (manager *BroacastManagerCtx) Url() string {
|
||||
manager.mu.Lock()
|
||||
defer manager.mu.Unlock()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue