15#ifndef V4L2_V4L2_SOURCE_H_
16#define V4L2_V4L2_SOURCE_H_
19#include <linux/videodev2.h>
37 V4L2Capture(std::string_view device,
int width,
int height);
77 void PrintCaps(
const v4l2_capability* cap)
const;
Class for Video 4 Linux 2 (V4L2) capture.
Definition v4l2_source.h:28
std::string device_
The video capture device.
Definition v4l2_source.h:82
bool CaptureFrame(uint8_t *buffer) const
Capture a frame from the V4L2 device.
Definition v4l2_source.cc:138
V4L2Capture & operator=(const V4L2Capture &)=delete
Delete the assignment operator.
int fd_
The file descriptor for the V4L2 device.
Definition v4l2_source.h:80
void PrintCaps(const v4l2_capability *cap) const
Print the capabilities of the V4L2 device.
Definition v4l2_source.cc:22
int Initalise()
Initalise the V4L2 device.
Definition v4l2_source.cc:35
uint8_t * buffer_
The buffer to store the frame in.
Definition v4l2_source.h:88
int width_
The width of the frame.
Definition v4l2_source.h:84
V4L2Capture(const V4L2Capture &)=delete
Delete the copy constructor.
int height_
The height of the frame.
Definition v4l2_source.h:86
~V4L2Capture()
Destroy the V4L2Capture::V4L2Capture object.
Definition v4l2_source.cc:125
The buffer structure.
Definition capture_yuyv.c:81