Documentation ¶
Index ¶
- Constants
- func NewConfig(configRW *config.Config) (*config.ThermalMotion, error)
- func NewMotionDetector(args config.ThermalMotion, previewFrames int, camera cptvframe.CameraSpec) *motionDetector
- type FrameLoop
- type FrameParser
- type MotionProcessor
- func (mp *MotionProcessor) GetCurrentFrame() *cptvframe.Frame
- func (mp *MotionProcessor) GetRecentFrame() *cptvframe.Frame
- func (mp *MotionProcessor) Process(rawFrame []byte) error
- func (mp *MotionProcessor) ProcessFrame(srcFrame *cptvframe.Frame)
- func (mp *MotionProcessor) RecordingStatus() bool
- func (mp *MotionProcessor) StartRecordingManual() error
- func (mp *MotionProcessor) StopRecording() (string, error)
- func (mp *MotionProcessor) ToggleRecording() (string, error)
- type RecordingListener
Constants ¶
const NO_OLDEST_SET = -1
Variables ¶
This section is empty.
Functions ¶
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 ¶
CopyRecent returns a copy of the previous frame.
func (*FrameLoop) Current ¶
Current returns the current frame. Note: data on all returned frame objects will eventually get overwritten
func (*FrameLoop) GetHistory ¶
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 ¶
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 ¶
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 ¶
SetAsOldest - Marks current frame as oldest. This mean Oldest() will never return a frame that was written before this one.
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() }