2828#define V4L2_PIX_FMT_HEVC v4l2_fourcc (' H' ,' E' ,' V' ,' C' )
2929#endif
3030
31+ enum V4l2IoType
32+ {
33+ IOTYPE_READWRITE,
34+ IOTYPE_MMAP
35+ };
36+
3137// ---------------------------------
3238// V4L2 Device parameters
3339// ---------------------------------
3440struct V4L2DeviceParameters
3541{
36- V4L2DeviceParameters (const char * devname,const std::list<unsigned int > & formatList,unsigned int width,unsigned int height,int fps,int verbose =0 ,int openFlags = O_RDWR | O_NONBLOCK) :
37- m_devName (devname), m_formatList(formatList), m_width(width), m_height(height), m_fps(fps), m_verbose(verbose), m_openFlags(openFlags) {}
42+ V4L2DeviceParameters (const char * devname,const std::list<unsigned int > & formatList,unsigned int width,unsigned int height,int fps,V4l2IoType ioType = IOTYPE_MMAP, int verbose =0 ,int openFlags = O_RDWR | O_NONBLOCK) :
43+ m_devName (devname), m_formatList(formatList), m_width(width), m_height(height), m_fps(fps),m_iotype(ioType), m_verbose(verbose), m_openFlags(openFlags) {}
3844
39- V4L2DeviceParameters (const char * devname,unsigned int format,unsigned int width,unsigned int height,int fps,int verbose =0 ,int openFlags = O_RDWR | O_NONBLOCK) :
40- m_devName (devname), m_width(width), m_height(height), m_fps(fps), m_verbose(verbose), m_openFlags(openFlags) {
45+ V4L2DeviceParameters (const char * devname,unsigned int format,unsigned int width,unsigned int height,int fps,V4l2IoType ioType = IOTYPE_MMAP, int verbose =0 ,int openFlags = O_RDWR | O_NONBLOCK) :
46+ m_devName (devname), m_width(width), m_height(height), m_fps(fps),m_iotype(ioType), m_verbose(verbose), m_openFlags(openFlags) {
4147if (format) {
4248m_formatList.push_back (format);
4349}
@@ -50,6 +56,7 @@ struct V4L2DeviceParameters
5056int m_fps;
5157int m_verbose;
5258int m_openFlags;
59+ V4l2IoType m_iotype;
5360};
5461
5562// ---------------------------------