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.

70 lines
2.6 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
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. #define MAX_CYCLE_COUNTER_VALUE 0xFFFFFFFF;
  33. #define SLEEP_KERNEL_INTERVAL 10 // 10 millisecond
  34. #define TIME_SYNC_INTERVAL 900000 // 15 minute(s) in 1 millisecond units
  35. #define STATUS_OK_INTERVAL 2000 // 2 Sec in 1 millisecond units
  36. class servaKernel: public kernelPrototype{
  37. private:
  38. static servaKernel * _instance;
  39. servaLifeMonitoring * m_pLifeMonitor;
  40. servaRemoteClient * m_pRPC;
  41. V_MEDIA_ENCODERS m_vEncodersPool;
  42. protected:
  43. virtual void m_fThreadProc( void );
  44. // Constructor
  45. explicit servaKernel( config_setting_t *ptr );
  46. bool processVideoFile( uint64_t dbid );
  47. void handleEncodedVideo( uint64_t dbid );
  48. public:
  49. static servaKernel * getInstance( config_setting_t *ptr = NULL );
  50. // Destructor
  51. virtual ~servaKernel();
  52. virtual bool create();
  53. // Functionality (implementatio in servaKernelToolKit.cpp )
  54. bool registerMojo();
  55. void updateEncodeStatus( uint64_t dbid, uint8_t status, uint8_t perc );
  56. uint64_t registerRemoteVideo( CSTR uuid, uint64_t src, uint32_t ts, uint16_t tsms, uint16_t width, uint16_t height, CSTR fmt );
  57. friend class servaRemoteClient;
  58. friend class servaRPCHadnler;
  59. };
  60. #endif // __MOJJO_KERNEL_H_INCL__