#ifndef __VIDEO_INPUT_V4L2_HEADER__ #define __VIDEO_INPUT_V4L2_HEADER__ #include "video_in.h" #include #include #include #include #include class _V4L2_VideoInput : public _VideoInput { private: /* Vars */ int m_nFileDescriptor; int m_nBufferCounts; char m_pDevicePath[1024]; struct v4l2_capability m_sDeviceCaps; struct v4l2_format m_sVideoFormat; struct v4l2_requestbuffers m_sBufRequest; struct v4l2_buffer m_sBufferInfo; void * m_pBufferStart; /* Methods */ bool openDevice(void); bool openDevice(unsigned char * DevicePath); bool readDevCaps(void); bool setVideoFormat(void); bool assignBuffers(int BuffersCount); bool allocateBuffers(void); bool enqueueBuffer(int BufferID); bool dequeueBuffer(void); bool activateStreaming(void); bool deactivateStreaming(void); bool closeDevice(void); protected: void m_fInputProc(void); public: _V4L2_VideoInput(); _V4L2_VideoInput(char * DevicePath); ~_V4L2_VideoInput(); void make10th(char * FileName); }; // Based on https://jwhsmith.net/2014/12/capturing-a-webcam-stream-using-v4l2/ #endif