revid: general clean

This commit is contained in:
Saxon 2019-03-15 17:58:24 +10:30
parent 524989d2ed
commit 056f3b75b3
2 changed files with 9 additions and 6 deletions

View File

@ -129,10 +129,10 @@ func handleFlags() revid.Config {
quantizationPtr = flag.Uint("Quantization", 0, "Desired quantization value: 0-40") quantizationPtr = flag.Uint("Quantization", 0, "Desired quantization value: 0-40")
intraRefreshPeriodPtr = flag.Uint("IntraRefreshPeriod", 0, "The IntraRefreshPeriod i.e. how many keyframes we send") intraRefreshPeriodPtr = flag.Uint("IntraRefreshPeriod", 0, "The IntraRefreshPeriod i.e. how many keyframes we send")
rotationPtr = flag.Uint("Rotatation", 0, "Rotate video output. (0-359 degrees)") rotationPtr = flag.Uint("Rotatation", 0, "Rotate video output. (0-359 degrees)")
brightnessPtr = flag.Uint("Brightness", 50, "Set Brightness: 0-100 ") brightnessPtr = flag.Uint("Brightness", 50, "Set brightness. (0-100) ")
saturationPtr = flag.Int("Saturation", 0, "Set Saturation: -100:100") saturationPtr = flag.Int("Saturation", 0, "Set Saturation. (100-100)")
exposurePtr = flag.String("Exposure", "auto", "Set exposure mode: "+strings.Join(revid.ExposureModes[:], ",")) 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.AwbModes[:], ",")+")")
) )
var outputs flagStrings var outputs flagStrings

View File

@ -73,9 +73,10 @@ type Config struct {
Brightness uint Brightness uint
Saturation int Saturation int
Exposure string Exposure string
Awb string AutoWhiteBalance string
} }
// Possible modes for raspivid --exposure parameter.
var ExposureModes = [...]string{ var ExposureModes = [...]string{
"auto", "auto",
"night", "night",
@ -91,7 +92,8 @@ var ExposureModes = [...]string{
"fireworks", "fireworks",
} }
var AwbModes = [...]string{ // Possible modes for raspivid --awb parameter.
var AutoWhiteBalanceModes = [...]string{
"off", "off",
"auto", "auto",
"sun", "sun",
@ -309,6 +311,7 @@ func (c *Config) Validate(r *Revid) error {
return nil return nil
} }
// stringInSlice returns true if want is in slice.
func stringInSlice(want string, slice []string) bool { func stringInSlice(want string, slice []string) bool {
for _, s := range slice { for _, s := range slice {
if s == want { if s == want {