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
81 lines
3.0 KiB
//----------------------------------------------------------------------------
|
|
// Dr.Frucht Systems Ltd.
|
|
// Copyright © 2000-2022. All Rights Reserved.
|
|
// Version 1.0 11/19/2022
|
|
// Last modification: 11/19/2022
|
|
// PROJECT:
|
|
// SUBSYSTEM:
|
|
// FILE: mojoKernel.h
|
|
// AUTHOR: gagua
|
|
// OVERVIEW
|
|
// ~~~~~~~~
|
|
// Header file of mojoKernel.cpp
|
|
//----------------------------------------------------------------------------
|
|
//
|
|
|
|
#ifndef __MOJO_KERNEL_H_INCL__
|
|
#define __MOJO_KERNEL_H_INCL__
|
|
|
|
#define LA_METRO 1
|
|
#define MER_INC 2
|
|
|
|
#define NOTARGET_SESSION_CLOSE 300 //sec
|
|
|
|
#include "../../components/base/basicThread.h"
|
|
#include "../../components/base/basicSettingsProvider.h"
|
|
#include "../../components/base/basicEvent.h"
|
|
#include "../../components/base/basicEventHeap.h"
|
|
#include "../../components/object/objectSystemAnchor.h"
|
|
#include "../../alg/lgs/detectorStructures.h"
|
|
#include "../../alg/lgs/detector.h"
|
|
#include "../../alg/lgs/mask.h"
|
|
#include "../../alg/generic/md5.h"
|
|
|
|
#include "../common/kernelPrototype.h"
|
|
#include "servaLifeMonitoring.h"
|
|
#include "servaRemoteClient.h"
|
|
#include "servaMediaEncoder.h"
|
|
#include "servaSessionManager.h"
|
|
#include "servaVideoComposer.h"
|
|
|
|
|
|
#define MAX_CYCLE_COUNTER_VALUE 0xFFFFFFFF;
|
|
#define SLEEP_KERNEL_INTERVAL 10 // 10 millisecond
|
|
#define TIME_SYNC_INTERVAL 900000 // 15 minute(s) in 1 millisecond units
|
|
#define STATUS_OK_INTERVAL 2000 // 2 Sec in 1 millisecond units
|
|
|
|
class servaKernel: public kernelPrototype{
|
|
private:
|
|
static servaKernel * _instance;
|
|
servaLifeMonitoring * m_pLifeMonitor;
|
|
servaRemoteClient * m_pRPC;
|
|
V_MEDIA_ENCODERS m_vEncodersPool;
|
|
V_VIDEO_COMPOSERS m_vComposersPool;
|
|
servaSessionManager * m_pSM;
|
|
void * m_pModBus;
|
|
DBC_SERVA_CONFIG m_sServaConfig;
|
|
servaVideoComposer * m_pVideoComposer;
|
|
protected:
|
|
virtual void m_fThreadProc( void );
|
|
// Constructor
|
|
explicit servaKernel( config_setting_t *ptr );
|
|
bool processVideoFile( uint64_t dbid );
|
|
void handleEncodedVideo( servaMediaEncoder *ptr );
|
|
bool updateStatus();
|
|
bool cleanUpMess();
|
|
public:
|
|
static servaKernel * getInstance( config_setting_t *ptr = NULL );
|
|
// Destructor
|
|
virtual ~servaKernel();
|
|
virtual bool dispatchEvent( EVENT_CONTAINER *Evt );
|
|
virtual bool create();
|
|
// Functionality (implementatio in servaKernelToolKit.cpp )
|
|
bool registerServA();
|
|
void updateEncodeStatus( uint64_t dbid, uint8_t status, uint8_t perc );
|
|
|
|
friend class servaRemoteClient;
|
|
friend class servaRPCHadnler;
|
|
|
|
};
|
|
|
|
#endif // __MOJJO_KERNEL_H_INCL__
|