From 51a5443baed67eed39dc26a0f8bff546650ab6d8 Mon Sep 17 00:00:00 2001 From: pans <pansen626@sina.com> Date: 星期二, 16 四月 2019 17:12:51 +0800 Subject: [PATCH] 添加注释 --- QiaoJiaSystem/GB28181DecoderModel/VideoCaptureElementWithRtp.cpp | 40 +++++++++++++++++++++++++++++----------- 1 files changed, 29 insertions(+), 11 deletions(-) diff --git a/QiaoJiaSystem/GB28181DecoderModel/VideoCaptureElementWithRtp.cpp b/QiaoJiaSystem/GB28181DecoderModel/VideoCaptureElementWithRtp.cpp index 9b7b775..974c3ce 100644 --- a/QiaoJiaSystem/GB28181DecoderModel/VideoCaptureElementWithRtp.cpp +++ b/QiaoJiaSystem/GB28181DecoderModel/VideoCaptureElementWithRtp.cpp @@ -49,28 +49,45 @@ DBG("waitSignal(\"DecoderImageOK\") begin"); #endif //绛夊緟淇″彿瑙﹀彂 +// DBG("waitSignal before: " << p_this->m_chanPubID); gSignalLock.waitSignal(p_this->m_chanPubID + "DecoderImageOK"); +// DBG("waitSignal: " << p_this->m_chanPubID); #ifdef TestCode DBG("waitSignal(\"DecoderImageOK\") after"); #endif - /****褰曞儚妯″潡浠g爜*****/ - p_this->m_picCount++; - //鍑犲紶閫変竴寮犳斁鍏edis - if (p_this->m_picCount % m_nPicsPickOne != 0) { - continue; - } else { - p_this->m_picCount.store(0); - } + // 浠巉fmpeg瑙g爜绫讳腑鑾峰彇鍥剧墖 p_this->m_fFmpegDecoderJPG.getImage().copyTo(p_this->m_image); + /****debug*****///todo + if (p_this->m_image.empty()) { + ERR("camID:" << p_this->m_chanPubID); + continue; + } +// else { +// static int count =0; +// count ++; +// if(count > 100){ +// ERR("camID:" << p_this->m_chanPubID << " cols:" << p_this->m_image.cols <<\ +// " rows:" << p_this->m_image.rows << " channels:" << p_this->m_image.channels()); +// count = 0; +// } +// } + { + /****褰曞儚妯″潡浠g爜*****/ + p_this->m_picCount++; + //鍑犲紶閫変竴寮犳斁鍏edis + if (p_this->m_picCount % m_nPicsPickOne != 0) { + continue; + } else { + p_this->m_picCount.store(0); + } cv::Mat copyMat; std::string imageName = p_this->m_fFmpegDecoderJPG.GetImageName(); p_this->m_image.copyTo(copyMat); - m_pManager->SaveImageToRedis(p_this->m_chanPubID, imageName, copyMat); + p_this->m_pManager->SaveImageToRedis(p_this->m_chanPubID, imageName, copyMat); } - /*********/ p_this->submit(); } @@ -129,6 +146,7 @@ p_this->m_running = false; stop(); INFO("grabFrame faild, element stopping"); + break; } else { //todo 涓氬姟姝婚攣 usleep((6 - reopenTime--) * 1000000); @@ -243,7 +261,7 @@ void BASICGB28181::VideoCaptureElementWithRtp::SaveVideo(const std::string &strImageName) { - INFO("SaveVideo: " << strImageName); +// INFO("SaveVideo: " << strImageName); std::string strTimeStamp = AppUtil::getTimeUSecString(); std::string strPath = MakeDir(strTimeStamp); m_fFmpegDecoderJPG.SaveVideoByImageName(strPath, strImageName); -- Gitblit v1.8.0