throttle

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: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConfig

func NewConfig(conf *config.Config) (*config.ThermalThrottler, error)

Types

type ThrottledEventListener

type ThrottledEventListener interface {
	WhenThrottled()
}

type ThrottledEventRecorder

type ThrottledEventRecorder struct {
}

uses the event api to record that video was throttled at a particular time.

func (ThrottledEventRecorder) WhenThrottled

func (er ThrottledEventRecorder) WhenThrottled()

type ThrottledRecorder

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

ThrottledRecorder wraps a standard recorder so that it stops recording (ie gets throttled) if requested to record too often. This is desirable as the extra recordings are likely to be highly similar to the earlier recordings and contain no new information. It can happen when an animal is stuck in a trap or it is very windy.

func NewThrottledRecorder

func NewThrottledRecorder(
	baseRecorder recorder.Recorder,
	config *config.ThermalThrottler,
	minSeconds int,
	eventListener ThrottledEventListener, camera cptvframe.CameraSpec,
) *ThrottledRecorder

func NewThrottledRecorderWithClock

func NewThrottledRecorderWithClock(
	baseRecorder recorder.Recorder,
	config *config.ThermalThrottler,
	minSeconds int,
	listener ThrottledEventListener,
	clock ratelimit.Clock, camera cptvframe.CameraSpec,
) *ThrottledRecorder

func (*ThrottledRecorder) CheckCanRecord

func (throttler *ThrottledRecorder) CheckCanRecord() error

func (*ThrottledRecorder) StartRecording

func (throttler *ThrottledRecorder) StartRecording() error

func (*ThrottledRecorder) StopRecording

func (throttler *ThrottledRecorder) StopRecording() (string, error)

func (*ThrottledRecorder) WriteFrame

func (throttler *ThrottledRecorder) WriteFrame(frame *cptvframe.Frame) error

Jump to

Keyboard shortcuts

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