Archived
2
0

pass screen frame rate to gstreamer pipeline.

This commit is contained in:
m1k1o
2021-02-15 14:59:20 +01:00
parent 27740b0af0
commit 321e52ee4f
4 changed files with 30 additions and 7 deletions

View File

@ -20,6 +20,7 @@ type Remote struct {
ScreenWidth int
ScreenHeight int
ScreenRate int
MaxFPS int
}
func (Remote) Init(cmd *cobra.Command) error {
@ -58,6 +59,11 @@ func (Remote) Init(cmd *cobra.Command) error {
return err
}
cmd.PersistentFlags().Int("max_fps", 25, "maximum fps delivered via WebRTC, 0 is for no maximum")
if err := viper.BindPFlag("max_fps", cmd.PersistentFlags().Lookup("max_fps")); err != nil {
return err
}
// video codecs
cmd.PersistentFlags().Bool("vp8", false, "use VP8 video codec")
if err := viper.BindPFlag("vp8", cmd.PersistentFlags().Lookup("vp8")); err != nil {
@ -146,4 +152,6 @@ func (s *Remote) Set() {
s.ScreenRate = int(rate)
}
}
s.MaxFPS = viper.GetInt("max_fps")
}