revid: fixed build errors

This commit is contained in:
Saxon 2019-03-15 18:05:15 +10:30
parent 056f3b75b3
commit 39a7b382f6
3 changed files with 5 additions and 5 deletions

View File

@ -132,7 +132,7 @@ func handleFlags() revid.Config {
brightnessPtr = flag.Uint("Brightness", 50, "Set brightness. (0-100) ")
saturationPtr = flag.Int("Saturation", 0, "Set Saturation. (100-100)")
exposurePtr = flag.String("Exposure", "auto", "Set exposure mode. ("+strings.Join(revid.ExposureModes[:], ",")+")")
autoWhiteBalancePtr = flag.String("Awb", "auto", "Set automatic white balance mode. ("+strings.Join(revid.AwbModes[:], ",")+")")
autoWhiteBalancePtr = flag.String("Awb", "auto", "Set automatic white balance mode. ("+strings.Join(revid.AutoWhiteBalanceModes[:], ",")+")")
)
var outputs flagStrings
@ -263,7 +263,7 @@ func handleFlags() revid.Config {
cfg.Brightness = *brightnessPtr
cfg.Saturation = *saturationPtr
cfg.Exposure = *exposurePtr
cfg.Awb = *autoWhiteBalancePtr
cfg.AutoWhiteBalance = *autoWhiteBalancePtr
return cfg
}

View File

@ -304,7 +304,7 @@ func (c *Config) Validate(r *Revid) error {
return errors.New("bad exposure setting in config")
}
if !stringInSlice(c.Awb, AwbModes[:]) {
if !stringInSlice(c.AutoWhiteBalance, AutoWhiteBalanceModes[:]) {
return errors.New("bad awb setting in config")
}

View File

@ -373,7 +373,7 @@ func (r *Revid) Update(vars map[string]string) error {
case "Exposure":
r.config.Exposure = value
case "Awb":
r.config.Awb = value
r.config.AutoWhiteBalance = value
case "Output":
outputs := strings.Split(value, ",")
r.config.Outputs = make([]uint8, len(outputs))
@ -613,7 +613,7 @@ func (r *Revid) startRaspivid() error {
"--brightness", fmt.Sprint(r.config.Brightness),
"--saturation", fmt.Sprint(r.config.Saturation),
"--exposure", fmt.Sprint(r.config.Exposure),
"--awb", fmt.Sprint(r.config.Awb),
"--awb", fmt.Sprint(r.config.AutoWhiteBalance),
}
if r.config.FlipHorizontal {