Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

VideoCollector.h

Go to the documentation of this file.
00001 #ifndef VIDEOCOLLECTOR_HPP 00002 #define VIDEOCOLLECTOR_HPP 00003 00004 #ifdef HAVE_CONFIG_H 00005 #include <config.h> 00006 #endif 00007 00008 #include <qmap.h> 00009 #include <qlist.h> 00010 00011 #ifdef _OS_WIN32_ 00012 #include <windows.h> 00013 #include <vfw.h> 00014 class CVideoDeviceWin32; 00015 #endif 00016 00017 #include "VideoDevice.h" 00018 00019 class CVideoCollector 00020 { 00021 private: 00022 static CVideoCollector *s_pVideoCollector; 00023 QList<CVideoDevice> m_Devices; 00024 00025 CVideoCollector(); 00026 void Scan(); 00027 00028 public: 00029 static CVideoCollector *Instance(); 00030 00031 uint NumberOfVideoDevices() const; 00032 CVideoDevice *GetVideoDevice(uint n); 00033 00034 #ifdef _OS_WIN32_ 00035 /* Windows uses callbacks. Callbacks suck. Windows sucks. Oh wait, 00036 you probably already knew that... :-) 00037 00038 Anyway. Since CVideoCollector is singleton, we might as well use 00039 it as our callback point. However, that requires some functions 00040 and member variables to be static. 00041 */ 00042 static QMap<HWND, CVideoDeviceWin32 *>s_HWND2Video; 00043 00044 void RegisterDevice(HWND, CVideoDeviceWin32 *); 00045 void UnregisterDevice(HWND); 00046 00047 // static LRESULT CALLBACK AudioCallback(HWND, int. LPTSTR); 00048 static LRESULT CALLBACK ControlCallback(HWND, int); 00049 static LRESULT CALLBACK ErrorCallback(HWND, int, LPTSTR); 00050 static LRESULT CALLBACK StatusCallback(HWND, int, LPTSTR); 00051 static LRESULT CALLBACK VideoCallback(HWND, LPVIDEOHDR); 00052 static LRESULT CALLBACK YieldCallback(HWND); 00053 #endif 00054 }; 00055 00056 #endif

Generated on Wed Dec 13 23:38:46 2006 for CamStream by doxygen 1.3.7