派生自 development/c++

chenshijun
2019-03-19 d9da6cb3e69c630f8c2cccfc4703b29c3498269e
QiaoJiaSystem/VideoToImageMulth/RtspAnalysManager.cpp
@@ -58,22 +58,23 @@
//                                                 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()) {
@@ -115,7 +116,7 @@
//
//        }
        } else {
            ERR("searchCamDevTableAll size is 0");
            ERR("searchCamDevTableByType size is 0");
        }
    }
}
@@ -165,9 +166,12 @@
            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, 0, this);
            m_controllers_videoCapElem[index]->SetVideoMinMaxSeconds(lst_dev.n_cut_min_duration,
                                                                     lst_dev.n_cut_max_duration);
            m_controllers_videoCapElem[index]->start();
@@ -310,7 +314,7 @@
            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);
            }