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.

81 lines
3.0 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. #include "servaVideoComposer.h"
  35. #define MAX_CYCLE_COUNTER_VALUE 0xFFFFFFFF;
  36. #define SLEEP_KERNEL_INTERVAL 10 // 10 millisecond
  37. #define TIME_SYNC_INTERVAL 900000 // 15 minute(s) in 1 millisecond units
  38. #define STATUS_OK_INTERVAL 2000 // 2 Sec in 1 millisecond units
  39. class servaKernel: public kernelPrototype{
  40. private:
  41. static servaKernel * _instance;
  42. servaLifeMonitoring * m_pLifeMonitor;
  43. servaRemoteClient * m_pRPC;
  44. V_MEDIA_ENCODERS m_vEncodersPool;
  45. V_VIDEO_COMPOSERS m_vComposersPool;
  46. servaSessionManager * m_pSM;
  47. void * m_pModBus;
  48. DBC_SERVA_CONFIG m_sServaConfig;
  49. servaVideoComposer * m_pVideoComposer;
  50. protected:
  51. virtual void m_fThreadProc( void );
  52. // Constructor
  53. explicit servaKernel( config_setting_t *ptr );
  54. bool processVideoFile( uint64_t dbid );
  55. void handleEncodedVideo( servaMediaEncoder *ptr );
  56. bool updateStatus();
  57. bool cleanUpMess();
  58. public:
  59. static servaKernel * getInstance( config_setting_t *ptr = NULL );
  60. // Destructor
  61. virtual ~servaKernel();
  62. virtual bool dispatchEvent( EVENT_CONTAINER *Evt );
  63. virtual bool create();
  64. // Functionality (implementatio in servaKernelToolKit.cpp )
  65. bool registerServA();
  66. void updateEncodeStatus( uint64_t dbid, uint8_t status, uint8_t perc );
  67. friend class servaRemoteClient;
  68. friend class servaRPCHadnler;
  69. };
  70. #endif // __MOJJO_KERNEL_H_INCL__