JeVois
1.19
JeVois Smart Embedded Machine Vision Toolkit
|
Share this page: |
|
|
|
 |
 |
|
Go to the documentation of this file.
23 #include <linux/videodev2.h>
37 CameraDevice(std::string
const & devname,
unsigned int const nbufs,
bool dummy);
61 void setFormat(
unsigned int const fmt,
unsigned int const capw,
unsigned int const caph,
float const fps,
62 unsigned int const cropw,
unsigned int const croph,
int preset = -1);
65 std::string
const itsDevName;
66 unsigned int const itsNbufs;
69 bool itsMplane =
false;
71 struct v4l2_format itsFormat { };
73 std::atomic<bool> itsStreaming;
74 std::future<void> itsRunFuture;
76 std::atomic<bool> itsRunning;
78 mutable std::condition_variable_any itsOutputCondVar;
79 mutable std::timed_mutex itsOutputMtx;
82 std::vector<size_t> itsDoneIdx;
85 mutable std::timed_mutex itsMtx;
CameraDevice(std::string const &devname, unsigned int const nbufs, bool dummy)
Constructor opens the device, checks its capabilities, starts run thread.
void done(RawImage &img)
Indicate that user processing is done with an image previously obtained via get()
void setFormat(unsigned int const fmt, unsigned int const capw, unsigned int const caph, float const fps, unsigned int const cropw, unsigned int const croph, int preset=-1)
Set the video format and frame rate.
void abortStream()
Abort streaming.
A raw image as coming from a V4L2 Camera and/or being sent out to a USB Gadget.
void get(RawImage &img)
Get the next captured buffer.
int getFd() const
Get our fd; used by Camera to access controls.
void streamOff()
Stop streaming.
~CameraDevice()
Destructor frees all buffers and closes the device.
Accessory class to hold all the data associated with a V4L2 camera device.
void streamOn()
Start streaming.
Collection of buffers for V4L2 video frames (Camera or Gadget) with hooks to the MMAP'd areas.