00001 00042 #ifndef __VETLIB_VETDIRECTXINPUT_H__ 00043 #define __VETLIB_VETDIRECTXINPUT_H__ 00044 00045 #include "../vetDefs.h" 00046 #include "../vetInput.h" 00047 00048 #include "../vetFrameYUV420.h" 00049 #include "../vetFrameRGB24.h" 00050 #include "../vetFrameT.h" 00051 00052 00053 00054 // just for HWND 00055 // #include <windows.h> 00056 00057 #define VETDX_MAXDEVICES 20 00058 00059 struct vetDXCapture; //defined in vetDirectXInput.cpp 00060 00061 00062 class vetDirectXInput : public vetInput 00063 { 00064 00065 protected: 00066 00067 vetDXCapture* cCap; 00068 00072 int deviceCount; 00076 char deviceDesc[VETDX_MAXDEVICES][160]; 00077 00078 int height; // for control check only 00079 int width; // for control check only 00080 00081 00082 int vetCheckVideoPort(vetDXCapture* vdx); 00083 00084 int initCaptureGraphBuilder(vetDXCapture* vdx); 00085 00086 int vetUpdateFormatList(vetDXCapture* vdx); 00087 00093 void doReleaseMixer(vetDXCapture* vdx); 00094 00095 00096 public: 00097 00111 vetDirectXInput(int device = -1); 00112 00113 vetDirectXInput(int device, float fps); 00114 00119 ~vetDirectXInput(); 00120 00121 00128 void enumerateDevices(void); 00129 00135 int getDeviceCount(void) { return deviceCount; }; 00136 00143 const char* getDeviceDescription(int device); 00144 00151 int getCurrentDevice(); 00152 00161 VETRESULT setDevice(int device); 00162 00163 00164 00165 VETRESULT openPropertyPage(void* HWND_Owner); 00166 00167 00175 VETRESULT connectTo(int device); 00176 00185 VETRESULT connect(void); 00186 00192 VETRESULT disconnect(void); 00193 00194 00200 VETRESULT doStopLive(); 00201 00208 VETRESULT doStartLive(); 00209 00215 bool isLive(); 00216 00222 unsigned int getWidth() const { return width; }; 00223 00229 unsigned int getHeight() const { return height; }; 00230 00236 VETRESULT setImageSize(int width, int height); 00237 00244 void getImageSize(int *width, int *height); 00245 00251 int getFormat(); 00252 00261 VETRESULT setFormat(int format); 00262 00274 VETRESULT getFormat(int format, int *width, int *height, char* desc); 00275 00281 int getFormatCount(); 00282 00283 00284 00290 bool EoF(); 00291 00292 00298 VETRESULT reset(); 00299 00300 00313 VETRESULT extractTo(vetFrameYUV420& img); 00314 00327 VETRESULT extractTo(vetFrameRGB24& img); 00328 00341 VETRESULT extractTo(vetFrameT<unsigned char>& img); 00342 00343 }; 00344 00345 00346 00347 #endif //__VETLIB_VETDIRECTXINPUT_H__ 00348
1.4.4