#ifndef _VIDEODEVICE_V4L2_H_ #define _VIDEODEVICE_V4L2_H_ #include "video.h" class VideoDevice_V4L2 : public VideoDevice { private: int inbuffer_idx; VideoInBuffer inbuffer[VDEV_INBUFFERS]; struct v4l2_cropcap cropcap; struct v4l2_crop crop; struct v4l2_format fmt; int fd; // filedescriptor to the video device file int cfd; // filedescriptor to the ctrl video device file int Open(); int Close(); int UnInit(); int InitMMap(); int xioctl(int fd, int request, void *arg); protected: public: VideoDevice_V4L2(); ~VideoDevice_V4L2(); int SetDevice(std::string newdevice, std::string newcdevice, int nwidth, int nheight, uint32_t pixfmt); int SetIOMode(int newiomode); int Start(); int Stop(); int GetFrame (VideoFrame *destframe, VideoFrameFloat *destfloat); int SetDevCtrl(unsigned int id, int value); int GetDevCtrl(unsigned int id, int *value); void PrintCaps(uint32_t caps); void PrintFmt(struct v4l2_format *f); }; #endif