svvitch
digital signage player
|
00001 #pragma once 00002 00003 #include "Scene.h" 00004 //#include "ui/UserInterfaceManager.h" 00005 #include "streams.h" 00006 #include "Dvdmedia.h" 00007 #include "DSVideoRenderer.h" 00008 #include <Poco/ActiveMethod.h> 00009 #include "MainScene.h" 00010 00011 00012 using Poco::ActiveMethod; 00013 00014 00019 class CaptureScene: public Scene 00020 { 00021 private: 00022 Poco::FastMutex _lock; 00023 DWORD _frame; 00024 DWORD _startup; 00025 00026 BOOL _useStageCapture; 00027 int _deviceNo; 00028 int _routePinNo; 00029 int _deviceW; 00030 int _deviceH; 00031 int _deviceFPS; 00032 bool _useDeinterlace; 00033 bool _autoWhiteBalance; 00034 int _whiteBalance; 00035 bool _autoExposure; 00036 int _exposure; 00037 int _flipMode; 00038 GUID _deviceVideoType; 00039 RECT _clip; 00040 00041 int _px; 00042 int _py; 00043 int _pw; 00044 int _ph; 00045 00046 int _spx; 00047 int _spy; 00048 int _spw; 00049 int _sph; 00050 00051 IBaseFilter* _device; 00052 IGraphBuilder* _gb; 00053 ICaptureGraphBuilder2* _capture; 00054 DSVideoRendererPtr _vr; 00055 IMediaControl* _mc; 00056 00057 LPDIRECT3DTEXTURE9 _cameraImage; 00058 LPDIRECT3DTEXTURE9 _sample; 00059 LPDIRECT3DSURFACE9 _surface; 00060 LPD3DXEFFECT _fx; 00061 00062 int _sw; 00063 int _sh; 00064 LPINT _data1; 00065 LPINT _data2; 00066 LPINT _data3; 00067 bool _forceUpdate; 00068 int _intervalsBackground; 00069 int _intervalsForeground; 00070 LPBOOL _lookup; 00071 LPINT _block; 00072 LPBOOL _activeBlock; 00073 int _blockThreshold; 00074 int _lookupThreshold; 00075 int _detectCount; 00076 int _detectThreshold; 00077 string _detectedPlaylist; 00078 vector<string> _activePlaylist; 00079 int _ignoreDetectTime; 00080 int _ignoreDetectCount; 00081 00082 MainScenePtr _main; 00083 00084 00086 bool createFilter(); 00087 00089 void releaseFilter(); 00090 00098 bool fetchDevice(REFCLSID clsidDeviceClass, int index, IBaseFilter** pBf, string& deviceName = string()); 00099 00106 bool getPin(IBaseFilter* filter, IPin** pin, PIN_DIRECTION dir); 00107 00109 bool getInPin(IBaseFilter* filter, IPin** pin); 00110 00112 bool getOutPin(IBaseFilter* filter, IPin** pin); 00113 00115 void setWhiteBalance(IBaseFilter* src, bool autoFlag, long v = -100); 00116 00118 void setExposure(IBaseFilter* src, bool autoFlag, long v = -100); 00119 00121 bool routeCrossbar(IBaseFilter *pSrc, int no); 00122 00124 int dumpFilter(IGraphBuilder* gb); 00125 00127 const string getPinName(long lType); 00128 00130 const string errorText(HRESULT hr); 00131 00133 ActiveMethod<bool, void, CaptureScene> activeChangePlaylist; 00134 bool changePlaylist(); 00135 00136 public: 00137 CaptureScene(Renderer& renderer); 00138 00139 virtual ‾CaptureScene(); 00140 00141 virtual bool initialize(); 00142 00143 LPDIRECT3DTEXTURE9 getCameraImage(); 00144 00145 virtual void process(); 00146 00147 virtual void draw1(); 00148 00149 virtual void draw2(); 00150 }; 00151 00152 typedef CaptureScene* CaptureScenePtr;