v4l2

package module
v0.0.0-...-23c5d32 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

README

go-v4l2

A video4linux Go module

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	Device   string
	Width    int
	Height   int
	Format   V4l2ImageFormat
	Model    V4l2Model
	Channel  V4l2Channel
	LoopBack string
}

Options is the structure used to pass the arguments when opening a video4linux2 device.

type V4l2

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

V4l2 is the representation of a video4linux2 device.

func NewLoopback

func NewLoopback(device string, source *V4l2) (*V4l2, error)

func NewRPI

func NewRPI(options Options) (*V4l2, error)

func NewWebcam

func NewWebcam(options Options) (*V4l2, error)

func Open

func Open(options Options) (*V4l2, error)

Open opens a video4linux2 device to capture frames.

func (*V4l2) Capture

func (v *V4l2) Capture() (*V4l2Image, error)

Capture captures an image from the video4linux2 device.

func (*V4l2) Close

func (v *V4l2) Close()

Close closes the device.

func (*V4l2) GetSetting

func (v *V4l2) GetSetting(setting V4l2Setting) (int, error)

GetSetting gets the current value of a setting of a device.

func (*V4l2) SetSetting

func (v *V4l2) SetSetting(setting V4l2Setting, value int) error

SetSetting adjusts a specific setting in the capture device.

type V4l2Channel

type V4l2Channel int
const (
	ChannelUnknown V4l2Channel = iota
	ChannelTuner
	ChannelComposite
	ChannelSVideo
)

type V4l2Image

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

func (*V4l2Image) Height

func (i *V4l2Image) Height() uint

func (*V4l2Image) Size

func (i *V4l2Image) Size() uint

func (*V4l2Image) ToJpeg

func (i *V4l2Image) ToJpeg(filename string) error

func (*V4l2Image) Width

func (i *V4l2Image) Width() uint

type V4l2ImageFormat

type V4l2ImageFormat int
const (
	ImageFormatUnknown V4l2ImageFormat = iota
	ImageFormatGray
	ImageFormatBGR24
	ImageFormatYUV420
	ImageFormatYUYV
)

type V4l2Model

type V4l2Model int
const (
	ModelUnknown V4l2Model = iota
	ModelBt878
	ModelUSBWebcam
	ModelRPICamera
)

type V4l2Setting

type V4l2Setting int
const (
	SettingUnknown V4l2Setting = iota
	SettingBrightness
	SettingContrast
	SettingSaturation
	SettingHue
)

func V4l2SettingFromInt

func V4l2SettingFromInt(v uint32) V4l2Setting

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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