Archived
2
0

Revert "remove broadcast Config"

This reverts commit 88c0337a16.
This commit is contained in:
m1k1o
2020-09-27 12:06:13 +02:00
parent 1977e017dc
commit de04cac28e
4 changed files with 44 additions and 2 deletions

View File

@ -12,14 +12,16 @@ type BroadcastManager struct {
logger zerolog.Logger
pipeline *gst.Pipeline
remote *config.Remote
config *config.Broadcast
enabled bool
url string
}
func New(remote *config.Remote) *BroadcastManager {
func New(remote *config.Remote, config *config.Broadcast) *BroadcastManager {
return &BroadcastManager{
logger: log.With().Str("module", "remote").Logger(),
remote: remote,
config: config,
enabled: false,
url: "",
}

View File

@ -0,0 +1,37 @@
package config
import (
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
type Broadcast struct {
// Enabled bool
// AudioParams string
// VideoParams string
}
func (Broadcast) Init(cmd *cobra.Command) error {
// cmd.PersistentFlags().Bool("broadcast", false, "enable boradcasting")
// if err := viper.BindPFlag("broadcast", cmd.PersistentFlags().Lookup("broadcast")); err != nil {
// return err
// }
// cmd.PersistentFlags().String("cast_audio", "", "audio codec parameters to use for broadcasting")
// if err := viper.BindPFlag("cast_audio", cmd.PersistentFlags().Lookup("cast_audio")); err != nil {
// return err
// }
// cmd.PersistentFlags().String("cast_video", "", "video codec parameters to use for broadcasting")
// if err := viper.BindPFlag("cast_video", cmd.PersistentFlags().Lookup("cast_video")); err != nil {
// return err
// }
return nil
}
func (s *Broadcast) Set() {
// s.Enabled = viper.GetBool("broadcast")
// s.AudioParams = viper.GetString("cast_audio")
// s.VideoParams = viper.GetString("cast_video")
}