From f00918a73d85bc884c97e549f999c6e49f07f50e Mon Sep 17 00:00:00 2001 From: Scott Date: Thu, 5 Dec 2019 17:09:28 +1030 Subject: [PATCH] Revid uses netsender to report variable types Variable type data kept in revid/config/config.go Supports variadic new function in netsender Updated revid to use iot v1.2.9 --- cmd/revid-cli/main.go | 2 +- go.mod | 3 +-- go.sum | 2 ++ revid/config/config.go | 39 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 43 insertions(+), 3 deletions(-) diff --git a/cmd/revid-cli/main.go b/cmd/revid-cli/main.go index 4e340b4c..bced0a4f 100644 --- a/cmd/revid-cli/main.go +++ b/cmd/revid-cli/main.go @@ -282,7 +282,7 @@ func run(cfg config.Config) { return nil // Return error only if we want NetSender to generate an error } - ns, err := netsender.New(log, nil, readPin, nil) + ns, err := netsender.New(log, nil, readPin, nil, config.TypeData) if err != nil { log.Log(logger.Fatal, pkg+"could not initialise netsender client: "+err.Error()) } diff --git a/go.mod b/go.mod index ec014617..1ab98014 100644 --- a/go.mod +++ b/go.mod @@ -3,12 +3,11 @@ module bitbucket.org/ausocean/av go 1.13 require ( - bitbucket.org/ausocean/iot v1.2.8 + bitbucket.org/ausocean/iot v1.2.9 bitbucket.org/ausocean/utils v1.2.11 github.com/Comcast/gots v0.0.0-20190305015453-8d56e473f0f7 github.com/go-audio/audio v0.0.0-20181013203223-7b2a6ca21480 github.com/go-audio/wav v0.0.0-20181013172942-de841e69b884 - github.com/kr/pretty v0.1.0 // indirect github.com/mewkiz/flac v1.0.5 github.com/pkg/errors v0.8.1 github.com/yobert/alsa v0.0.0-20180630182551-d38d89fa843e diff --git a/go.sum b/go.sum index d82a7b0c..e6eee428 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,7 @@ bitbucket.org/ausocean/iot v1.2.8 h1:m2UhfAbG/6RKPBzY4OJ5S7zLxTmuzyMKPNbu0qaxFIw= bitbucket.org/ausocean/iot v1.2.8/go.mod h1:wCLOYeEDCxDquneSZ/zTEcKGXZ6uan+6sgZyTMlNVDo= +bitbucket.org/ausocean/iot v1.2.9 h1:3tzgiekH+Z0yXhkwnqBzxxe8qQJ2O7YTkz4s0T6stgw= +bitbucket.org/ausocean/iot v1.2.9/go.mod h1:Q5FwaOKnCty3dVeVtki6DLwYa5vhNpOaeu1lwLyPCg8= bitbucket.org/ausocean/utils v1.2.11 h1:zA0FOaPjN960ryp8PKCkV5y50uWBYrIxCVnXjwbvPqg= bitbucket.org/ausocean/utils v1.2.11/go.mod h1:uXzX9z3PLemyURTMWRhVI8uLhPX4uuvaaO85v2hcob8= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= diff --git a/revid/config/config.go b/revid/config/config.go index 1e21b7c0..a2cce338 100644 --- a/revid/config/config.go +++ b/revid/config/config.go @@ -258,6 +258,45 @@ type Config struct { MTSRBWriteTimeout int // The ringbuffer write timeout in seconds. } +// TypeData contains information about all of the variables that +// can be set over the web. It is a psuedo const. +var TypeData = map[string]string{ + "Input": "enum:raspivid,rtsp,v4l,file", + "Brightness": "uint", + "Saturation": "int", + "Exposure": "enum:auto,night,nightpreview,backlight,spotlight,sports,snow,beach,verylong,fixedfps,antishake,fireworks", + "AutoWhiteBalance": "enum:off,auto,sun,cloud,shade,tungsten,fluorescent,incandescent,flash,horizon", + "InputCodec": "enum:H264,MJPEG", + "Outputs": "string", + "RTMPURL": "string", + "RTPAddress": "string", + "BitDepth": "int", + "OutputPath": "string", + "InputPath": "string", + "Height": "uint", + "Width": "uint", + "FrameRate": "uint", + "Rotation": "uint", + "HTTPAddress": "string", + "Quantization": "uint", + "MinFrames": "uint", + "ClipDuration": "uint", + "HorizontalFlip": "bool", + "VerticalFlip": "bool", + "BurstPeriod": "uint", + "Logging": "enum:Debug,Info,Warning,Error,Fatal", + "RTMPRBSize": "int", + "RTMPRBElementSize": "int", + "RTMPRBWriteTimeout": "int", + "MTSRBSize": "int", + "MTSRBElementSize": "int", + "MTSRBWriteTimeout": "int", + "CBR": "bool", + "VBRQuality": "enum:standard,fair,good,great,excellent", + "VBRBitrate": "int", + "CameraChan": "int", +} + // Validation errors. var ( errInvalidQuantization = errors.New("invalid quantization")