Old fashion design for PC-104
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.9 KiB

4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. //----------------------------------------------------------------------------
  2. // Laser Guard Ltd.
  3. // Copyright � 2000-2002. All Rights Reserved.
  4. // Version 1.0 01/01/2000
  5. // Last modification: 08/10/2003
  6. // PROJECT:
  7. // SUBSYSTEM:
  8. // FILE: DirectShowVideo.cpp
  9. // AUTHOR: Sergey Chizhevskiy
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Source file of DirectShowVideo.cpp
  13. //----------------------------------------------------------------------------
  14. #include "stdafx.h"
  15. #include "..\Version.h"
  16. #include "DirectShowStreamVideo.h"
  17. #include "DirectShowVideo.h"
  18. CDirectShowVideo::CDirectShowVideo()
  19. {
  20. // by default show video
  21. m_bShowVideo = TRUE;
  22. m_nVideoInput = 0;
  23. m_nVideoStandard = AnalogVideo_None;
  24. LGLOG( LOG_LEVEL_MEDIUM, LOG_TYPE_INFO, this, "CDirectShowVideo::CDirectShowVideo" );
  25. }
  26. CDirectShowVideo::~CDirectShowVideo()
  27. {
  28. // importent to unlink itself from video stream
  29. CLgLinkSP<CDirectShowVideo,CDirectShowStream>::Unlink();
  30. LGLOG( LOG_LEVEL_MEDIUM, LOG_TYPE_INFO, this, "CDirectShowVideo::~CDirectShowVideo" );
  31. }
  32. void CDirectShowVideo::UpdateVideo( LPBITMAPINFOHEADER pBitmapInfoHeader, PBYTE pBytes, double SampleTime )
  33. {
  34. LGLOG( LOG_LEVEL_REALTIME, LOG_TYPE_INFO, this, _T("CDirectShowVideo::UpdateVideo"), _T("Started...") );
  35. // update image
  36. m_DirectShowDIB.Create( pBitmapInfoHeader, pBytes );
  37. // notify about new sample
  38. OnVideoSample( SampleTime );
  39. LGLOG( LOG_LEVEL_REALTIME, LOG_TYPE_INFO, this, _T("CDirectShowVideo::UpdateVideo"), _T("Done") );
  40. }
  41. BOOL CDirectShowVideo::Unlink( CLgLink<CDirectShowStream,CDirectShowVideo> *pLink )
  42. {
  43. // if( !m_DirectShowDIB.Erase() )
  44. // LGLOG( LOG_LEVEL_MEDIUM, LOG_TYPE_INFO, this, _T("CDirectShowVideo::Unlink"), _T("CDirectShowDIB::Clear failed") );
  45. // else
  46. // OnVideoSample( 0.0 );
  47. return CLgLinkSP<CDirectShowVideo,CDirectShowStream>::Unlink( pLink );
  48. }