1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- package usbcapture
- import (
- "context"
- "github.com/vladimirvivien/go4vl/device"
- "github.com/vladimirvivien/go4vl/v4l2"
- )
- // The capture resolution to open video device
- type CaptureResolution struct {
- Width int
- Height int
- FPS int
- }
- type AudioConfig struct {
- SampleRate int
- Channels int
- FrameSize int
- BytesPerSample int
- }
- type Config struct {
- DeviceName string // The video device name, e.g., /dev/video0
- AudioDeviceName string // The audio device name, e.g., /dev/snd
- AudioEnabled bool // Exists support for audio capture
- AudioConfig *AudioConfig // The audio configuration
- }
- type Instance struct {
- /* Runtime configuration */
- Config *Config
- SupportedResolutions []FormatInfo //The supported resolutions of the video device
- Capturing bool
- /* Internals */
- /* Video capture device */
- camera *device.Device
- cameraStartContext context.CancelFunc
- frames_buff <-chan []byte
- pixfmt v4l2.FourCCType
- width int
- height int
- streamInfo string
- /* audio capture device */
- audiostopchan chan bool // Channel to stop audio capture
- }
|