From af2de3f938077e579a2b075d2243494503636eb0 Mon Sep 17 00:00:00 2001 From: Scott Date: Mon, 23 Dec 2019 16:55:40 +1030 Subject: [PATCH] Created singular Output var --- revid/config/config.go | 1 + revid/revid.go | 19 +++++++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/revid/config/config.go b/revid/config/config.go index 9a19f4ab..fd9c2fcf 100644 --- a/revid/config/config.go +++ b/revid/config/config.go @@ -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", diff --git a/revid/revid.go b/revid/revid.go index 8389939f..6d2832a3 100644 --- a/revid/revid.go +++ b/revid/revid.go @@ -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