| | |
| | | appPref.setIntData("n_cut_min_duration", lst_dev.n_cut_min_duration); |
| | | if (lst.size() > 0) { |
| | | |
| | | for (auto item : lst) |
| | | int startCamNO = appPref.getIntData("CamStart") * appPref.getIntData("CamStep"); |
| | | int CamCount = appPref.getIntData("CamStep"); |
| | | auto itor = lst.begin(); |
| | | |
| | | if(startCamNO >= lst.size()) |
| | | { |
| | | std::string t_camIdex = item.str_cam_dev_id.toStdString(); |
| | | std::string rtsp_url = rtspAddrBuild(item.str_ip.toStdString(), 554, item.str_username.toStdString(), |
| | | item.str_password.toStdString(), item.str_brand.toStdString()); |
| | | INFO("cam add is " << item.str_addr.toStdString()); |
| | | ERR("startCamNO > lst.size()"); |
| | | return; |
| | | } |
| | | |
| | | for(int i=0; i < startCamNO; i++){ |
| | | itor++; |
| | | } |
| | | |
| | | for (int i = 0; i < CamCount; i++) { |
| | | if (itor == lst.end()) |
| | | { |
| | | ERR("itor == lst.end()"); |
| | | return; |
| | | } |
| | | std::string t_camIdex = itor->str_cam_dev_id.toStdString(); |
| | | std::string rtsp_url = rtspAddrBuild(itor->str_ip.toStdString(), 554, itor->str_username.toStdString(), |
| | | itor->str_password.toStdString(), itor->str_brand.toStdString()); |
| | | INFO("cam add is " << itor->str_addr.toStdString()); |
| | | |
| | | addCamera(t_camIdex, rtsp_url); |
| | | |
| | | itor++; |
| | | } |
| | | |
| | | // for (auto item : lst) |
| | | // { |
| | | // std::string t_camIdex = item.str_cam_dev_id.toStdString(); |
| | | // std::string rtsp_url = rtspAddrBuild(item.str_ip.toStdString(), 554, item.str_username.toStdString(), |
| | | // item.str_password.toStdString(), item.str_brand.toStdString()); |
| | | // INFO("cam add is " << item.str_addr.toStdString()); |
| | | // |
| | | // addCamera(t_camIdex, rtsp_url); |
| | | // |
| | | // } |
| | | } else { |
| | | ERR("searchCamDevTableAll size is 0"); |
| | | } |
| | |
| | | } else { |
| | | removeCamera(index); |
| | | DBG("removeCamera " << index); |
| | | return addCamera(rtsp, index); |
| | | return addCamera(index, rtsp); |
| | | } |
| | | } |
| | | |