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.
65 lines
1.7 KiB
65 lines
1.7 KiB
#ifndef __KERNEL_HELPER_MEDIA_MTX_HEADER__
|
|
#define __KERNEL_HELPER_MEDIA_MTX_HEADER__
|
|
|
|
#ifndef LRF_PROXY_ONLY
|
|
|
|
#include "dataBinder.h"
|
|
#include "../../components/base/basicThread.h"
|
|
#include <sys/types.h>
|
|
#include <sys/stat.h>
|
|
#include <unistd.h>
|
|
#include <vector>
|
|
|
|
|
|
|
|
|
|
typedef struct S_StreamDescRecord{
|
|
uint32_t cam_id;
|
|
uint32_t node_id;
|
|
uint32_t stream_id;
|
|
uint8_t status;
|
|
bool valid;
|
|
char source_uri[512];
|
|
}StreamDescRecord;
|
|
|
|
typedef std::vector<StreamDescRecord *> V_StreamDescRecords;
|
|
|
|
#define KH_STATUS_MTX_NA 0
|
|
#define KH_STATUS_MTX_INIT 1
|
|
#define KH_STATUS_MTX_AOK 2
|
|
#define KH_STATUS_MTX_ERR 255
|
|
|
|
#define KH_MTX_STREAM_LOADDED 0
|
|
#define KH_MTX_STREAM_REGISTERED 1
|
|
#define KH_MTX_STREAM_ONLINE 2
|
|
#define KH_MTX_STREAM_OFFLINE 3
|
|
#define KH_MTX_STREAM_ERROR 255
|
|
|
|
class kernelHelperMediaMTX: public basicThread {
|
|
private:
|
|
basicLogCollection * m_pLog;
|
|
dataBinder * m_pDBC;
|
|
V_StreamDescRecords m_vStreamRecords;
|
|
uint8_t m_bStatus;
|
|
char m_sWorkDir[512];
|
|
char m_sAppLogFile[512];
|
|
char m_sAppConfigFile[512];
|
|
off_t m_nLastLogSize;
|
|
bool loadConfig();
|
|
bool loadStreams();
|
|
protected:
|
|
virtual void m_fThreadProc(void);
|
|
public:
|
|
kernelHelperMediaMTX();
|
|
virtual ~kernelHelperMediaMTX();
|
|
bool create();
|
|
bool validateConfig();
|
|
bool assignStream( uint32_t stream_id );
|
|
bool updateConfig();
|
|
bool restart();
|
|
bool validateService();
|
|
uint8_t getStatus(){ return m_bStatus; };
|
|
};
|
|
|
|
#endif // ! LRF_PROXY_ONLY
|
|
#endif
|