39#ifndef vpV4l2Grabber_hh
40#define vpV4l2Grabber_hh
42#include <visp3/core/vpConfig.h>
47#include <linux/videodev2.h>
50#include <visp3/core/vpFrameGrabber.h>
51#include <visp3/core/vpImage.h>
52#include <visp3/core/vpRGBa.h>
53#include <visp3/core/vpRect.h>
148 } vpV4l2FramerateType;
157 } vpV4l2FrameFormatType;
170 } vpV4l2PixelFormatType;
172#ifndef DOXYGEN_SHOULD_SKIP_THIS
175 unsigned int pixelformat;
178 unsigned int bytesperline;
183 struct ng_video_fmt fmt;
212#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
254 void setFramerate(vpV4l2FramerateType framerate);
282 inline void setNBuffers(
unsigned nbuffers) { this->m_nbuffers = nbuffers; }
290 inline void setDevice(
const std::string &devname) { device = devname; }
301 this->m_pixelformat = pixelformat;
317 inline void setFrameFormat(vpV4l2FrameFormatType frameformat) { this->m_frameformat = frameformat; }
319 void getCapabilities();
320 void startStreaming();
321 void stopStreaming();
322 unsigned char *waiton(__u32 &index,
struct timeval ×tamp);
325 void printBufInfo(
struct v4l2_buffer buf);
330 struct v4l2_capability cap;
331 struct v4l2_streamparm streamparm;
332 struct v4l2_input *inp;
333 struct v4l2_standard *std;
334 struct v4l2_fmtdesc *fmt;
335 struct v4l2_queryctrl *ctl;
338 struct v4l2_format fmt_v4l2;
339 struct ng_video_fmt fmt_me;
340 struct v4l2_requestbuffers reqbufs;
341 struct v4l2_buffer *buf_v4l2;
342 struct ng_video_buf *buf_me;
344 unsigned int waiton_cpt;
353 vpV4l2FramerateType m_framerate;
354 vpV4l2FrameFormatType m_frameformat;
355 vpV4l2PixelFormatType m_pixelformat;
virtual void open(vpImage< unsigned char > &I)=0
unsigned int height
Number of rows in the image.
unsigned int width
Number of columns in the image.
virtual void acquire(vpImage< unsigned char > &I)=0
Definition of the vpImage class member functions.
Defines a rectangle in the plane.
Class that is a wrapper over the Video4Linux2 (V4L2) driver.
@ framerate_50fps
50 frames per second
@ framerate_25fps
25 frames per second
void setWidth(unsigned w)
static const __u32 MAX_NORM
static const unsigned int MAX_CTRL
static const unsigned int MAX_BUFFERS
vpV4l2Grabber & operator=(const vpV4l2Grabber &)=delete
static const __u32 MAX_INPUTS
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)
vpV4l2FramerateType getFramerate()
void setDevice(const std::string &devname)