motion

package
v1.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 21, 2021 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const NO_OLDEST_SET = -1

Variables

This section is empty.

Functions

func NewConfig

func NewConfig(configRW *config.Config) (*config.ThermalMotion, error)

func NewMotionDetector

func NewMotionDetector(args config.ThermalMotion, previewFrames int, camera cptvframe.CameraSpec) *motionDetector

Types

type FrameLoop

type FrameLoop struct {
	// contains filtered or unexported fields
}

FrameLoop stores the last n frames in a loop that will be overwritten when full. The latest written frame can be anywhere in the list of frames. Beware: all frames returned by FrameLoop will at some point be over-written.

func NewFrameLoop

func NewFrameLoop(size int, camera cptvframe.CameraSpec) *FrameLoop

func (*FrameLoop) CopyRecent

func (fl *FrameLoop) CopyRecent() *cptvframe.Frame

CopyRecent returns a copy of the previous frame.

func (*FrameLoop) Current

func (fl *FrameLoop) Current() *cptvframe.Frame

Current returns the current frame. Note: data on all returned frame objects will eventually get overwritten

func (*FrameLoop) GetHistory

func (fl *FrameLoop) GetHistory() []*cptvframe.Frame

GetHistory returns all the frames recorded in an slice from oldest to newest. Note: The returned slice will be rewritten next time GetHistory is called. Note: GetHistory always returns one frame even if none have been stored in the loop

func (*FrameLoop) Move

func (fl *FrameLoop) Move() *cptvframe.Frame

Move, moves the current frame one forwards and return the new frame. Note: data on all returned frame objects will eventually get overwritten

func (*FrameLoop) Oldest

func (fl *FrameLoop) Oldest() *cptvframe.Frame

Oldest returns the oldest frame remembered. This is either the next frame in the buffer (next to be overwritten), or the frame marked oldest

func (*FrameLoop) SetAsOldest

func (fl *FrameLoop) SetAsOldest() *cptvframe.Frame

SetAsOldest - Marks current frame as oldest. This mean Oldest() will never return a frame that was written before this one.

type FrameParser

type FrameParser func([]byte, *cptvframe.Frame) error

type MotionProcessor

type MotionProcessor struct {
	// contains filtered or unexported fields
}

func NewMotionProcessor

func NewMotionProcessor(
	parseFrame FrameParser,
	motionConf *config.ThermalMotion,
	recorderConf *recorder.RecorderConfig,
	locationConf *config.Location,
	listener RecordingListener,
	recorder recorder.Recorder, c cptvframe.CameraSpec,
) *MotionProcessor

func (*MotionProcessor) GetCurrentFrame

func (mp *MotionProcessor) GetCurrentFrame() *cptvframe.Frame

func (*MotionProcessor) GetRecentFrame

func (mp *MotionProcessor) GetRecentFrame() *cptvframe.Frame

func (*MotionProcessor) Process

func (mp *MotionProcessor) Process(rawFrame []byte) error

func (*MotionProcessor) ProcessFrame

func (mp *MotionProcessor) ProcessFrame(srcFrame *cptvframe.Frame)

func (*MotionProcessor) RecordingStatus added in v0.5.0

func (mp *MotionProcessor) RecordingStatus() bool

func (*MotionProcessor) StartRecordingManual added in v0.5.0

func (mp *MotionProcessor) StartRecordingManual() error

func (*MotionProcessor) StopRecording added in v0.5.0

func (mp *MotionProcessor) StopRecording() (string, error)

func (*MotionProcessor) ToggleRecording added in v0.5.0

func (mp *MotionProcessor) ToggleRecording() (string, error)

type RecordingListener

type RecordingListener interface {
	MotionDetected()
	RecordingStarted()
	RecordingEnded()
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL