user_ctrl

command
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: MIT Imports: 7 Imported by: 0

README

Device user control

The go4vl API has support for querying and setting values for device user control as demonstrated in this example. For instance, the two functions below uses the go4vl API to set a user control and retrieve all user controls respectively.

func setUserControlValue(device *dev.Device, ctrlID v4l2.CtrlID, val int) error {
	if ctrlID == 0 {
		return fmt.Errorf("invalid control specified")
	}
	return device.SetControlValue(ctrlID, v4l2.CtrlValue(val))
}

func listUserControls(device *dev.Device) {
	ctrls, err := device.QueryAllControls()
	if err != nil {
		log.Fatalf("query controls: %s", err)
	}

	for _, ctrl := range ctrls {
		printUserControl(ctrl)
	}
}

See complete source code.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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