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
2.8 KiB
81 lines
2.8 KiB
#ifndef __MEKOROT_KERNEL_HEADER__
|
|
#define __MEKOROT_KERNEL_HEADER__
|
|
|
|
#include "../../lib/components/base/basicEngine.h"
|
|
#include "../../lib/components/base/basicLogCollection.h"
|
|
#include "../../lib/components/base/basicMediaDestination.h"
|
|
#include "../../lib/components/base/basicSettingsProvider.h"
|
|
#include "../../lib/components/base/basicThread.h"
|
|
#include "../../lib/data/media/lapsedVideoRecorder.h"
|
|
#include "../../lib/data/media/videoNode.h"
|
|
#include "../../lib/data/media/video/videoAVLIBSource.h"
|
|
//#include "../../lib/data/media/video/videoV4L2Source.h"
|
|
#include "../../lib/data/protocol/protocolLGS.h"
|
|
#include "../../lib/data/storage/storageProvider.h"
|
|
#include "../../lib/hardware/uart/serialPort.h"
|
|
|
|
#define MEKOROT_KRNL_SERIAL_LINE_TAG "SERIAL_LINE"
|
|
#define MEKOROT_KRNL_SERIAL_SPEED_TAG "SERIAL_SPEED"
|
|
#define MEKOROT_KRNL_DEVICE_0_ID_TAG "DEVICE_LEFT_ID"
|
|
#define MEKOROT_KRNL_DEVICE_1_ID_TAG "DEVICE_CENTER_ID"
|
|
#define MEKOROT_KRNL_DEVICE_2_ID_TAG "DEVICE_RIGHT_ID"
|
|
#define KNL_SETTINGS_VIDEO_SECTION "VIDEO"
|
|
|
|
#define MEKOROT_KRNL_STG_INIT 0
|
|
#define MEKOROT_KRNL_STG_CONNECT 1
|
|
#define MEKOROT_KRNL_STG_PING_DEVICES 2
|
|
#define MEKOROT_KRNL_STG_WORKING 3
|
|
|
|
#define MAX_RECORD_FRAMES 120
|
|
#define MAX_TARGET_ACCEPTED_AT_ONCE 100
|
|
|
|
#define KERNEL_SLOW_SLEEP_TIME 1000 // msec
|
|
#define KERNEL_QUICK_SLEEP_TIME 50 // msec
|
|
|
|
class mekorotKernel: public basicEngine, public basicThread, public basicMediaDestination, public protocolLGS_CLIENT {
|
|
private:
|
|
basicLogCollection *m_pLog;
|
|
config_setting_t *m_pSettings;
|
|
serialPort *m_pSerial;
|
|
uint8_t m_bStage;
|
|
char m_pSerialDevice[128];
|
|
uint32_t m_nSerialSpeed;
|
|
int8_t m_bDeviceID[3];
|
|
unsigned long long m_bDeviceTO[3];
|
|
bool m_bDeviceFlags[3];
|
|
bool m_bDeviceAlarms[3];
|
|
|
|
int m_nVideoInputs;
|
|
basicMediaSource ** m_pVideoInputs;
|
|
lapsedVideoRecorder * m_pVideoOutput;
|
|
CSTR * m_pVideoNames;
|
|
|
|
uint32_t m_nInitialFSID;
|
|
uint32_t m_nRecordCounter;
|
|
uint32_t m_nFrameCounter;
|
|
basicMutex * m_pMatProtector;
|
|
cv::Mat * m_pFinalFrame;
|
|
cv::Mat ** m_pVideoFrame;
|
|
|
|
bool m_bHorizontal;
|
|
bool m_bRecordIsActive;
|
|
bool m_bRecordIsSaving;
|
|
long long m_lStartTS;
|
|
uint32_t m_nCLoopMask;
|
|
uint32_t m_nCLoopCheck;
|
|
int m_nWidth;
|
|
int m_nHeight;
|
|
CSTR m_pStorageBase;
|
|
storageProvider * m_pStorageProvider;
|
|
protected:
|
|
void m_fThreadProc(void);
|
|
virtual bool packetHandler(protocolPackage* Package);
|
|
public:
|
|
explicit mekorotKernel( config_setting_t *ptr=NULL );
|
|
virtual ~mekorotKernel();
|
|
virtual bool init(void);
|
|
virtual void pushFrame(cv::Mat* Frame, void* src = NULL);
|
|
bool copyFrame(cv::Mat& Frame);
|
|
};
|
|
|
|
#endif
|