Versions in this module Expand all Collapse all v0 v0.2.0 Jan 8, 2022 Changes in this version type Frame + Data []int16 v0.1.0 Jan 7, 2022 Changes in this version + var ErrDeviceClosed = errors.New("device closed") + var ErrDeviceNotFound = errors.New("device not found") + var ErrStreamClosed = errors.New("stream closed") + type AEMode uint8 + const AEModeAperturePriority + const AEModeAuto + const AEModeManual + const AEModeShutterPriority + type ControlInterface struct + BcdUVC uint16 + ClockFrequency uint32 + EndpointAddress uint8 + Number uint8 + func (i *ControlInterface) String() string + type Device struct + func (dev *Device) Close() error + func (dev *Device) ControlInterface() *ControlInterface + func (dev *Device) Descriptor() (*DeviceDescriptor, error) + func (dev *Device) GetAddress() uint8 + func (dev *Device) GetBusNumber() uint8 + func (dev *Device) GetFormatDesc() *FormatDescriptor + func (dev *Device) GetStream(format FrameFormat, width, height, fps int) (*Stream, error) + func (dev *Device) IsClosed() bool + func (dev *Device) IsIdle() bool + func (dev *Device) Open() error + func (dev *Device) Ref() + func (dev *Device) SetAEMode(mode AEMode) error + func (dev *Device) StreamInterfaces() (ifs []*StreamInterface) + func (dev *Device) Unref() + type DeviceDescriptor struct + BcdUVC uint16 + Manufacturer string + Product string + ProductID uint16 + SerialNumber string + VendorID uint16 + func (d *DeviceDescriptor) String() string + type ErrorType C.enum_uvc_error + const ERROR_ACCESS + const ERROR_BUSY + const ERROR_CALLBACK_EXISTS + const ERROR_INTERRUPTED + const ERROR_INVALID_DEVICE + const ERROR_INVALID_MODE + const ERROR_INVALID_PARAM + const ERROR_IO + const ERROR_NOT_FOUND + const ERROR_NOT_SUPPORTED + const ERROR_NO_DEVICE + const ERROR_NO_MEM + const ERROR_OTHER + const ERROR_OVERFLOW + const ERROR_PIPE + const ERROR_TIMEOUT + const SUCCESS + type FormatDescriptor struct + AspectRatioX uint8 + AspectRatioY uint8 + BitsPerPixel uint8 + CopyProtect uint8 + DefaultFrameIndex uint8 + Flags uint8 + FormatIndex uint8 + InterlaceFlags uint8 + NumFrameDescriptors uint8 + Subtype VSDescSubType + VariableSize uint8 + func (d *FormatDescriptor) FrameDescriptors() (descs []*FrameDescriptor) + func (d *FormatDescriptor) String() string + type Frame struct + CaptureTime time.Time + FrameFormat FrameFormat + Height int + LibraryOwned bool + Metadata []byte + Sequence uint32 + Step int + Width int + func (fr *Frame) Read(b []byte) (int, error) + type FrameDescriptor struct + BytesPerLine uint32 + Capabilities uint8 + DefaultFrameInterval uint32 + FrameIndex uint8 + FrameIntervalStep uint32 + FrameIntervalType uint8 + Height uint16 + Intervals []uint32 + MaxBitRate uint32 + MaxFrameInterval uint32 + MaxVideoFrameBufferSize uint32 + MinBitRate uint32 + MinFrameInterval uint32 + Subtype VSDescSubType + Width uint16 + func (d *FrameDescriptor) String() string + type FrameFormat C.enum_uvc_frame_format + const FRAME_FORMAT_ANY + const FRAME_FORMAT_BGR + const FRAME_FORMAT_BY8 + const FRAME_FORMAT_COMPRESSED + const FRAME_FORMAT_COUNT + const FRAME_FORMAT_GRAY8 + const FRAME_FORMAT_MJPEG + const FRAME_FORMAT_RGB + const FRAME_FORMAT_UNCOMPRESSED + const FRAME_FORMAT_UNKNOWN + const FRAME_FORMAT_UYVY + const FRAME_FORMAT_Y16 + const FRAME_FORMAT_YUYV + type Stream struct + func (s *Stream) Close() error + func (s *Stream) Ctrl() *StreamCtrl + func (s *Stream) IsClosed() bool + func (s *Stream) Open() error + func (s *Stream) Start() (<-chan *Frame, error) + func (s *Stream) Stop() error + type StreamCtrl struct + ClockFrequency uint32 + CompQuality uint16 + CompWindowSize uint16 + Delay uint16 + FormatIndex uint8 + FrameIndex uint8 + FrameInterval uint32 + FramingInfo uint8 + Hint uint16 + InterfaceNumber uint8 + KeyFrameRate uint16 + MaxPayloadTransferSize uint32 + MaxVersion uint8 + MaxVideoFrameSize uint32 + MinVersion uint8 + PFrameRate uint16 + PreferredVersion uint8 + func (sc *StreamCtrl) String() string + type StreamInterface struct + EndpointAddress uint8 + Number uint8 + TerminalLink uint8 + func (i *StreamInterface) FormatDescriptors() (descs []*FormatDescriptor) + func (i *StreamInterface) String() string + type UVC struct + func (uvc *UVC) Exit() + func (uvc *UVC) FindDevice(vid, pid int, sn string) (*Device, error) + func (uvc *UVC) GetDevices() ([]*Device, error) + func (uvc *UVC) Init() error + type VSDescSubType C.enum_uvc_vs_desc_subtype + const VS_COLORFORMAT + const VS_FORMAT_DV + const VS_FORMAT_FRAME_BASED + const VS_FORMAT_MJPEG + const VS_FORMAT_MPEG2TS + const VS_FORMAT_STREAM_BASED + const VS_FORMAT_UNCOMPRESSED + const VS_FRAME_FRAME_BASED + const VS_FRAME_MJPEG + const VS_FRAME_UNCOMPRESSED + const VS_INPUT_HEADER + const VS_OUTPUT_HEADER + const VS_STILL_IMAGE_FRAME + const VS_UNDEFINED