exp/rvcl: adding default config param consts and changing flag name

This commit is contained in:
Saxon Nelson-Milton 2020-12-21 11:18:35 +10:30
parent a4a409b4f5
commit 528dfe29e4
1 changed files with 16 additions and 6 deletions

View File

@ -96,6 +96,16 @@ const (
fMode = 0777
)
// Default config parameters.
const (
defaultInput = "File"
defaultInputPath = "../../../test/test-data/av/input/betterInput.h264"
defaultFileFPS = "25"
defaultOutput = "RTP"
defaultRTPAddress = "localhost:6970"
defaultLoop = "true"
)
// canProfile is set to false with revid-cli is built with "-tags profile".
var canProfile = false
@ -150,7 +160,7 @@ func main() {
var (
configPtr = flag.String("config", "", "Provide configuration JSON to revid (see readme for further information).")
configFilePtr = flag.String("config-file", "", "Location of revid configuration file (see readme for further information).")
rtpAddrPtr = flag.String("addr", "localhost:6970", "RTP destination address (<ip>:<port>)(common port=6970)")
rtpAddrPtr = flag.String("rtp-addr", defaultRTPAddress, "RTP destination address (<ip>:<port>)(common port=6970)")
)
flag.Parse()
@ -185,12 +195,12 @@ func main() {
// No config information has been provided; provide a default config map.
default:
cfg = map[string]string{
"Input": "File",
"InputPath": "../../../test/test-data/av/input/betterInput.h264",
"FileFPS": "25",
"Output": "RTP",
"Input": defaultInput,
"InputPath": defaultInputPath,
"FileFPS": defaultFileFPS,
"Output": defaultOutput,
"RTPAddress": *rtpAddrPtr,
"Loop": "true",
"Loop": defaultLoop,
}
}
log.Info("got config", "config", cfg)