Created singular Output var

This commit is contained in:
Scott 2019-12-23 16:55:40 +10:30
parent 016bbf0553
commit af2de3f938
2 changed files with 18 additions and 2 deletions

View File

@ -292,6 +292,7 @@ var TypeData = map[string]string{
"MTSRBSize": "int",
"MTSRBWriteTimeout": "int",
"OutputPath": "string",
"Output": "enum:File,Http,Rtmp,Rtp",
"Outputs": "string",
"Quantization": "uint",
"Rotation": "uint",

View File

@ -523,7 +523,7 @@ func (r *Revid) Update(vars map[string]string) error {
default:
r.cfg.Logger.Log(logger.Warning, pkg+"invalid InputCodec variable value", "value", value)
}
case "Output":
case "Outputs":
outputs := strings.Split(value, ",")
r.cfg.Outputs = make([]uint8, len(outputs))
@ -538,10 +538,25 @@ func (r *Revid) Update(vars map[string]string) error {
case "Rtp":
r.cfg.Outputs[i] = config.OutputRTP
default:
r.cfg.Logger.Log(logger.Warning, pkg+"invalid output param", "value", value)
r.cfg.Logger.Log(logger.Warning, pkg+"invalid outputs param", "value", value)
continue
}
}
case "Output":
r.cfg.Outputs = make([]uint8, 1)
switch value {
case "File":
r.cfg.Outputs[0] = config.OutputFile
case "Http":
r.cfg.Outputs[0] = config.OutputHTTP
case "Rtmp":
r.cfg.Outputs[0] = config.OutputRTMP
case "Rtp":
r.cfg.Outputs[0] = config.OutputRTP
default:
r.cfg.Logger.Log(logger.Warning, pkg+"invalid output param", "value", value)
continue
}
case "RtmpUrl":
r.cfg.RTMPURL = value