From 86ec511697f8705f6be16dd29656784c4bd0deb3 Mon Sep 17 00:00:00 2001 From: Scott Date: Mon, 3 Feb 2020 14:31:06 +1030 Subject: [PATCH] revid: remove ShowWindows variable --- revid/config/config.go | 30 ------------------------------ revid/revid.go | 10 ---------- 2 files changed, 40 deletions(-) diff --git a/revid/config/config.go b/revid/config/config.go index 70be5115..04dc88ba 100644 --- a/revid/config/config.go +++ b/revid/config/config.go @@ -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) } diff --git a/revid/revid.go b/revid/revid.go index 0be82932..884d5df7 100644 --- a/revid/revid.go +++ b/revid/revid.go @@ -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 {