driver

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var IfSaveFrame bool
View Source
var IfSaveVideo bool

Functions

func GenFileName

func GenFileName(dir string, format string) string

GenFileName generate file name with current time. Formate f<year><month><day><hour><minute><second><millisecond>.<format>

func OnvifFunc

func OnvifFunc(dev *onvif.Device, funcName string, value string) (ret string, err error)

OnvifFunc standard ONVIF functions. Users could expand this function as required.

func SaveFrame

func SaveFrame(input string, outDir string, format string, frameCount int, frameInterval int) error

SaveFrame save frame.

func SaveVideo

func SaveVideo(inputFile string, outDir string, format string, frameCount int) error

SaveVideo save video.

Types

type OnvifClient

type OnvifClient struct {
	Client  *onvif.Device
	Handler interface{}
	Config  OnvifConfig
}

OnvifClient is the structure for Onvif client.

func NewClient

func NewClient(config OnvifConfig) (*OnvifClient, error)

NewClient allocate and return a Onvif client.

func (*OnvifClient) Get

func (c *OnvifClient) Get(method, value string) (results string, err error)

Get get register.

func (*OnvifClient) GetStatus

func (c *OnvifClient) GetStatus() string

GetStatus get device status. For the package onvif doesn't expose any http/connection function, we call the GetSystemDataAndTime function to get the connection status.

func (*OnvifClient) GetStream

func (c *OnvifClient) GetStream() string

func (*OnvifClient) Set

func (c *OnvifClient) Set(method, value string) (err error)

Set set register.

type OnvifConfig

type OnvifConfig struct {
	Name           string
	URL            string
	User           string
	Passwordfile   string
	Certfile       string
	RemoteCertfile string
	Keyfile        string
	StreamURI      string
}

OnvifConfig is the structure for client configuration.

type OnvifResources

type OnvifResources struct {
	Resources map[string]*Resource `json:"resources"`
}

func GetOnvifResources

func GetOnvifResources() OnvifResources

GetOnvifResources get stream resources.

type Resource

type Resource struct {
	URL            string `json:"url"`
	UserName       string `json:"userName,omitempty"`
	Password       []byte `json:"password,omitempty"`
	Certfile       []byte `json:"certfile,omitempty"`
	RemoteCertfile []byte `json:"remoteCertfile,omitempty"`
	Keyfile        []byte `json:"keyfile,omitempty"`
}

Jump to

Keyboard shortcuts

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