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.

45 lines
1.7 KiB

7 years ago
​
​
​
​
​
​
​
​
​
​
​
7 years ago
​
​
​
​
​
​
​
​
7 years ago
​
​
​
​
​
​
​
​
​
​
​
7 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_sCurrentRecordPath[MAX_PATH_LEN];
  21. char m_sCurrentRecordName[CTEXT];
  22. bool m_bRecording;
  23. protected:
  24. void m_fThreadProc();
  25. public:
  26. explicit videoNode( config_setting_t *Settings = NULL );
  27. ~videoNode();
  28. void stopConveyour( void);
  29. virtual int startRecord( uint32_t RecordFrames = DEFAULT_FRAMES_COUNT );
  30. virtual int stopRecord( void); // Forcingly Stop Record
  31. CSTR takeSnapshot( void);
  32. CSTR getCurrentRecordName(void) { return m_sCurrentRecordName; };
  33. uint32_t getCurrentRecordIndex(void) { return m_nRecordedFramesCount; };
  34. virtual void pushFrame( cv::Mat *Frame, void *src = NULL );
  35. bool attachVideoAnalyzer( basicVideoAnalyzer *BVA );
  36. void connect( basicMediaDestination *V);
  37. void disconnect( basicMediaDestination *V);
  38. bool isRecording(void) { return m_bRecording; };
  39. };
  40. typedef vector<videoNode *> videoNodeCollection;
  41. #endif