| | |
| | | // item.str_password.toStdString(), item.str_brand.toStdString()); |
| | | INFO("cam add is " << item.str_addr.toStdString()); |
| | | addCamera(t_camIdex, rtsp_url); |
| | | sleep(1); |
| | | } |
| | | } else { |
| | | ERR("searchCamDevTableAll size is 0"); |
| | | ERR("searchCamDevTableByType size is 0"); |
| | | } |
| | | |
| | | } else { |
| | | auto lst = m_lDBTool->searchCamDevTableAll(); |
| | | auto lst = m_lDBTool->searchCamDevTableByType(0); |
| | | Record_Config lst_dev = m_lDBTool->searchConfigTableWithinServerInfo(); |
| | | |
| | | //设置视频的最长和最短时间间隔 |
| | | appPref.setIntData("n_cut_max_duration", lst_dev.n_cut_max_duration); |
| | | appPref.setIntData("n_cut_min_duration", lst_dev.n_cut_min_duration); |
| | | if (lst.size() > 0) { |
| | | int startCamNO = appPref.getIntData("CamStart") * appPref.getIntData("CamStep"); |
| | | int CamCount = appPref.getIntData("CamStep"); |
| | | INFO("StartCamNO: " << startCamNO << " CamStep: " << CamCount); |
| | | int startCamNO = appPref.getIntData("CamStartNO"); |
| | | int CamCount = appPref.getIntData("CamEndNO") - appPref.getIntData("CamStartNO") + 1; |
| | | INFO("StartCamNO: " << startCamNO << " CamCount: " << CamCount); |
| | | auto itor = lst.begin(); |
| | | |
| | | if (startCamNO >= lst.size()) { |
| | |
| | | // |
| | | // } |
| | | } else { |
| | | ERR("searchCamDevTableAll size is 0"); |
| | | ERR("searchCamDevTableByType size is 0"); |
| | | } |
| | | } |
| | | } |
| | |
| | | m_imgRedisCRwLock.unlock(); |
| | | |
| | | //VideoCaptureElementWithRtp(std::string &chanPubID, int fps, int streamTransType, int gpuIdx = -1) |
| | | m_controllers_videoCapElem[index] = new BASICGB28181::VideoCaptureElementWithRtp( |
| | | const_cast<string &>(index), |
| | | 25, 0, 0, this); |
| | | // m_controllers_videoCapElem[index] = new BASICGB28181::VideoCaptureElementWithRtp( |
| | | // const_cast<string &>(index), |
| | | // 25, 0, 0, this); |
| | | |
| | | m_controllers_videoCapElem[index] = new PushStreamAppPipeController(const_cast<string &>(index), |
| | | 25, 0, appPref.getIntData("gpu.index"), this); |
| | | m_controllers_videoCapElem[index]->SetVideoMinMaxSeconds(lst_dev.n_cut_min_duration, |
| | | lst_dev.n_cut_max_duration); |
| | | m_controllers_videoCapElem[index]->start(); |
| | |
| | | m_imgRedisControllers[index] = new RtspImageRedisElement(index); |
| | | m_imgRedisControllers[index]->start(); |
| | | |
| | | m_controllers[index] = new RtspCaptureElement(rtsp, index, 25, 3000, 0, this); |
| | | m_controllers[index] = new RtspCaptureElement(rtsp, index, 25, 3000, appPref.getIntData("gpu.index"), this); |
| | | m_controllers[index]->SetVideoMinMaxSeconds(lst_dev.n_cut_min_duration, lst_dev.n_cut_max_duration); |
| | | m_controllers[index]->start(); |
| | | m_currentCount++; |
| | |
| | | } |
| | | } |
| | | |
| | | #ifndef GB28181 |
| | | |
| | | #else |
| | | |
| | | #endif |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | int RtspAnalysManager::removeCamera(const std::string &index) { |
| | | INFO("MYH DEBUG HERE"); |
| | | #ifndef GB28181 |
| | | if (m_controllers.find(index) == m_controllers.end())return -1; |
| | | auto controller = m_controllers[index]; |
| | | controller->stop(); |
| | | controller->wait(); |
| | | delete controller; |
| | | m_controllers.erase(index); |
| | | m_currentCount--; |
| | | |
| | | #else |
| | | if (m_controllers_videoCapElem.find(index) == m_controllers_videoCapElem.end())return -1; |
| | | auto controller = m_controllers_videoCapElem[index]; |
| | | controller->stop(); |
| | | controller->wait(); |
| | | delete controller; |
| | | m_controllers_videoCapElem.erase(index); |
| | | m_currentCount--; |
| | | #endif |
| | | if (m_GB28181_Enable) { |
| | | if (m_controllers_videoCapElem.find(index) == m_controllers_videoCapElem.end())return -1; |
| | | auto controller = m_controllers_videoCapElem[index]; |
| | | controller->stop(); |
| | | controller->wait(); |
| | | delete controller; |
| | | m_controllers_videoCapElem.erase(index); |
| | | m_currentCount--; |
| | | } else { |
| | | if (m_controllers.find(index) == m_controllers.end())return -1; |
| | | auto controller = m_controllers[index]; |
| | | controller->stop(); |
| | | controller->wait(); |
| | | delete controller; |
| | | m_controllers.erase(index); |
| | | m_currentCount--; |
| | | } |
| | | |
| | | m_imgRedisCRwLock.wrlock(); |
| | | auto imgRedis = m_imgRedisControllers[index]; |
| | |
| | | */ |
| | | int RtspAnalysManager::removeAll() { |
| | | INFO("MYH DEBUG HERE"); |
| | | #ifndef GB28181 |
| | | for (auto controller: m_controllers) { |
| | | controller.second->stop(); |
| | | |
| | | if (m_GB28181_Enable) { |
| | | for (auto controller: m_controllers_videoCapElem) { |
| | | controller.second->stop(); |
| | | } |
| | | for (auto controller: m_controllers_videoCapElem) { |
| | | controller.second->wait(); |
| | | delete controller.second; |
| | | } |
| | | m_controllers_videoCapElem.clear(); |
| | | } else { |
| | | for (auto controller: m_controllers) { |
| | | controller.second->stop(); |
| | | } |
| | | for (auto controller: m_controllers) { |
| | | controller.second->wait(); |
| | | delete controller.second; |
| | | } |
| | | m_controllers.clear(); |
| | | } |
| | | for (auto controller: m_controllers) { |
| | | controller.second->wait(); |
| | | delete controller.second; |
| | | } |
| | | m_controllers.clear(); |
| | | #else |
| | | for (auto controller: m_controllers_videoCapElem) { |
| | | controller.second->stop(); |
| | | } |
| | | for (auto controller: m_controllers_videoCapElem) { |
| | | controller.second->wait(); |
| | | delete controller.second; |
| | | } |
| | | m_controllers_videoCapElem.clear(); |
| | | #endif |
| | | INFO("MYH DEBUG HERE"); |
| | | |
| | | m_imgRedisCRwLock.wrlock(); |
| | |
| | | INFO("Record Video For: " << name); |
| | | ImageName_s_t nameSt = ImageName_s_t::fromString(name); |
| | | if (nameSt.Valid()) { |
| | | if (GB28181_Enable) { |
| | | if (m_GB28181_Enable) { |
| | | auto pCaptureElem = m_controllers_videoCapElem.find(nameSt.m_camId); |
| | | if (pCaptureElem != m_controllers_videoCapElem.end()) { |
| | | //#todo ~~~~~~!!!!!!! 这里有bug 需要放开调试 |
| | | // pCaptureElem->second->SaveVideo(name); |
| | | pCaptureElem->second->SaveVideo(name); |
| | | } else { |
| | | ERR("Can not Find CamId " << nameSt.m_camId); |
| | | } |