From b96b52ace5e119dc6bd364ebc2c40b4712fec49c Mon Sep 17 00:00:00 2001 From: Saxon Date: Sat, 9 Mar 2019 22:44:12 +1030 Subject: [PATCH] revid: reverting changes made to config.go --- revid/config.go | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/revid/config.go b/revid/config.go index b784dd6a..d7e906a2 100644 --- a/revid/config.go +++ b/revid/config.go @@ -42,7 +42,7 @@ type Config struct { InputCodec uint8 Outputs []uint8 RtmpMethod uint8 - Packetization uint + Packetization uint8 // Quantize specifies whether the input to // revid will have constant or variable @@ -92,6 +92,8 @@ const ( Yes No Rtmp + FfmpegRtmp + Udp MpegtsRtp Rtp ) @@ -112,6 +114,7 @@ const ( defaultFramesPerClip = 1 httpFramesPerClip = 560 defaultInputCodec = H264 + defaultVerbosity = No // FIXME(kortschak): This makes no sense whatsoever. No is currently 15. defaultRtpAddr = "localhost:6970" defaultBurstPeriod = 10 // Seconds defaultRotation = 0 // Degrees @@ -120,6 +123,17 @@ const ( // Validate checks for any errors in the config fields and defaults settings // if particular parameters have not been defined. func (c *Config) Validate(r *Revid) error { + switch c.LogLevel { + case Yes: + case No: + case NothingDefined: + c.LogLevel = defaultVerbosity + c.Logger.Log(logger.Info, pkg+"no LogLevel mode defined, defaulting", + "LogLevel", defaultVerbosity) + default: + return errors.New("bad LogLevel defined in config") + } + switch c.Input { case Raspivid, V4L, File: case NothingDefined: @@ -162,7 +176,8 @@ func (c *Config) Validate(r *Revid) error { for i, o := range c.Outputs { switch o { case File: - case Rtmp: + case Udp: + case Rtmp, FfmpegRtmp: if c.RtmpUrl == "" { c.Logger.Log(logger.Info, pkg+"no RTMP URL: falling back to HTTP") c.Outputs[i] = Http