mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
auto broadcast started.
This commit is contained in:
parent
da86a0931c
commit
d06740aa96
@ -22,7 +22,7 @@ type BroacastManagerCtx struct {
|
|||||||
started bool
|
started bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func broadcastNew(pipelineFn func(url string) (string, error), url string, started bool) *BroacastManagerCtx {
|
func broadcastNew(pipelineFn func(url string) (string, error), defaultUrl string) *BroacastManagerCtx {
|
||||||
logger := log.With().
|
logger := log.With().
|
||||||
Str("module", "capture").
|
Str("module", "capture").
|
||||||
Str("submodule", "broadcast").
|
Str("submodule", "broadcast").
|
||||||
@ -31,8 +31,8 @@ func broadcastNew(pipelineFn func(url string) (string, error), url string, start
|
|||||||
return &BroacastManagerCtx{
|
return &BroacastManagerCtx{
|
||||||
logger: logger,
|
logger: logger,
|
||||||
pipelineFn: pipelineFn,
|
pipelineFn: pipelineFn,
|
||||||
url: url,
|
url: defaultUrl,
|
||||||
started: started,
|
started: defaultUrl != "",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ func New(desktop types.DesktopManager, config *config.Capture) *CaptureManagerCt
|
|||||||
// sinks
|
// sinks
|
||||||
broadcast: broadcastNew(func(url string) (string, error) {
|
broadcast: broadcastNew(func(url string) (string, error) {
|
||||||
return NewBroadcastPipeline(config.AudioDevice, config.Display, config.BroadcastPipeline, url)
|
return NewBroadcastPipeline(config.AudioDevice, config.Display, config.BroadcastPipeline, url)
|
||||||
}, config.BroadcastUrl, config.BroadcastStarted),
|
}, config.BroadcastUrl),
|
||||||
audio: streamSinkNew(config.AudioCodec, func() (string, error) {
|
audio: streamSinkNew(config.AudioCodec, func() (string, error) {
|
||||||
return NewAudioPipeline(config.AudioCodec, config.AudioDevice, config.AudioPipeline, config.AudioBitrate)
|
return NewAudioPipeline(config.AudioCodec, config.AudioDevice, config.AudioPipeline, config.AudioBitrate)
|
||||||
}, "audio"),
|
}, "audio"),
|
||||||
|
@ -27,7 +27,6 @@ type Capture struct {
|
|||||||
// broadcast
|
// broadcast
|
||||||
BroadcastPipeline string
|
BroadcastPipeline string
|
||||||
BroadcastUrl string
|
BroadcastUrl string
|
||||||
BroadcastStarted bool
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (Capture) Init(cmd *cobra.Command) error {
|
func (Capture) Init(cmd *cobra.Command) error {
|
||||||
@ -222,5 +221,4 @@ func (s *Capture) Set() {
|
|||||||
|
|
||||||
s.BroadcastPipeline = viper.GetString("broadcast_pipeline")
|
s.BroadcastPipeline = viper.GetString("broadcast_pipeline")
|
||||||
s.BroadcastUrl = viper.GetString("broadcast_url")
|
s.BroadcastUrl = viper.GetString("broadcast_url")
|
||||||
s.BroadcastStarted = s.BroadcastUrl != ""
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user