video

package
v0.0.0-...-55f88ab Latest Latest
Warning

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

Go to latest
Published: May 1, 2019 License: AGPL-3.0 Imports: 7 Imported by: 1

Documentation

Overview

Package video describes video fetching as a device

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Camera

type Camera struct {
	device.Client

	FrameRate float64
}

Camera defines a "camera" for the video device

func (*Camera) Invoke

func (camera *Camera) Invoke(invoke device.ClientInvocation, data float64) error

Invoke performs a configuration change on the camera

type Device

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

Device defines a mock device for gocv video retrieval

func Create

func Create(videoPath string, framerate float64) Device

Create returns a video.Device configured with given setttings

func (Device) Available

func (Device) Available() bool

Available checks if device is reachable, a video file is always reachable

func (Device) Camera

func (dev Device) Camera() device.Client

Camera returns the mock camera of this device

func (Device) Pump

func (dev Device) Pump(index int) device.Client

Pump returns a fake pump no matter what

func (Device) Stream

func (dev Device) Stream(ctx context.Context) <-chan device.Frame

Stream fetches frames on certain times, to mimic stream

type Frame

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

Frame defines how video frame looks like. It's a struct to be passed as message.

func (Frame) Frame

func (f Frame) Frame() image.Image

Frame returns the underlying frame

func (Frame) Skip

func (f Frame) Skip() <-chan struct{}

Skip checks if struct is passed it's lifetime, since it's a video frame, there's nothing to be late for, so it's never skipped

type Pump

type Pump struct {
	device.Client
}

Pump is merely a mock object for actual pumps camera's don't actually have pumps

func NewPump

func NewPump() Pump

NewPump returns a fake pump

func (Pump) Invoke

func (Pump) Invoke(invoke device.ClientInvocation, data float64) error

Invoke on a camera's pump does not do anything, it's a camera, it does not have pumps

Jump to

Keyboard shortcuts

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