41 #ifndef vpV4l2Grabber_hh
42 #define vpV4l2Grabber_hh
44 #include <visp3/core/vpConfig.h>
49 #include <linux/videodev2.h>
52 #include <visp3/core/vpFrameGrabber.h>
53 #include <visp3/core/vpImage.h>
54 #include <visp3/core/vpRGBa.h>
55 #include <visp3/core/vpRect.h>
150 } vpV4l2FramerateType;
159 } vpV4l2FrameFormatType;
172 } vpV4l2PixelFormatType;
174 #ifndef DOXYGEN_SHOULD_SKIP_THIS
177 unsigned int pixelformat;
180 unsigned int bytesperline;
185 struct ng_video_fmt fmt;
214 #if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
256 void setFramerate(vpV4l2FramerateType framerate);
264 inline void setWidth(
unsigned w) { this->width = w; }
284 inline void setNBuffers(
unsigned nbuffers) { this->m_nbuffers = nbuffers; }
292 inline void setDevice(
const std::string &devname) { device = devname; }
303 this->m_pixelformat = pixelformat;
304 if (this->m_pixelformat >= V4L2_MAX_FORMAT)
305 this->m_pixelformat = V4L2_RGB24_FORMAT;
319 inline void setFrameFormat(vpV4l2FrameFormatType frameformat) { this->m_frameformat = frameformat; }
321 void getCapabilities();
322 void startStreaming();
323 void stopStreaming();
324 unsigned char *waiton(__u32 &index,
struct timeval ×tamp);
327 void printBufInfo(
struct v4l2_buffer buf);
332 struct v4l2_capability cap;
333 struct v4l2_streamparm streamparm;
334 struct v4l2_input *inp;
335 struct v4l2_standard *std;
336 struct v4l2_fmtdesc *fmt;
337 struct v4l2_queryctrl *ctl;
340 struct v4l2_format fmt_v4l2;
341 struct ng_video_fmt fmt_me;
342 struct v4l2_requestbuffers reqbufs;
343 struct v4l2_buffer *buf_v4l2;
344 struct ng_video_buf *buf_me;
346 unsigned int waiton_cpt;
355 vpV4l2FramerateType m_framerate;
356 vpV4l2FrameFormatType m_frameformat;
357 vpV4l2PixelFormatType m_pixelformat;
Base class for all video devices. It is designed to provide a front end to video sources.
virtual void open(vpImage< unsigned char > &I)=0
virtual void acquire(vpImage< unsigned char > &I)=0
Defines a rectangle in the plane.
Class that is a wrapper over the Video4Linux2 (V4L2) driver.
@ framerate_50fps
50 frames per second
void setWidth(unsigned w)
static const __u32 MAX_NORM
static const unsigned int MAX_CTRL
static const unsigned int MAX_BUFFERS
static const __u32 MAX_INPUTS
vpV4l2Grabber & operator=(const vpV4l2Grabber &)=delete
static const unsigned int DEFAULT_INPUT
void setVerboseMode(bool verbose)
vpV4l2Grabber(const vpV4l2Grabber &)=delete
vpV4l2PixelFormatType getPixelFormat()
static const unsigned int FRAME_SIZE
static const unsigned int DEFAULT_SCALE
static const __u32 MAX_FORMAT
void setHeight(unsigned h)
void setPixelFormat(vpV4l2PixelFormatType pixelformat)
void setNBuffers(unsigned nbuffers)
void setDevice(const std::string &devname)