7 #ifndef __LIBCAMERA_INTERNAL_V4L2_DEVICE_H__
8 #define __LIBCAMERA_INTERNAL_V4L2_DEVICE_H__
14 #include <linux/videodev2.h>
25 bool isOpen()
const {
return fd_ != -1; }
32 const std::string &
deviceNode()
const {
return deviceNode_; }
38 int open(
unsigned int flags);
41 int ioctl(
unsigned long request,
void *argp);
43 int fd() {
return fd_; }
48 const struct v4l2_ext_control *v4l2Ctrls,
51 std::map<unsigned int, struct v4l2_query_ext_ctrl> controlInfo_;
52 std::vector<std::unique_ptr<V4L2ControlId>> controlIds_;
54 std::string deviceNode_;
A map of ControlId to ControlInfo.
Definition: controls.h:297
Associate a list of ControlId with their values for an object.
Definition: controls.h:342
Base class to support log message extensions.
Definition: log.h:83
Base class for V4L2VideoDevice and V4L2Subdevice.
Definition: v4l2_device.h:22
~V4L2Device()
Destroy a V4L2Device.
Definition: v4l2_device.cpp:59
bool isOpen() const
Check if the V4L2 device node is open.
Definition: v4l2_device.h:25
int ioctl(unsigned long request, void *argp)
Perform an IOCTL system call on the device node.
Definition: v4l2_device.cpp:359
const ControlInfoMap & controls() const
Retrieve the supported V4L2 controls and their information.
Definition: v4l2_device.h:27
void close()
Close the device node.
Definition: v4l2_device.cpp:125
int open(unsigned int flags)
Open a V4L2 device node.
Definition: v4l2_device.cpp:72
int setFd(int fd)
Set the file descriptor of a V4L2 device.
Definition: v4l2_device.cpp:110
int fd()
Retrieve the V4L2 device file descriptor.
Definition: v4l2_device.h:43
ControlList getControls(const std::vector< uint32_t > &ids)
Read controls from the device.
Definition: v4l2_device.cpp:163
int setControls(ControlList *ctrls)
Write controls to the device.
Definition: v4l2_device.cpp:273
V4L2Device(const std::string &deviceNode)
Construct a V4L2Device.
Definition: v4l2_device.cpp:51
const std::string & deviceNode() const
Retrieve the device node path.
Definition: v4l2_device.h:32
Support for V4L2 Controls using the V4L2 Extended Controls APIs.