mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
do not start pipeline when error.
This commit is contained in:
parent
58ea3665b0
commit
2b72f43c9e
@ -32,9 +32,14 @@ func (manager *BroacastManagerCtx) shutdown() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (manager *BroacastManagerCtx) Start(url string) error {
|
func (manager *BroacastManagerCtx) Start(url string) error {
|
||||||
|
err := manager.createPipeline()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
manager.url = url
|
manager.url = url
|
||||||
manager.enabled = true
|
manager.enabled = true
|
||||||
return manager.createPipeline()
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (manager *BroacastManagerCtx) Stop() {
|
func (manager *BroacastManagerCtx) Stop() {
|
||||||
|
@ -111,8 +111,17 @@ func (manager *CaptureManagerCtx) StartStream() {
|
|||||||
|
|
||||||
manager.logger.Info().Msgf("starting stream pipelines")
|
manager.logger.Info().Msgf("starting stream pipelines")
|
||||||
|
|
||||||
manager.Video().Start()
|
var err error
|
||||||
manager.Audio().Start()
|
err = manager.Video().Start()
|
||||||
|
if err != nil {
|
||||||
|
manager.logger.Panic().Err(err).Msg("unable to start video pipeline")
|
||||||
|
}
|
||||||
|
|
||||||
|
err = manager.Audio().Start()
|
||||||
|
if err != nil {
|
||||||
|
manager.logger.Panic().Err(err).Msg("unable to start audio pipeline")
|
||||||
|
}
|
||||||
|
|
||||||
manager.streaming = true
|
manager.streaming = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -147,9 +147,11 @@ func (manager *ScreencastManagerCtx) createPipeline() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
manager.pipeline.Start()
|
manager.logger.Info().
|
||||||
manager.logger.Info().Msgf("starting pipeline")
|
Str("src", manager.pipeline.Src).
|
||||||
|
Msgf("starting pipeline")
|
||||||
|
|
||||||
|
manager.pipeline.Start()
|
||||||
manager.sample = manager.pipeline.Sample
|
manager.sample = manager.pipeline.Sample
|
||||||
manager.emitUpdate <-true
|
manager.emitUpdate <-true
|
||||||
return nil
|
return nil
|
||||||
|
@ -75,9 +75,14 @@ func (manager *StreamManagerCtx) OnSample(listener func(sample types.Sample)) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func (manager *StreamManagerCtx) Start() {
|
func (manager *StreamManagerCtx) Start() error {
|
||||||
|
err := manager.createPipeline()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
manager.enabled = true
|
manager.enabled = true
|
||||||
manager.createPipeline()
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (manager *StreamManagerCtx) Stop() {
|
func (manager *StreamManagerCtx) Stop() {
|
||||||
|
@ -25,7 +25,7 @@ type StreamManager interface {
|
|||||||
Codec() codec.RTPCodec
|
Codec() codec.RTPCodec
|
||||||
OnSample(listener func(sample Sample))
|
OnSample(listener func(sample Sample))
|
||||||
|
|
||||||
Start()
|
Start() error
|
||||||
Stop()
|
Stop()
|
||||||
Enabled() bool
|
Enabled() bool
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user