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>
145 } vpV4l2FramerateType;
154 } vpV4l2FrameFormatType;
167 } vpV4l2PixelFormatType;
169 #ifndef DOXYGEN_SHOULD_SKIP_THIS
172 unsigned int pixelformat;
175 unsigned int bytesperline;
180 struct ng_video_fmt fmt;
228 vpV4l2FramerateType getFramerate();
246 void setFramerate(vpV4l2FramerateType framerate);
254 inline void setWidth(
unsigned w) { this->width = w; }
274 inline void setNBuffers(
unsigned nbuffers) { this->m_nbuffers = nbuffers; }
282 inline void setDevice(
const std::string &devname) { device = devname; }
293 this->m_pixelformat = pixelformat;
294 if (this->m_pixelformat >= V4L2_MAX_FORMAT)
295 this->m_pixelformat = V4L2_RGB24_FORMAT;
309 inline void setFrameFormat(vpV4l2FrameFormatType frameformat) { this->m_frameformat = frameformat; }
311 void getCapabilities();
312 void startStreaming();
313 void stopStreaming();
314 unsigned char *waiton(__u32 &index,
struct timeval ×tamp);
317 void printBufInfo(
struct v4l2_buffer buf);
322 struct v4l2_capability cap;
323 struct v4l2_streamparm streamparm;
324 struct v4l2_input *inp;
325 struct v4l2_standard *std;
326 struct v4l2_fmtdesc *fmt;
327 struct v4l2_queryctrl *ctl;
330 struct v4l2_format fmt_v4l2;
331 struct ng_video_fmt fmt_me;
332 struct v4l2_requestbuffers reqbufs;
333 struct v4l2_buffer *buf_v4l2;
334 struct ng_video_buf *buf_me;
336 unsigned int waiton_cpt;
345 vpV4l2FramerateType m_framerate;
346 vpV4l2FrameFormatType m_frameformat;
347 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
void setVerboseMode(bool verbose)
vpV4l2PixelFormatType getPixelFormat()
static const unsigned int FRAME_SIZE
static const unsigned int DEFAULT_SCALE
static const unsigned int DEFAULT_INPUT
static const __u32 MAX_FORMAT
void setHeight(unsigned h)
void setPixelFormat(vpV4l2PixelFormatType pixelformat)
void setNBuffers(unsigned nbuffers)
void setDevice(const std::string &devname)