#ifndef _VIDEO_H_ #define _VIDEO_H_ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "convert.h" #include "inmemoryfile.h" #include "miniwebcam.h" #include "videoframe.h" #define VDEV_INBUFFERS 3 enum { IOMODE_READ, IOMODE_MMAP }; // // jpeg error handling // struct jpg_error_mgr { struct jpeg_error_mgr pub; /* "public" fields */ jmp_buf setjmp_buffer; /* for return to caller */ }; typedef struct jpg_error_mgr *jpg_error_ptr; struct { unsigned int id; int min; int max; int value; std::string name; } typedef VideoDevCtrl; struct { unsigned int size; unsigned char* data; } typedef VideoInBuffer; #include "convert.h" class VideoDevice { private: protected: pthread_mutex_t mtx; std::list vidctrls; std::string conf_videodev; std::string conf_videocdev; uint32_t conf_videofmt; int conf_width; int conf_height; int conf_iomode; ConvertData cdata; int Lock(); int UnLock(); public: VideoDevice(); virtual ~VideoDevice(); virtual int SetDevice(std::string newdevice, std::string newcdevice, int nwidth, int nheight, uint32_t pixfmt) { debug (""); return 0; }; virtual int SetIOMode(int newiomode) { debug (""); return 0; }; virtual int Start() { debug (""); return 0; }; virtual int Stop() { debug (""); return 0; }; virtual int GetFrame (VideoFrame *destframe, VideoFrameFloat *destfloat) { debug (""); return 0; }; virtual int SetDevCtrl(unsigned int id, int value) { debug (""); return 0; }; virtual int GetDevCtrl(unsigned int id, int *value) { debug (""); return 0; }; virtual std::list GetDevCtrls() { return vidctrls; }; }; #include "videodevice_v4l2.h" #include "videodevice_dump.h" #endif