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.

42 lines
1.6 KiB

8 years ago
​
​
​
​
​
​
​
​
​
​
​
8 years ago
​
​
​
​
​
​
​
​
​
8 years ago
​
​
​
​
​
​
​
​
​
​
​
​
8 years ago
​
​
​
​
  1. #ifndef __VIDEO_NODE_HEADER__
  2. #define __VIDEO_NODE_HEADER__
  3. #include "video/videoAVLIBSource.h"
  4. #include "video/videoAVLIBDestination.h"
  5. #include "../../components/base/basicThread.h"
  6. #include "../../components/base/basicMutex.h"
  7. #include "../../components/base/basicMediaDestination.h"
  8. #include "../../components/base/basicSettingsProvider.h"
  9. #include "../../components/base/basicVideoAnalyzer.h"
  10. #define DEFAULT_FRAMES_COUNT 100 // 4 sec for 25 fps
  11. class videoNode : public basicMediaDestination, public basicThread {
  12. private:
  13. config_setting_t *m_pSettings;
  14. cv::Mat *m_pCurrentMat;
  15. bool m_bNewDataArival;
  16. mediaDestinationsCollection m_vDestinations;
  17. basicMutex *m_pMatProtector;
  18. uint32_t m_nRecorderCounter;
  19. uint32_t m_nRecordedFramesCount;
  20. char m_sCurrentRecordName[MAX_PATH_LEN];
  21. bool m_bRecording;
  22. protected:
  23. void m_fThreadProc();
  24. public:
  25. explicit videoNode( config_setting_t *Settings = NULL );
  26. ~videoNode();
  27. void stopConveyour( void);
  28. virtual int startRecord( uint32_t RecordFrames = DEFAULT_FRAMES_COUNT );
  29. virtual int stopRecord( void); // Forcingly Stop Record
  30. CSTR takeSnapshot( void);
  31. CSTR getCurrentRecordName(void) { return m_sCurrentRecordName; };
  32. virtual void pushFrame( cv::Mat *Frame, void *src = NULL );
  33. bool attachVideoAnalyzer( basicVideoAnalyzer *BVA );
  34. void connect( basicMediaDestination *V);
  35. void disconnect( basicMediaDestination *V);
  36. };
  37. typedef vector<videoNode *> videoNodeCollection;
  38. #endif