Added getters for structs

This commit is contained in:
Alex Eidt 2022-04-16 10:45:14 -07:00
parent fb2c0b201d
commit 4fef48055a
6 changed files with 257 additions and 126 deletions

View file

@ -22,6 +22,34 @@ type Camera struct {
cmd *exec.Cmd // ffmpeg command.
}
func (camera *Camera) Name() string {
return camera.name
}
func (camera *Camera) Width() int {
return camera.width
}
func (camera *Camera) Height() int {
return camera.height
}
func (camera *Camera) Depth() int {
return camera.depth
}
func (camera *Camera) FPS() float64 {
return camera.fps
}
func (camera *Camera) Codec() string {
return camera.codec
}
func (camera *Camera) FrameBuffer() []byte {
return camera.framebuffer
}
// Returns the webcam device name.
// On windows, ffmpeg output from the -list_devices command is parsed to find the device name.
func getDevicesWindows() []string {