00001 #ifndef IMAGE_V4LINPUT_H 00002 #define IMAGE_V4LINPUT_H 00003 00004 #include "mimasconfig.h" 00005 00006 #ifdef HAVE_LINUX_VIDEODEV_H 00007 00008 #include "image_input.h" 00009 #include <linux/videodev.h> 00010 #include "rgba.h" 00011 00012 namespace mimas { 00013 00035 template< typename T > 00036 class image_v4linput: public image_input< T > 00037 { 00038 public: 00039 image_v4linput( const std::string &_device, 00040 int channel = 0, 00041 int width = -1, int height = -1, 00042 int channel_norm = VIDEO_MODE_PAL ) throw (mimasexception); 00043 ~image_v4linput(void); 00044 virtual void read( image<T> &img ) throw (mimasexception); 00045 int getWidth(void) const { return win.width; } 00046 int getHeight(void) const { return win.height; } 00047 void setSensivity( __u16 brightness, 00048 __u16 hue, 00049 __u16 colour, 00050 __u16 contrast ) throw (mimasexception); 00051 protected: 00052 int xioctl( int request, void *arg ); 00053 void selectPalette(void) throw (mimasexception); 00054 std::string device; 00055 int fd; 00056 void *map; 00057 struct video_channel chan; 00058 struct video_picture pic; 00059 struct video_window win; 00060 struct video_mbuf buf; 00061 }; 00062 00064 00066 00067 }; 00068 00069 #include "image_v4linput.tcc" 00070 00071 #endif 00072 00073 #endif 00074