提交 1e165174 authored 作者: blu's avatar blu

new feature entropy filter to ignore gray frame without iframe

上级 61bccc25
......@@ -96,8 +96,9 @@ namespace LVDB {
return ret;
}
int traverseConfigureModules(json &config, cb_traverse_configration_module cb, string moduleName){
int traverseConfigureModules(json &config, cb_traverse_configration_module cb, void *pUser, string moduleName){
int ret = 0;
int cnt = 0;
if(config.count("data") == 0) {
return -1;
}
......@@ -135,7 +136,8 @@ namespace LVDB {
if(!sub.empty()) {
for(auto &m:module) {
if(m.count("type") != 0 && m["type"] == sub) {
ret = cb(modname, m);
ret = cb(modname, m, pUser);
cnt++;
if(ret <0) {
spdlog::error("failed to traverse and callback config on module: {}", m.dump());
return ret;
......@@ -147,7 +149,8 @@ namespace LVDB {
}else{
for(auto &[mn, mod]:modules.items()) {
for(auto &m:mod) {
ret = cb(mn,m);
ret = cb(mn,m, pUser);
cnt++;
if(ret <0) {
spdlog::error("failed to traverse and callback config on module: {}", m.dump());
return ret;
......@@ -159,7 +162,8 @@ namespace LVDB {
}
}
}
return 0;
return cnt;
}
int _getDB(string fileName, DB** pdb) {
......
......@@ -156,6 +156,7 @@ class HttpSrv{
try{
string sn = req.get_param_value("sn");
string module = req.get_param_value("module");
auto cfg = json::parse(req.body);
if(sn.empty()||module.empty()){
throw StrException("no para sn/module");
}
......@@ -163,9 +164,13 @@ class HttpSrv{
string key, modname;
if(module == "evmgr") {
key = sn;
// trigger exception if
(void)cfg["data"][key];
}else {
if(modname == "evml") {
string
modname = "evml:" + module.substr(4, module.size());
}else{
modname = module;
}
......
......@@ -74,7 +74,7 @@ private:
}
// set all module status to 0
ret = LVDB::traverseConfigureModules(config, [](string modname, json &m)->int{
ret = LVDB::traverseConfigureModules(config, [](string modname, json &m, void* pUser)->int{
if(m.count("status") != 0)
{
//cout << modname <<" ," << m.dump() << endl;
......
......@@ -53,8 +53,8 @@ namespace LVDB {
int getLog(json &log, json &writeOptions, string fileName);
int setLog(json &log, json &readOptions, string fileName);
typedef int(*cb_traverse_configration_module)(string modname, json &mod);
int traverseConfigureModules(json &config, cb_traverse_configration_module cb, string moduleName = "");
typedef int(*cb_traverse_configration_module)(string modname, json &mod, void *pUser);
int traverseConfigureModules(json &config, cb_traverse_configration_module cb, void *pUser = NULL, string moduleName = "");
} // namespace LVDB
#endif
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论