revid: added code to deal with Input var

This commit is contained in:
Saxon 2019-10-22 16:17:35 +10:30
parent 8c1c192218
commit 504179c03b
1 changed files with 7 additions and 0 deletions

View File

@ -423,6 +423,13 @@ func (r *Revid) Update(vars map[string]string) error {
//look through the vars and update revid where needed
for key, value := range vars {
switch key {
case "Input":
v, ok := map[string]uint8{"raspivid": Raspivid, "rtsp": RTSP}[strings.ToLower(value)]
if !ok {
r.config.Logger.Log(logger.Warning, pkg+"invalid input var", "value", value)
break
}
r.config.Input = v
case "Saturation":
s, err := strconv.ParseInt(value, 10, 0)
if err != nil {