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
This commit is contained in:
Scott 2019-12-05 17:09:28 +10:30
parent c54259b8bd
commit f00918a73d
4 changed files with 43 additions and 3 deletions

View File

@ -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())
}

3
go.mod
View File

@ -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

2
go.sum
View File

@ -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=

View File

@ -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")