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.

77 lines
2.8 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
2 years ago
2 years ago
​
​
​
2 years ago
2 years ago
​
​
​
​
2 years ago
2 years ago
​
2 years ago
2 years ago
​
​
  1. //----------------------------------------------------------------------------
  2. // Dr.Frucht Systems Ltd.
  3. // Copyright � 2000-2022. All Rights Reserved.
  4. // Version 1.0 11/19/2022
  5. // Last modification: 11/19/2022
  6. // PROJECT:
  7. // SUBSYSTEM:
  8. // FILE: mojoKernel.h
  9. // AUTHOR: gagua
  10. // OVERVIEW
  11. // ~~~~~~~~
  12. // Header file of mojoKernel.cpp
  13. //----------------------------------------------------------------------------
  14. //
  15. #ifndef __MOJO_KERNEL_H_INCL__
  16. #define __MOJO_KERNEL_H_INCL__
  17. #define LA_METRO 1
  18. #define MER_INC 2
  19. #define NOTARGET_SESSION_CLOSE 300 //sec
  20. #include "../../components/base/basicThread.h"
  21. #include "../../components/base/basicSettingsProvider.h"
  22. #include "../../components/base/basicEvent.h"
  23. #include "../../components/base/basicEventHeap.h"
  24. #include "../../components/object/objectSystemAnchor.h"
  25. #include "../../alg/lgs/detectorStructures.h"
  26. #include "../../alg/lgs/detector.h"
  27. #include "../../alg/lgs/mask.h"
  28. #include "../../alg/generic/md5.h"
  29. #include "../common/kernelPrototype.h"
  30. #include "servaLifeMonitoring.h"
  31. #include "servaRemoteClient.h"
  32. #include "servaMediaEncoder.h"
  33. #include "servaSessionManager.h"
  34. #define MAX_CYCLE_COUNTER_VALUE 0xFFFFFFFF;
  35. #define SLEEP_KERNEL_INTERVAL 10 // 10 millisecond
  36. #define TIME_SYNC_INTERVAL 900000 // 15 minute(s) in 1 millisecond units
  37. #define STATUS_OK_INTERVAL 2000 // 2 Sec in 1 millisecond units
  38. class servaKernel: public kernelPrototype{
  39. private:
  40. static servaKernel * _instance;
  41. servaLifeMonitoring * m_pLifeMonitor;
  42. servaRemoteClient * m_pRPC;
  43. V_MEDIA_ENCODERS m_vEncodersPool;
  44. servaSessionManager * m_pSM;
  45. void * m_pModBus;
  46. DBC_SERVA_CONFIG m_sServaConfig;
  47. protected:
  48. virtual void m_fThreadProc( void );
  49. // Constructor
  50. explicit servaKernel( config_setting_t *ptr );
  51. bool processVideoFile( uint64_t dbid );
  52. void handleEncodedVideo( servaMediaEncoder *ptr );
  53. bool updateStatus();
  54. bool cleanUpMess();
  55. public:
  56. static servaKernel * getInstance( config_setting_t *ptr = NULL );
  57. // Destructor
  58. virtual ~servaKernel();
  59. virtual bool dispatchEvent( EVENT_CONTAINER *Evt );
  60. virtual bool create();
  61. // Functionality (implementatio in servaKernelToolKit.cpp )
  62. bool registerServA();
  63. void updateEncodeStatus( uint64_t dbid, uint8_t status, uint8_t perc );
  64. friend class servaRemoteClient;
  65. friend class servaRPCHadnler;
  66. };
  67. #endif // __MOJJO_KERNEL_H_INCL__