mirror of https://bitbucket.org/ausocean/av.git
revid: added handling of burstPeriod to config
This commit is contained in:
parent
1010721dd0
commit
6171c4e999
|
@ -68,6 +68,7 @@ type Config struct {
|
|||
RtpAddress string
|
||||
Logger Logger
|
||||
SendRetry bool
|
||||
BurstPeriod uint
|
||||
}
|
||||
|
||||
// Enums for config struct
|
||||
|
@ -114,6 +115,7 @@ const (
|
|||
defaultInputCodec = H264
|
||||
defaultVerbosity = No // FIXME(kortschak): This makes no sense whatsoever. No is currently 15.
|
||||
defaultRtpAddr = "localhost:6970"
|
||||
defaultBurstPeriod = 10 // Seconds
|
||||
)
|
||||
|
||||
// Validate checks for any errors in the config fields and defaults settings
|
||||
|
@ -200,6 +202,11 @@ func (c *Config) Validate(r *Revid) error {
|
|||
}
|
||||
}
|
||||
|
||||
if c.BurstPeriod == 0 {
|
||||
c.Logger.Log(logger.Warning, pkg+"no burst period defined, defaulting", "burstPeriod", defaultBurstPeriod)
|
||||
c.BurstPeriod = defaultBurstPeriod
|
||||
}
|
||||
|
||||
if c.FramesPerClip < 1 {
|
||||
c.Logger.Log(logger.Warning, pkg+"no FramesPerClip defined, defaulting",
|
||||
"framesPerClip", defaultFramesPerClip)
|
||||
|
|
|
@ -477,6 +477,13 @@ func (r *Revid) Update(vars map[string]string) error {
|
|||
default:
|
||||
r.config.Logger.Log(logger.Warning, pkg+"invalid VerticalFlip param", "value", value)
|
||||
}
|
||||
case "BurstPeriod":
|
||||
v, err := strconv.ParseUint(value, 10, 0)
|
||||
if err != nil {
|
||||
r.config.Logger.Log(logger.Warning, pkg+"invalid BurstPeriod param", "value", value)
|
||||
break
|
||||
}
|
||||
r.config.BurstPeriod = uint(v)
|
||||
default:
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue