home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2004 March / PCWELT_3_2004.ISO / pcwsoft / flaskmpeg_078_39_src.z.exe / flaskmpeg / VideoSource.h < prev    next >
Encoding:
C/C++ Source or Header  |  2002-10-28  |  1.5 KB  |  79 lines

  1. // VideoSource.h: interface for the CVideoSource class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4.  
  5. #if !defined(AFX_VIDEOSOURCE_H__31E17FD4_34FF_427F_B557_097F07BDAC72__INCLUDED_)
  6. #define AFX_VIDEOSOURCE_H__31E17FD4_34FF_427F_B557_097F07BDAC72__INCLUDED_
  7.  
  8. #if _MSC_VER > 1000
  9. #pragma once
  10. #endif // _MSC_VER > 1000
  11.  
  12. #include "thread.h"
  13. #include "flasktypes.h"
  14. #include "framesource.h"
  15. #include "framebuffer.h"
  16. #include "postprocessing.h"
  17. #include <list>
  18.  
  19.  
  20. using namespace std;
  21.  
  22.  
  23.  
  24.  
  25. // Return values
  26. #define FRAME_OK         0x01
  27. #define FRAME_NOTPRESENT 0x10
  28.  
  29. class CVideoSource: public CFlThread
  30. {
  31. public:
  32.   CVideoSource();
  33.  
  34.   virtual ~CVideoSource()
  35.   { 
  36.     Stop();
  37.   }
  38.  
  39.   bool Start( CFrameSource *pSource, TPPost *pp );
  40.   bool Stop();
  41.  
  42.   ui32 GetWidth(){ return m_nWidth; }
  43.   ui32 GetHeight(){ return m_nHeight; }
  44.   ui32 GetFrame(CFrame **ppFrame);
  45.  
  46.  
  47. private:
  48.  
  49.   enum Commands
  50.   {
  51.       getFrame=THREAD_COMMAND_COUNT
  52.   };
  53.   enum States 
  54.   {
  55.       stStopped=0, stGetFrame
  56.   };
  57.   // Actual running thread
  58.   DWORD ThreadProc();
  59.  
  60.   CListFrameBuffer   *m_pProcessedQueue;
  61.   CQueueFrameBuffer  *m_pOutputQueue;
  62.  
  63.   States           m_nState;
  64.   CFlEvent         m_evProcessedQueueSignal;
  65.   
  66.   CFrameSource *m_pFrameSource;
  67.  
  68.   CFlCritSec m_csCommand;
  69.   CFlCritSec m_csObject;
  70.  
  71.   FlPostProcess m_pp; // post processing object
  72.  
  73.   ui32 m_nWidth, m_nHeight;
  74.  
  75. };
  76.  
  77.  
  78. #endif // !defined(AFX_VIDEOSOURCE_H__31E17FD4_34FF_427F_B557_097F07BDAC72__INCLUDED_)
  79.