revid & cmd/revid-cli: rotate => rotation

This commit is contained in:
Saxon 2019-03-04 12:11:34 +10:30
parent 2d229077a2
commit cfcb899bcb
3 changed files with 11 additions and 11 deletions

View File

@ -126,7 +126,7 @@ func handleFlags() revid.Config {
frameRatePtr = flag.Uint("FrameRate", 0, "Frame rate of captured video")
quantizationPtr = flag.Uint("Quantization", 0, "Desired quantization value: 0-40")
intraRefreshPeriodPtr = flag.Uint("IntraRefreshPeriod", 0, "The IntraRefreshPeriod i.e. how many keyframes we send")
rotatePtr = flag.Uint("Rotate", 0, "Rotate video output. (0-359 degrees)")
rotationPtr = flag.Uint("Rotatation", 0, "Rotate video output. (0-359 degrees)")
)
var outputs flagStrings
@ -238,7 +238,7 @@ func handleFlags() revid.Config {
}
cfg.Quantize = *quantizePtr
cfg.Rotate = *rotatePtr
cfg.Rotation = *rotationPtr
cfg.FramesPerClip = *framesPerClipPtr
cfg.RtmpUrl = *rtmpUrlPtr
cfg.Bitrate = *bitratePtr

View File

@ -64,7 +64,7 @@ type Config struct {
Logger Logger
SendRetry bool
BurstPeriod uint
Rotate uint
Rotation uint
}
// Enums for config struct
@ -112,7 +112,7 @@ const (
defaultVerbosity = No // FIXME(kortschak): This makes no sense whatsoever. No is currently 15.
defaultRtpAddr = "localhost:6970"
defaultBurstPeriod = 10 // Seconds
defaultRotate = 0 // Degrees
defaultRotation = 0 // Degrees
)
// Validate checks for any errors in the config fields and defaults settings
@ -212,9 +212,9 @@ func (c *Config) Validate(r *Revid) error {
c.FramesPerClip = defaultFramesPerClip
}
if c.Rotate > 359 {
c.Logger.Log(logger.Warning, pkg+"bad rotate angle, defaulting", "angle", defaultRotate)
c.Rotate = defaultRotate
if c.Rotation > 359 {
c.Logger.Log(logger.Warning, pkg+"bad rotate angle, defaulting", "angle", defaultRotation)
c.Rotation = defaultRotation
}
if c.Width == 0 {

View File

@ -457,13 +457,13 @@ func (r *Revid) Update(vars map[string]string) error {
break
}
r.config.FrameRate = uint(v)
case "Rotate":
case "Rotatation":
v, err := strconv.ParseUint(value, 10, 0)
if err != nil || v > 359 {
r.config.Logger.Log(logger.Warning, pkg+"invalid rotate param", "value", value)
r.config.Logger.Log(logger.Warning, pkg+"invalid rotation param", "value", value)
break
}
r.config.Rotate = uint(v)
r.config.Rotation = uint(v)
case "HttpAddress":
r.config.HttpAddress = value
case "Quantization":
@ -598,7 +598,7 @@ func (r *Revid) startRaspivid() error {
"--height", fmt.Sprint(r.config.Height),
"--bitrate", fmt.Sprint(r.config.Bitrate),
"--framerate", fmt.Sprint(r.config.FrameRate),
"--rotate", fmt.Sprint(r.config.Rotate),
"--rotation", fmt.Sprint(r.config.Rotation),
}
switch r.config.InputCodec {