| | |
| | | } |
| | | } |
| | | |
| | | #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); |
| | | } |