From 6eacd6d2904e401f66f2876eb463cef76c833290 Mon Sep 17 00:00:00 2001
From: chenshijun <csj_sky@126.com>
Date: 星期一, 22 四月 2019 15:58:16 +0800
Subject: [PATCH] 删除一些不必要的文件
---
QiaoJiaSystem/GB28181DecoderModel/VideoCaptureElementWithRtp.cpp | 85 +++++++++++++++++++++---------------------
1 files changed, 42 insertions(+), 43 deletions(-)
diff --git a/QiaoJiaSystem/GB28181DecoderModel/VideoCaptureElementWithRtp.cpp b/QiaoJiaSystem/GB28181DecoderModel/VideoCaptureElementWithRtp.cpp
index 974c3ce..9aedc2d 100644
--- a/QiaoJiaSystem/GB28181DecoderModel/VideoCaptureElementWithRtp.cpp
+++ b/QiaoJiaSystem/GB28181DecoderModel/VideoCaptureElementWithRtp.cpp
@@ -49,40 +49,53 @@
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
-
-
-// 浠巉fmpeg瑙g爜绫讳腑鑾峰彇鍥剧墖
+ // 浠巉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;
+ if (p_this->m_publishVideoRet) {
+ if (p_this->videoPublishElement == nullptr) {
+ string path = appConfig.getStringProperty("srsAddr") + "cam" + p_this->m_chanPubID + ".flv";
+ cv::Size size_(appConfig.getIntProperty("pulish.width"), appConfig.getIntProperty("pulish.height"));
+ int gupIdx = appPref.getIntData("gpu.index");
+ DBG("videoPublishpath: " << p_this->m_chanPubID << path << " h:" << size_.height);
+ p_this->videoPublishElement = new ffmpeg::PipeVideoPublishElement(path, size_, "flv", 25, gupIdx);
+ p_this->videoPublishElement->start();
+ } else {
+ if (!p_this->m_image.empty()) {
+ p_this->videoPublishElement->setImage(p_this->m_image);
+ p_this->videoPublishElement->submit();
+ } else {
+ ERR("m_image.empty()");
+ }
+ }
} else {
- p_this->m_picCount.store(0);
+ if (p_this->videoPublishElement != nullptr) {
+ DBG("videoPublishElement->stop() :" << p_this->m_chanPubID);
+ p_this->videoPublishElement->stop();
+ p_this->videoPublishElement->wait();
+ delete p_this->videoPublishElement;
+ p_this->videoPublishElement = nullptr;
+ }else{
+// DBG("videoPublishElement null :" << p_this->m_chanPubID);
+ }
}
+ }
+
+ /****褰曞儚妯″潡浠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);
@@ -142,19 +155,19 @@
} else {
// 鏍规嵁reopenTime鍒ゆ柇鏄惁闇�瑕侀噸鍚�
- if (reopenTime < 0) {
+ if (p_this->reopenTime < 0) {
p_this->m_running = false;
stop();
INFO("grabFrame faild, element stopping");
- break;
} else {
//todo 涓氬姟姝婚攣
- usleep((6 - reopenTime--) * 1000000);
- INFO("grabFrame faild, try reopen video: ");
+ usleep((6 - p_this->reopenTime--) * 1000000);
+ INFO("grabFrame faild, try reopen video, reopenTime:" << p_this->reopenTime);
//鍏抽棴ffmpeg瑙g爜妯″潡
p_this->m_fFmpegDecoderJPG.stopThd();
//鍚姩ffmpeg瑙g爜妯″潡
+ DBG("m_chanPubID:"<<p_this->m_chanPubID << " m_fps:" << p_this->m_fps);
p_this->m_fFmpegDecoderJPG.startThd(p_this->m_chanPubID, p_this->m_fps, p_this->m_gpuIdx);
continue;
}
@@ -222,20 +235,6 @@
}
void BASICGB28181::VideoCaptureElementWithRtp::threadFunc() {
-
- if (m_publishVideoRet) {
- if (videoPublishElement == nullptr) {
- string path = appConfig.getStringProperty("srsAddr") + "cam" + m_chanPubID + ".flv";
- cv::Size size_(appConfig.getIntProperty("pulish.width"), appConfig.getIntProperty("pulish.height"));
- int gupIdx = appPref.getIntData("gpu.index");
- videoPublishElement = new ffmpeg::VideoPublishElement(path, size_, "flv", 25, gupIdx);
- } else {
- videoPublishElement->stop();
- videoPublishElement->wait();
- delete videoPublishElement;
- videoPublishElement = nullptr;
- }
- }
fireConnectors();
}
--
Gitblit v1.8.0