revid: remove ShowWindows variable

This commit is contained in:
Scott 2020-02-03 14:31:06 +10:30
parent b6d6090e25
commit 86ec511697
2 changed files with 0 additions and 40 deletions

View File

@ -27,8 +27,6 @@ package config
import (
"errors"
"fmt"
"os/exec"
"time"
"bitbucket.org/ausocean/av/codec/codecutil"
@ -136,9 +134,6 @@ const (
FilterBasic
)
// OS names
const raspian = "Raspbian GNU/Linux"
// Config provides parameters relevant to a revid instance. A new config must
// be passed to the constructor. Default values for these fields are defined
// as consts above.
@ -259,10 +254,6 @@ type Config struct {
// of the file.
Exposure string
// ShowWindows enables or disables the display of windows used for debugging
// motion filters.
ShowWindows bool
// AutoWhiteBalance defines the auto white balance mode used by Raspivid input.
// Valid modes are defined in the exported []string AutoWhiteBalanceModes
// defined at the start of the file.
@ -370,7 +361,6 @@ var TypeData = map[string]string{
"RTMPURL": "string",
"RTPAddress": "string",
"Saturation": "int",
"ShowWindows": "bool",
"VBRBitrate": "int",
"VBRQuality": "enum:standard,fair,good,great,excellent",
"VerticalFlip": "bool",
@ -554,17 +544,6 @@ func (c *Config) Validate() error {
c.MotionDownscaling = defaultMotionDownscaling
}
if c.ShowWindows {
os, err := osName()
if err != nil {
return err
}
if os == raspian {
c.Logger.Log(logger.Info, pkg+"ShowWindows disabled on Raspbian GNU/Linux", "ShowWindows", false)
c.ShowWindows = false
}
}
if c.FileFPS <= 0 || (c.FileFPS > 0 && c.Input != InputFile) {
c.logInvalidField("FileFPS", defaultFileFPS)
c.FileFPS = defaultFileFPS
@ -573,15 +552,6 @@ func (c *Config) Validate() error {
return nil
}
func osName() (string, error) {
out, err := exec.Command("grep", "^NAME=", "/etc/os-release").Output()
if err != nil {
return "", fmt.Errorf("could not get OS name: %w", err)
}
return string(out)[6 : len(out)-2], nil
}
func (c *Config) logInvalidField(name string, def interface{}) {
c.Logger.Log(logger.Info, pkg+name+" bad or unset, defaulting", name, def)
}

View File

@ -804,16 +804,6 @@ func (r *Revid) Update(vars map[string]string) error {
break
}
r.cfg.CameraChan = v
case "ShowWindows":
switch strings.ToLower(value) {
case "true":
r.cfg.ShowWindows = true
case "false":
r.cfg.ShowWindows = false
default:
r.cfg.Logger.Log(logger.Warning, pkg+"invalid ShowWindows var", "value", value)
break
}
case "MinFPS":
v, err := strconv.ParseFloat(value, 64)
if err != nil {