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;
233 vpV4l2FramerateType getFramerate();
251 void setFramerate(vpV4l2FramerateType framerate);
259 inline void setWidth(
unsigned w) { this->width = w; }
279 inline void setNBuffers(
unsigned nbuffers) { this->m_nbuffers = nbuffers; }
287 inline void setDevice(
const std::string &devname) { device = devname; }
298 this->m_pixelformat = pixelformat;
299 if (this->m_pixelformat >= V4L2_MAX_FORMAT)
300 this->m_pixelformat = V4L2_RGB24_FORMAT;
314 inline void setFrameFormat(vpV4l2FrameFormatType frameformat) { this->m_frameformat = frameformat; }
316 void getCapabilities();
317 void startStreaming();
318 void stopStreaming();
319 unsigned char *waiton(__u32 &index,
struct timeval ×tamp);
322 void printBufInfo(
struct v4l2_buffer buf);
327 struct v4l2_capability cap;
328 struct v4l2_streamparm streamparm;
329 struct v4l2_input *inp;
330 struct v4l2_standard *std;
331 struct v4l2_fmtdesc *fmt;
332 struct v4l2_queryctrl *ctl;
335 struct v4l2_format fmt_v4l2;
336 struct ng_video_fmt fmt_me;
337 struct v4l2_requestbuffers reqbufs;
338 struct v4l2_buffer *buf_v4l2;
339 struct ng_video_buf *buf_me;
341 unsigned int waiton_cpt;
350 vpV4l2FramerateType m_framerate;
351 vpV4l2FrameFormatType m_frameformat;
352 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
static const unsigned int DEFAULT_INPUT
void setVerboseMode(bool verbose)
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)