revid: now using correct consts to indicate codec

This commit is contained in:
Saxon 2019-09-24 17:35:17 +09:30
parent d554173d7c
commit 38f2d691cf
1 changed files with 6 additions and 6 deletions

View File

@ -177,9 +177,9 @@ func (r *Revid) reset(config Config) error {
switch r.config.Input { switch r.config.Input {
case Raspivid: case Raspivid:
switch r.config.InputCodec { switch r.config.InputCodec {
case H264: case codecutil.H264:
st = mts.EncodeH264 st = mts.EncodeH264
case MJPEG: case codecutil.MJPEG:
st = mts.EncodeMJPEG st = mts.EncodeMJPEG
encOptions = append(encOptions, mts.PacketBasedPSI(int(r.config.MinFrames))) encOptions = append(encOptions, mts.PacketBasedPSI(int(r.config.MinFrames)))
} }
@ -302,9 +302,9 @@ func (r *Revid) setupPipeline(mtsEnc func(dst io.WriteCloser, rate float64) (io.
case Raspivid: case Raspivid:
r.setupInput = r.startRaspivid r.setupInput = r.startRaspivid
switch r.config.InputCodec { switch r.config.InputCodec {
case H264: case codecutil.H264:
r.lexTo = h264.Lex r.lexTo = h264.Lex
case MJPEG: case codecutil.MJPEG:
r.lexTo = mjpeg.Lex r.lexTo = mjpeg.Lex
} }
case V4L: case V4L:
@ -409,9 +409,9 @@ func (r *Revid) Update(vars map[string]string) error {
case "InputCodec": case "InputCodec":
switch value { switch value {
case "H264": case "H264":
r.config.InputCodec = H264 r.config.InputCodec = codecutil.H264
case "MJPEG": case "MJPEG":
r.config.InputCodec = MJPEG r.config.InputCodec = codecutil.MJPEG
default: default:
r.config.Logger.Log(logger.Warning, pkg+"invalid InputCodec variable value", "value", value) r.config.Logger.Log(logger.Warning, pkg+"invalid InputCodec variable value", "value", value)
} }