mirror of https://bitbucket.org/ausocean/av.git
Improved logging
This commit is contained in:
parent
6f2cb19ab7
commit
2d812363cf
|
@ -36,6 +36,7 @@ import (
|
|||
"time"
|
||||
|
||||
"bitbucket.org/ausocean/av/revid"
|
||||
"bitbucket.org/ausocean/utils/smartLogger"
|
||||
"bitbucket.org/ausocean/IoT/pi/netsender"
|
||||
|
||||
linuxproc "github.com/c9s/goprocinfo/linux"
|
||||
|
@ -71,6 +72,7 @@ const (
|
|||
noOfConfigconfigFlags = 19
|
||||
revidStopTime = 5
|
||||
prepTime = 20
|
||||
loggerVerbosity = 3
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -220,6 +222,9 @@ func main() {
|
|||
config.Timeout = *configFlags[timeoutPtr]
|
||||
config.IntraRefreshPeriod = *configFlags[intraRefreshPeriodPtr]
|
||||
|
||||
// Also give the config a logger object
|
||||
config.Logger = smartLogger.New(loggerVerbosity, smartLogger.White)
|
||||
|
||||
time.Sleep(time.Duration(prepTime) * time.Second)
|
||||
createRevidInstance()
|
||||
revidInst.Start()
|
||||
|
|
|
@ -60,7 +60,7 @@ const (
|
|||
mp2tPacketSize = 188 // MPEG-TS packet size
|
||||
mp2tMaxPackets = 2016 * clipDuration // # first multiple of 7 and 8 greater than 2000
|
||||
ringBufferSize = 1000
|
||||
ringBufferElementSize = 200000
|
||||
ringBufferElementSize = 100000
|
||||
httpTimeOut = 5 // s
|
||||
packetsPerFrame = 7
|
||||
h264BufferSize = 1000000
|
||||
|
@ -319,6 +319,11 @@ func (r *revid) packClips() {
|
|||
for {
|
||||
frame := r.getFrame()
|
||||
lenOfFrame := len(frame)
|
||||
if lenOfFrame > ringBufferElementSize {
|
||||
r.Log(Warning,"Frame was too big, getting another one!")
|
||||
frame = r.getFrame()
|
||||
lenOfFrame = len(frame)
|
||||
}
|
||||
upperBound := clipSize + lenOfFrame
|
||||
copy(clip[clipSize:upperBound], frame)
|
||||
packetCount++
|
||||
|
|
Loading…
Reference in New Issue