提交 91e87568 authored 作者: blu's avatar blu

init

上级 02100e65
......@@ -3,9 +3,11 @@
{
"name": "Mac",
"includePath": [
"${workspaceFolder}/**",
"${workspaceFolder}/opencv-motion-detect/inc/**",
"${workspaceFolder}/opencv-motion-detect/vendor/include/**",
"/usr/local/Cellar/opencv/4.1.0_2/include/opencv4",
"/usr/local/Cellar/ffmpeg/4.1.4_1/include"
"/usr/local/Cellar/ffmpeg/4.1.4_1/include",
"${workspaceFolder}/opencv-motion-detect/vendor/leveldb/include"
],
"defines": [],
"macFrameworkPath": [
......
......@@ -200,9 +200,6 @@ namespace LVDB {
return 0;
}
typedef int (*cb_verify_str)(const string&);
typedef int (*cb_verify_json)(const json&);
int getValue(string &value, string key, string fileName, cb_verify_str cb) {
int ret = 0;
DB* pdb = NULL;
......@@ -404,12 +401,21 @@ togo_end:
return 0;
}
int getLocalConfig(json &config, string fileName){
int getLocalConfig(json &config, string key, string fileName){
if(key.empty()) {
return getValue(config, LVDB_KEY_CONFIG, fileName, _validateConfig);
}else{
return getValue(config, key, fileName, _validateConfig);
}
};
int setLocalConfig(json &config, string fileName){
int setLocalConfig(json &config, string key, string fileName){
if(key.empty()) {
return setValue(config, LVDB_KEY_CONFIG, fileName, _validateConfig);
}else{
return setValue(config, key, fileName, _validateConfig);
}
};
// slices
......
......@@ -560,7 +560,7 @@ protected:
if(ret < 0) {
spdlog::error("evmlmotion {} failed to send event {} to {}: {}", this->selfId, evt, this->slicerGid, zmq_strerror(zmq_errno()));
}else{
}else {
spdlog::info("evmlmotion {} send event: {}", this->selfId, evt);
}
}
......
......@@ -228,7 +228,7 @@ private:
if(ipc.count("port") == 0) {
ipcPort = "554";
}else{
ipcPort = ipc["port"];
ipcPort = to_string(ipc["port"]);
}
......@@ -330,6 +330,7 @@ protected:
bool bStopSig = false;
uint64_t pktCnt = 0;
spdlog::info("evpulelr {} reading packets from {}", selfId, urlIn);
while (true) {
if(checkStop() == true) {
bStopSig = true;
......
......@@ -301,9 +301,11 @@ namespace cloudutils
/*
{
"time":0,
"lastupdated": 0,
"code":0,
"data":{
"ILSEVMGR1":{
"lastupdated": 0,
"sn":"ILSEVMGR1",
"addr":"172.31.0.76",
"addr-cloud":"172.31.0.76",
......@@ -317,6 +319,7 @@ namespace cloudutils
"proto":"rtsp",
"user":"admin",
"password":"FWBWTU",
"port": 554,
"status":1,
"modules":{
"evpuller":[
......
......@@ -21,6 +21,14 @@ namespace LVDB {
#define LVDB_KEY_SUFFIX_BACK "_bak"
#define LVDB_KEY_SN "SN"
#define LVDB_KEY_CONFIG "CONFIG"
typedef int (*cb_verify_str)(const string&);
typedef int (*cb_verify_json)(const json&);
int setValue(const string &value, string key, string fileName, cb_verify_str cb);
int getValue(string &value, string key, string fileName, cb_verify_str cb);
int setValue(const string &value, string key, string fileName, cb_verify_json cb);
int getValue(string &value, string key, string fileName, cb_verify_json cb);
//
json * findConfigModule(json &config, string sn, string moduleName, int iid);
......@@ -32,8 +40,8 @@ namespace LVDB {
int getSn(json &info,string fileName=LVDB_FILE_GENERAL);
// cloudutils::config
int getLocalConfig(json &config, string fileName=LVDB_FILE_GENERAL);
int setLocalConfig(json &config, string fileName=LVDB_FILE_GENERAL);
int getLocalConfig(json &config, string key = "", string fileName=LVDB_FILE_GENERAL);
int setLocalConfig(json &config, string key = "", string fileName=LVDB_FILE_GENERAL);
// slices
int getSlices(json &slices, string fileName);
......
......@@ -22,15 +22,15 @@ namespace zmqhelper {
#define MSG_HELLO "hello"
#define EV_MSG_META_PING "ping"
#define EV_MSG_META_PONG "pong"
#define EV_MSG_META_PEEROFFLINE "offline"
#define EV_MSG_META_RESTART "restart"
#define EV_MSG_META_UPDATE "update"
#define EV_MSG_META_EVENT "event"
#define EV_MSG_META_CMD "cmd"
#define EV_MSG_META_AVFORMATCTX "afctx"
#define EV_MSG_TYPE_AI_MOTION "ai_motion"
#define EV_MSG_TYPE_CONN_STAT "connstat"
#define EV_MSG_TYPE_SYS_STAT "sysstat"
// #define EV_MSG_CMD_RESTART "restart"
// #define EV_MSG_CMD_UPDATE "update"
#define EV_MSG_EVENT_MOTION_START "start"
#define EV_MSG_EVENT_MOTION_END "end"
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论