00001 00029 #ifndef __VETLIB_VETVIDEO4LINUX_H__ 00030 #define __VETLIB_VETVIDEO4LINUX_H__ 00031 00032 #include "../vetDefs.h" 00033 #include "../vetInput.h" 00034 00035 #include "../vetFrameYUV420.h" 00036 #include "../vetFrameRGB24.h" 00037 #include "../vetFrameT.h" 00038 00039 00040 // move this to source file! 00041 #include <linux/videodev.h> 00042 00043 00044 class vetVideo4Linux : public vetInput 00045 { 00046 protected: 00047 00051 unsigned char* videoBuffer; 00052 00056 int bpp; 00057 00061 int fd; 00062 00066 unsigned int src_depth; 00067 00071 struct video_capability cap; 00072 00076 struct video_window win; 00077 00081 struct video_picture vpic; 00082 00083 00084 public: 00085 00092 vetVideo4Linux(char* inputFile = "/dev/video0"); 00093 00097 ~vetVideo4Linux(); 00098 00099 00107 VETRESULT connect(char* inputFile = "/dev/video0"); 00108 00114 VETRESULT disconnect(); 00115 00116 00122 bool EoF(); 00123 00124 00130 VETRESULT reset(); 00131 00137 int getColorDepth() { return bpp; }; 00138 00144 int getSize() { return win.width * win.height; }; 00145 00151 unsigned int getWidth() const { return (unsigned int)win.width; }; 00157 unsigned int getHeight() const { return (unsigned int)win.height; }; 00158 00164 int getPalette() { return vpic.palette; }; 00165 00171 int getVideoChannelCount() { return cap.channels; }; 00172 00178 int getAudioChannelCount() { return cap.audios; }; 00179 00185 int getBrightness() { return vpic.brightness; }; 00186 00192 void setBrightness(int value) { vpic.brightness = value; }; 00193 00199 int getContrast() { return vpic.contrast; }; 00200 00206 void setContrast(int value) { vpic.contrast = value; }; 00207 00213 int getHue() { return vpic.hue; }; 00214 00220 void setHue(int value) { vpic.hue = value; }; 00221 00227 int getColour() { return vpic.colour; }; 00228 00234 void setColour(int value) { vpic.colour = value; }; 00235 00241 int getWhiteness() { return vpic.whiteness; }; 00242 00248 void setWhiteness(int value) { vpic.whiteness = value; }; 00249 00250 00258 unsigned char* dump_buffer() { return videoBuffer; }; 00259 00260 00273 VETRESULT extractTo(vetFrameYUV420& img); 00274 00287 VETRESULT extractTo(vetFrameRGB24& img); 00288 00301 VETRESULT extractTo(vetFrameT<unsigned char>& img); 00302 00303 }; 00304 00305 00306 00307 #endif // __VETLIB_VETVIDEO4LINUX_H__
1.4.4