JeVois
1.22
JeVois Smart Embedded Machine Vision Toolkit
|
|
#include <jevois/Core/CameraDevice.H>
Accessory class to hold all the data associated with a V4L2 camera device.
This class is used internally by jevois::Camera and is of little use to end users.
Definition at line 32 of file CameraDevice.H.
Public Member Functions | |
CameraDevice (std::string const &devname, unsigned int const nbufs, bool dummy) | |
Constructor opens the device, checks its capabilities, starts run thread. | |
~CameraDevice () | |
Destructor frees all buffers and closes the device. | |
int | getFd () const |
Get our fd; used by Camera to access controls. | |
void | streamOn () |
Start streaming. | |
void | abortStream () |
Abort streaming. | |
void | streamOff () |
Stop streaming. | |
void | get (RawImage &img) |
Get the next captured buffer. | |
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. | |
jevois::CameraDevice::CameraDevice | ( | std::string const & | devname, |
unsigned int const | nbufs, | ||
bool | dummy | ||
) |
Constructor opens the device, checks its capabilities, starts run thread.
When dummy is true, we will just dequeue and requeue the buffers with no processing.
Definition at line 76 of file CameraDevice.C.
References jevois::async_little(), jevois::fccstr(), FDLDEBUG, FDLFATAL, FDLINFO, JEVOIS_TRACE, LFATAL, XIOCTL, and XIOCTL_QUIET.
jevois::CameraDevice::~CameraDevice | ( | ) |
Destructor frees all buffers and closes the device.
Definition at line 172 of file CameraDevice.C.
References FDLERROR, JEVOIS_TRACE, JEVOIS_WAIT_GET_FUTURE, and jevois::warnAndIgnoreException().
void jevois::CameraDevice::abortStream | ( | ) |
void jevois::CameraDevice::done | ( | jevois::RawImage & | img | ) |
Indicate that user processing is done with an image previously obtained via get()
Definition at line 481 of file CameraDevice.C.
References jevois::RawImage::bufindex, JEVOIS_TIMED_LOCK, JEVOIS_TRACE, and LDEBUG.
void jevois::CameraDevice::get | ( | jevois::RawImage & | img | ) |
Get the next captured buffer.
Definition at line 428 of file CameraDevice.C.
References jevois::RawImage::bufindex, jevois::rawimage::convertBayerToYUYV(), jevois::rawimage::convertGreyToYUYV(), FDLFATAL, jevois::RawImage::invalidate(), JEVOIS_TRACE, and LDEBUG.
int jevois::CameraDevice::getFd | ( | ) | const |
Get our fd; used by Camera to access controls.
Definition at line 195 of file CameraDevice.C.
void jevois::CameraDevice::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.
Definition at line 496 of file CameraDevice.C.
References jevois::fccstr(), FDLDEBUG, FDLERROR, FDLFATAL, FDLINFO, jevois::VideoMapping::fpsToV4l2(), JEVOIS_TIMED_LOCK, JEVOIS_TRACE, V4L2_COLORSPACE_DEFAULT, V4L2_MODE_VIDEO, XIOCTL, and XIOCTL_QUIET.
void jevois::CameraDevice::streamOff | ( | ) |
Stop streaming.
Definition at line 384 of file CameraDevice.C.
References FDLDEBUG, JEVOIS_TRACE, LDEBUG, jevois::warnAndIgnoreException(), and XIOCTL_QUIET.
void jevois::CameraDevice::streamOn | ( | ) |
Start streaming.
Definition at line 320 of file CameraDevice.C.
References FDLDEBUG, FDLERROR, FDLFATAL, FDLINFO, JEVOIS_TIMED_LOCK, JEVOIS_TRACE, LDEBUG, jevois::v4l2ImageSize(), and XIOCTL.