mirror of https://bitbucket.org/ausocean/av.git
Merged in csv-output-var (pull request #160)
revid: handling csv output var in revid's update function Approved-by: Alan Noble <anoble@gmail.com>
This commit is contained in:
commit
768ea3a007
|
@ -371,24 +371,26 @@ func (r *Revid) Update(vars map[string]string) error {
|
|||
for key, value := range vars {
|
||||
switch key {
|
||||
case "Output":
|
||||
r.config.Outputs = make([]uint8, 1)
|
||||
// FIXME(kortschak): There can be only one!
|
||||
// How do we specify outputs after the first?
|
||||
//
|
||||
// Maybe we shouldn't be doing this!
|
||||
switch value {
|
||||
outputs := strings.Split(value, ",")
|
||||
r.config.Outputs = make([]uint8, len(outputs))
|
||||
|
||||
for i, output := range outputs {
|
||||
switch output {
|
||||
case "File":
|
||||
r.config.Outputs[0] = File
|
||||
r.config.Outputs[i] = File
|
||||
case "Http":
|
||||
r.config.Outputs[0] = Http
|
||||
r.config.Outputs[i] = Http
|
||||
case "Rtmp":
|
||||
r.config.Outputs[0] = Rtmp
|
||||
r.config.Outputs[i] = Rtmp
|
||||
case "FfmpegRtmp":
|
||||
r.config.Outputs[0] = FfmpegRtmp
|
||||
r.config.Outputs[i] = FfmpegRtmp
|
||||
case "Rtp":
|
||||
r.config.Outputs[i] = Rtp
|
||||
default:
|
||||
r.config.Logger.Log(logger.Warning, pkg+"invalid Output1 param", "value", value)
|
||||
r.config.Logger.Log(logger.Warning, pkg+"invalid output param", "value", value)
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
case "Packetization":
|
||||
switch value {
|
||||
|
@ -409,6 +411,8 @@ func (r *Revid) Update(vars map[string]string) error {
|
|||
r.config.FramesPerClip = uint(f)
|
||||
case "RtmpUrl":
|
||||
r.config.RtmpUrl = value
|
||||
case "RtpAddr":
|
||||
r.config.RtpAddress = value
|
||||
case "Bitrate":
|
||||
v, err := strconv.ParseUint(value, 10, 0)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue