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.
66 lines
2.5 KiB
66 lines
2.5 KiB
#ifndef __ARGUS_ZLMEDIA_CONNECTOR_MODULE_HEADER__
|
|
#define __ARGUS_ZLMEDIA_CONNECTOR_MODULE_HEADER__
|
|
|
|
#include "../components/base/basicTypes.h"
|
|
#include "../components/base/basicSettingsProvider.h"
|
|
#include "../components/base/basicLogCollection.h"
|
|
#include "../components/base/basicMutex.h"
|
|
#include "../data/protocol/protocolZLMEDIA.h"
|
|
//#include "../../alg/generic/md5.h"
|
|
#include "rgooseModule.h"
|
|
|
|
#define ZLMC_STAGE_INIT 0
|
|
#define ZLMC_STAGE_START 1
|
|
#define ZLM_STAGE_COLLECT_DATA 2
|
|
#define ZLMC_STAGE_END 3
|
|
#define ZLM_SECONDS_VALIDATE 5
|
|
#define ZLM_10TH_SEC_RECORD_LENGTH 20 // 2 seconds
|
|
#define ZLM_10TH_SEC_RECORD_SKEEP 20 // 2 seconds
|
|
|
|
#define STORAGE_DIR_MODE 0x1FF
|
|
#define STORAGE_FILE_MODE 0x1B6
|
|
|
|
typedef struct S_ZL_RECORDER_SLOT{
|
|
uint32_t m_uStreamID;
|
|
uint32_t m_uVideoID;
|
|
char m_sSrcBase[1024];
|
|
char m_sDstBase[1024];
|
|
char m_sDstName[40];
|
|
uint32_t m_uPartNumber;
|
|
bool m_bFinished;
|
|
basicMutex * m_pMutex;
|
|
uint32_t m_uSkeep;
|
|
uint32_t m_uTimer;
|
|
#ifdef __linux__
|
|
pthread_t m_hThreadHandle;
|
|
#else
|
|
HANDLE m_hThreadHandle;
|
|
#endif
|
|
}ZL_RECORDER_SLOT;
|
|
|
|
typedef vector<ZL_RECORDER_SLOT*> VECTOR_ZL_RECORDER_SLOTS;
|
|
|
|
|
|
class argusModuleZLMedia: public argusKernelModule {
|
|
private:
|
|
uint8_t m_bCStage;
|
|
basicLogCollection * m_pLog;
|
|
DBC_MEDIA_SERVER_DATA m_sSettings;
|
|
protocolZLMEDIA * m_pProtocol;
|
|
//DBC_INT_LIST * m_pDefinedStreams;
|
|
char m_pBasePath[1024];
|
|
CSTR m_pVHostIP;
|
|
time_t m_tTimeSeconds;
|
|
void updateMRLs( void );
|
|
VECTOR_ZL_RECORDER_SLOTS m_vRecorderSlots;
|
|
bool startRecord( uint32_t evt_id, uint32_t chan, CSTR evtID, CSTR base );
|
|
static void * m_fRecorder( void *ptr );
|
|
CSTR createNewRecordFolder( CSTR seed );
|
|
public:
|
|
explicit argusModuleZLMedia( uint32_t id );
|
|
~argusModuleZLMedia();
|
|
virtual bool validate();
|
|
virtual void dispatchEvent( EVENT_CONTAINER *Evt );
|
|
};
|
|
|
|
#endif
|