/** mmvideo.h * * author marco corvi * date may 2003 * * credits: after the stv680 driver (thanks) * */ #include #ifndef MM_VIDEO_H #define MM_VIDEO_H #define MMVIDEO_NUMFRAMES 2 // double buffer #define MMVIDEO_TIMEOUT 1000 #define MMVIDEO_WIDTH 384 #define MMVIDEO_HEIGHT 288 #define MMVIDEO_DEPTH 3 // RGB #define MMVIDEO_FRAMESIZE 331776 // 3 * 384 * 288 #define MMVIDEO_PALETTE VIDEO_PALETTE_RGB24 enum { MMVIDEO_SQUARE, MMVIDEO_CROSS, MMVIDEO_CIRCLE, MMVIDEO_DIAMOND }; #define MMVIDEO_FRAME_READY 0x01 #define MMVIDEO_FRAME_MMAP 0x10 #define MMVIDEO_FRAME_MMAPUSED 0x20 // mmvideo frames // data are stored as RGB triplets struct mmvideo_frame { unsigned char * data; }; struct mmvideo_device { struct video_device vdev; struct video_picture vpict; int cwidth; // camera width-height int cheight; int vwidth; // video width-height int vheight; int user; // number of users (max 1) int total_cnt; // statistics int mmap_cnt; int error_cnt; int frame_cnt; int drop_cnt; unsigned char * fbuf; // videodev buffer area unsigned char * hw_fbuf; // videodev buffer area struct mmvideo_frame hw_frame[ 2 ]; struct mmvideo_frame frame[ MMVIDEO_NUMFRAMES ]; unsigned char frame_flag[ MMVIDEO_NUMFRAMES ]; int frame_nr; // index of the last captured frame int hw_frame_nr; // index of the last captured frame int frame_to_read; struct proc_dir_entry * proc_entry; struct semaphore lock; // video_device has already a semaphore ... wait_queue_head_t wq; // waiting processes struct timer_list timer; // struct file * file; // open file }; #endif // MM_VIDEO_H