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.

74 lines
2.7 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/basicEventHeap.h"
  23. #include "../../components/object/objectSystemAnchor.h"
  24. #include "../../alg/lgs/detectorStructures.h"
  25. #include "../../alg/lgs/detector.h"
  26. #include "../../alg/lgs/mask.h"
  27. #include "../../alg/generic/md5.h"
  28. #include "../common/kernelPrototype.h"
  29. #include "lifeMonitoring.h"
  30. #include "servaRemoteClient.h"
  31. #include "servaMediaEncoder.h"
  32. #include "servaSessionManager.h"
  33. #define MAX_CYCLE_COUNTER_VALUE 0xFFFFFFFF;
  34. #define SLEEP_KERNEL_INTERVAL 10 // 10 millisecond
  35. #define TIME_SYNC_INTERVAL 900000 // 15 minute(s) in 1 millisecond units
  36. #define STATUS_OK_INTERVAL 2000 // 2 Sec in 1 millisecond units
  37. class servaKernel: public kernelPrototype{
  38. private:
  39. static servaKernel * _instance;
  40. servaLifeMonitoring * m_pLifeMonitor;
  41. servaRemoteClient * m_pRPC;
  42. V_MEDIA_ENCODERS m_vEncodersPool;
  43. servaSessionManager * m_pSM;
  44. DBC_SERVA_CONFIG m_sServaConfig;
  45. protected:
  46. virtual void m_fThreadProc( void );
  47. // Constructor
  48. explicit servaKernel( config_setting_t *ptr );
  49. bool processVideoFile( uint64_t dbid );
  50. void handleEncodedVideo( servaMediaEncoder *ptr );
  51. bool updateStatus();
  52. bool cleanUpMess();
  53. public:
  54. static servaKernel * getInstance( config_setting_t *ptr = NULL );
  55. // Destructor
  56. virtual ~servaKernel();
  57. virtual bool create();
  58. // Functionality (implementatio in servaKernelToolKit.cpp )
  59. bool registerServA();
  60. void updateEncodeStatus( uint64_t dbid, uint8_t status, uint8_t perc );
  61. friend class servaRemoteClient;
  62. friend class servaRPCHadnler;
  63. };
  64. #endif // __MOJJO_KERNEL_H_INCL__