mirror of https://bitbucket.org/ausocean/av.git
Merged in clean-up-revid-consts (pull request #111)
revid: clean up some revid constants Approved-by: kortschak <dan@kortschak.io>
This commit is contained in:
commit
a58a784a16
|
@ -48,31 +48,33 @@ import (
|
||||||
"bitbucket.org/ausocean/utils/ring"
|
"bitbucket.org/ausocean/utils/ring"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Misc constants
|
// Ring buffer sizes and read/write timeouts.
|
||||||
const (
|
const (
|
||||||
clipDuration = 1 * time.Second
|
ringBufferSize = 10000
|
||||||
mp2tPacketSize = 188 // MPEG-TS packet size
|
ringBufferElementSize = 150000
|
||||||
mp2tMaxPackets = int(clipDuration * 2016 / time.Second) // # first multiple of 7 and 8 greater than 2000
|
writeTimeout = 10 * time.Millisecond
|
||||||
ringBufferSize = 10000
|
readTimeout = 10 * time.Millisecond
|
||||||
ringBufferElementSize = 150000
|
|
||||||
writeTimeout = 10 * time.Millisecond
|
|
||||||
readTimeout = 10 * time.Millisecond
|
|
||||||
httpTimeout = 5 * time.Second
|
|
||||||
bitrateTime = 1 * time.Minute
|
|
||||||
mjpegParserInChanLen = 100000
|
|
||||||
ffmpegPath = "/usr/local/bin/ffmpeg"
|
|
||||||
rtmpConnectionTimout = 10
|
|
||||||
outputChanSize = 1000
|
|
||||||
cameraRetryPeriod = 5 * time.Second
|
|
||||||
sendFailedDelay = 5 * time.Millisecond
|
|
||||||
maxSendFailedErrorCount = 500
|
|
||||||
clipSizeThreshold = 11
|
|
||||||
rtmpConnectionMaxTries = 5
|
|
||||||
raspividNoOfTries = 3
|
|
||||||
sendingWaitTime = 5 * time.Millisecond
|
|
||||||
pkg = "revid:"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// RTMP connection properties.
|
||||||
|
const (
|
||||||
|
rtmpConnectionMaxTries = 5
|
||||||
|
rtmpConnectionTimeout = 10
|
||||||
|
)
|
||||||
|
|
||||||
|
// Duration of video for each clip sent out.
|
||||||
|
const clipDuration = 1 * time.Second
|
||||||
|
|
||||||
|
// Time duration between bitrate checks.
|
||||||
|
const bitrateTime = 1 * time.Minute
|
||||||
|
|
||||||
|
// After a send fail, this is the delay before another send.
|
||||||
|
const sendFailedDelay = 5 * time.Millisecond
|
||||||
|
|
||||||
|
const ffmpegPath = "/usr/local/bin/ffmpeg"
|
||||||
|
|
||||||
|
const pkg = "revid:"
|
||||||
|
|
||||||
type Logger interface {
|
type Logger interface {
|
||||||
SetLevel(int8)
|
SetLevel(int8)
|
||||||
Log(level int8, message string, params ...interface{})
|
Log(level int8, message string, params ...interface{})
|
||||||
|
@ -211,7 +213,7 @@ func (r *Revid) reset(config Config) error {
|
||||||
}
|
}
|
||||||
r.destination[outNo] = s
|
r.destination[outNo] = s
|
||||||
case Rtmp:
|
case Rtmp:
|
||||||
s, err := newRtmpSender(config.RtmpUrl, rtmpConnectionTimout, rtmpConnectionMaxTries, r.config.Logger.Log)
|
s, err := newRtmpSender(config.RtmpUrl, rtmpConnectionTimeout, rtmpConnectionMaxTries, r.config.Logger.Log)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue