digit_video_recorder_driver

package
v0.0.0-...-d41ffd5 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2019 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FFMPEG_DEFAULT_BINARY = `ffmpeg`
)

Variables

View Source
var (
	DIGITI_VIDEO_RECORDER_STATE_ON  = &DigitVideoRecorderState{state: "on"}
	DIGITI_VIDEO_RECORDER_STATE_OFF = &DigitVideoRecorderState{state: "off"}
)
View Source
var (
	ErrInvalidDigitVideoRecorderDriver = errors.New("invalid digit video recorder driver")
	ErrInvalidRecordStorage            = errors.New("invalid record storage")
	ErrNotStartable                    = errors.New("not startable")
	ErrNotFound                        = errors.New("record not found")
)

Functions

This section is empty.

Types

type DigitVideoRecorderDriver

type DigitVideoRecorderDriver interface {
	Start() error
	Stop() error
	State() *DigitVideoRecorderState
	GetRecord(id string) (*Record, error)
	ListRecords(ListRecordsFitler) ([]*Record, error)
}

func NewDigitVideoRecorderDriver

func NewDigitVideoRecorderDriver(name string, opt *DigitVideoRecorderDriverOption, args ...interface{}) (DigitVideoRecorderDriver, error)

func NewFFmpegDigitVideoRecorderDriver

func NewFFmpegDigitVideoRecorderDriver(opt *DigitVideoRecorderDriverOption, args ...interface{}) (DigitVideoRecorderDriver, error)

type DigitVideoRecorderDriverFactory

type DigitVideoRecorderDriverFactory func(opt *DigitVideoRecorderDriverOption, args ...interface{}) (DigitVideoRecorderDriver, error)

type DigitVideoRecorderDriverOption

type DigitVideoRecorderDriverOption struct {
	*viper.Viper
}

func (*DigitVideoRecorderDriverOption) Sub

type DigitVideoRecorderState

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

func (*DigitVideoRecorderState) String

func (s *DigitVideoRecorderState) String() string

type FFmpegDigitVideoRecorderDriver

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

func (*FFmpegDigitVideoRecorderDriver) GetRecord

func (drv *FFmpegDigitVideoRecorderDriver) GetRecord(id string) (*Record, error)

func (*FFmpegDigitVideoRecorderDriver) ListRecords

func (drv *FFmpegDigitVideoRecorderDriver) ListRecords(flt ListRecordsFitler) ([]*Record, error)

func (*FFmpegDigitVideoRecorderDriver) Reset

func (*FFmpegDigitVideoRecorderDriver) Start

func (*FFmpegDigitVideoRecorderDriver) State

func (*FFmpegDigitVideoRecorderDriver) Stop

type ListRecordsFitler

type ListRecordsFitler struct {
	Range struct {
		StartAt time.Time
		EndAt   time.Time
	}
}

type Record

type Record struct {
	Id      string    `yaml:"id"`
	StartAt time.Time `yaml:"start_at"`
	EndAt   time.Time `yaml:"end_at"`
	Path    string    `yaml:"path"`
}

func (*Record) Data

func (r *Record) Data() map[string]interface{}

func (*Record) Reader

func (r *Record) Reader() (io.Reader, error)

type RecordStorage

type RecordStorage interface {
	ListRecords(ListRecordsFitler) ([]*Record, error)
	GetRecord(id string) (*Record, error)
	SetRecord(*Record) error
	UnsetRecord(id string) error
}

func NewRecordStorage

func NewRecordStorage(name string, opt *RecordStorageOption, args ...interface{}) (RecordStorage, error)

type RecordStorageOption

type RecordStorageOption struct {
	*viper.Viper
}

Jump to

Keyboard shortcuts

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