#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 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; // // only contain 24bit each color 8Bit class VideoFrame { private: virtual void AllocateFrame(); protected: void FreeFrame(); int mem_allocated; unsigned char *mem; int height; int width; public: VideoFrame(); ~VideoFrame(); int GetHeight() { return height; }; int GetWidth() { return width; }; unsigned char *GetPixBuf() { return mem; }; int SetSize(int w, int h); }; class VideoFrameFloat : public VideoFrame { private: void AllocateFrame(); protected: public: }; class VideoDevice { private: int videofd; protected: public: VideoDevice(); ~VideoDevice(); int SetDevice(); int Start(int w, int h); int Stop(); int GetFrame(VideoFrame *destframe); }; #endif