VideoAnalysFromHC 中修改sdkrule的处理等同于编辑摄像机
| | |
| | | if (db_c.updateSdkRule(rule)) { |
| | | // if(rule.nIsRun==1) |
| | | |
| | | killVideoAnalysFromHCApp(); |
| | | sleep(1); |
| | | runAllApp(); |
| | | // killVideoAnalysFromHCApp(); |
| | | // sleep(1); |
| | | // runAllApp(); |
| | | |
| | | |
| | | { |
| | | std::string topic = "VideoAnalysFromHC"; |
| | | Json::Value json_cfg; |
| | | json_cfg["editSdkRule"] = content; |
| | | std::string msg = json_cfg.toStyledString(); |
| | | DBG("msg:" << msg); |
| | | usleep(1000); |
| | | nsqMsgProducer->Publish(topic, (void *) (&msg)); |
| | | } |
| | | return "{\"ret_status\": \"ok_ack\"}"; |
| | | } else { |
| | | return "{\"ret_status\":\"内容有误,请检查!\"}"; |
| | |
| | | for (auto itor_json = value.begin(); itor_json != itor_json_end; ++itor_json) { |
| | | //#todo 使用策略模式?发送端多个指令累积后发送? |
| | | if (itor_json->isString() && reader.parse(itor_json->asString(), cfg_val)) { |
| | | if (itor_json.name() == "cam_edit") { |
| | | if (itor_json.name() == "cam_edit" || itor_json.name() == "editSdkRule") { |
| | | string cam_idx = cfg_val["str_cam_dev_id"].asString(); |
| | | if (pthis->controllers.find(cam_idx) != pthis->controllers.end()) { |
| | | if (pthis->m_GB28181_Enable) { |
| | |
| | | item.second->SetVideoMinMaxSeconds(cut_min_duration, cut_max_duration); |
| | | } |
| | | } |
| | | } else if (itor_json.name() == "cam_edit") { |
| | | } else if (itor_json.name() == "cam_edit" ) { |
| | | string cam_idx = cfg_val["str_cam_dev_id"].asString(); |
| | | if (pthis->m_GB28181_Enable) { |
| | | if (pthis->m_controllers_videoCapElem.find(cam_idx) != |