gstreamer

package
v0.0.0-...-36644ff Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package gstreamer implements an image recorder with the gstreamer tools.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListDevices

func ListDevices() ([]image.Device, error)

ListDevices returns a list of devices that can be used for recording. ListDevices returns an error if no devices are available.

Types

type Recorder

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

Recorder is an image recorder using gstreamer.

func NewRecorder

func NewRecorder(opts RecorderOpts) (recorder *Recorder, rerr error)

NewRecorder creates a new recorder using gstream. Gstreamer writes images to a temporary directory. These files are read and sent over the channel returned by Events.

Callers must call Close to clean up.

func (*Recorder) Close

func (r *Recorder) Close() error

Close shuts down the recorder, stopping gstreamer and removing the temporary directory.

func (*Recorder) Events

func (r *Recorder) Events() chan image.Event

Events returns a channel on which Events can be received.

type RecorderOpts

type RecorderOpts struct {
	Verbose  bool
	Interval time.Duration // How often to record an image.
	DeviceID string        // As retrieved from ListDevices. If empty, NewRecorder will use the first device returned by ListDevices.
}

RecorderOpts has options for a new gstreamer recorder.

Jump to

Keyboard shortcuts

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