Finished commenting, now I can think about only testing

This commit is contained in:
Saxon Milton 2018-01-31 10:53:09 +10:30
parent 3738659eae
commit 535d898a3c
1 changed files with 9 additions and 14 deletions

View File

@ -348,21 +348,21 @@ func (r *revidInst)readCamera() {
r.Log(Info, "Out of reading routine!") r.Log(Info, "Out of reading routine!")
} }
// Stop // Stop halts any processing of video
func (r *revidInst) Stop() { func (r *revidInst) Stop() {
if r.isRunning { if r.isRunning {
r.Log(Info, "Stopping revid!") r.Log(Info, "Stopping revid!")
r.isRunning = false r.isRunning = false
if r.cmd != nil {
r.cmd.Process.Kill() r.cmd.Process.Kill()
}
} else { } else {
r.Log(Warning, "revidInst.Stop() called but revid not running!") r.Log(Warning, "revidInst.Stop() called but revid not running!")
} }
} }
/* // packClips takes data segments; whether that be tsPackets or jpeg frames and
New returns a pointer to a newly allocated RingBuffer with the parameters specified. // packs them into clips 1s long.
It initialises fields and allocates the required dataMemory.
*/
func (r *revidInst) packClips() { func (r *revidInst) packClips() {
clipSize := 0 clipSize := 0
packetCount := 0 packetCount := 0
@ -421,10 +421,8 @@ func (r *revidInst) packClips() {
} }
} }
/* // outputClips takes the clips produced in the packClips method and outputs them
New returns a pointer to a newly allocated RingBuffer with the parameters specified. // to the desired output defined in the revidInst config
It initialises fields and allocates the required dataMemory.
*/
func (r *revidInst) outputClips() { func (r *revidInst) outputClips() {
now := time.Now() now := time.Now()
prevTime := now prevTime := now
@ -469,10 +467,7 @@ func (r *revidInst) outputClips() {
} }
} }
/* // sendClipToHTTP takes a clip and an output url and posts through http.
New returns a pointer to a newly allocated RingBuffer with the parameters specified.
It initialises fields and allocates the required dataMemory.
*/
func (r *revidInst) sendClipToHTTP(clip []byte, output string) error { func (r *revidInst) sendClipToHTTP(clip []byte, output string) error {
timeout := time.Duration(httpTimeOut * time.Second) timeout := time.Duration(httpTimeOut * time.Second)
client := http.Client{ client := http.Client{