From 25928e3093a7c0257128192d7785ec3f74e89e81 Mon Sep 17 00:00:00 2001
From: pans <pansen626@sina.com>
Date: 星期六, 30 三月 2019 12:46:20 +0800
Subject: [PATCH] 添加注释

---
 QiaoJiaSystem/GB28181DecoderModel/FFmpegDecoderJPG.cpp |   19 ++++++++++++-------
 1 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/QiaoJiaSystem/GB28181DecoderModel/FFmpegDecoderJPG.cpp b/QiaoJiaSystem/GB28181DecoderModel/FFmpegDecoderJPG.cpp
index 7fa85cd..0cfd3b4 100644
--- a/QiaoJiaSystem/GB28181DecoderModel/FFmpegDecoderJPG.cpp
+++ b/QiaoJiaSystem/GB28181DecoderModel/FFmpegDecoderJPG.cpp
@@ -45,7 +45,9 @@
 }
 
 BASICGB28181::FFmpegDecoderJPG::~FFmpegDecoderJPG() {
+    //娓呯┖闃熷垪
     while (m_rtpQueue.count_queue()) {
+        //#todo delete frameBuffInfo*
         m_rtpQueue.popNotWait();
     }
 
@@ -75,10 +77,9 @@
     }
 
 #ifdef TestCode
-        DBG(" m_rtpQueue.push before ");
+        DBG(" m_rtpQueue.push befores ");
 #endif
-        m_rtpQueue.
-        push(info);
+        m_rtpQueue.push(info);
 #ifdef TestCode
         DBG(" m_rtpQueue.push after ");
 #endif
@@ -96,10 +97,11 @@
     do {
 
 //        DBG(" m_rtpQueue.pop before ");
+        //浠庣紦瀛樹腑鑾峰彇buffinfo
         frameBuffInfo *buffinfo = fFmpegDecoderJPG->m_rtpQueue.pop();
 //        DBG(" m_rtpQueue.pop after ");
         diff = len - buffinfo->buffLen;
-//        printf("bufsize is :%ld,len is :%ld, datalen:%d \n", bufsize, len, buffinfo->buffLen);
+
         //甯ч暱澶т簬bufsize
         if (diff < 0) {
 //            DBG("/甯ч暱澶т簬bufsize" << diff);
@@ -130,7 +132,7 @@
         delete[] buffinfo->buff;
         delete buffinfo;
     } while (diff > 0);
-    //#todo 瑙﹀彂淇″彿
+
 //    DBG("emitSigal(\"read_dataOk\") begin");
 //    gSignalLock.emitSigal("read_dataOk");
     fFmpegDecoderJPG->m_readData = true;
@@ -151,12 +153,14 @@
 //    avformat_network_init();
         p_this->ic = avformat_alloc_context();
 
+        //鍒涘缓ffmpeg浣跨敤鐨勫唴瀛樼┖闂�
         p_this->iobuffer = (unsigned char *) av_malloc(p_this->m_buf_size);
         if (!p_this->iobuffer) {
             ERR("av_malloc: err======" << p_this->m_camIdx);
             p_this->m_running = false;
             continue;
         }
+//     浣跨敤鍥炶皟鍑芥暟鍜屽唴瀛樺潡鍒涘缓 AVIOContext
         p_this->avio = avio_alloc_context(p_this->iobuffer, p_this->m_buf_size, 0, p_this, p_this->read_data, NULL,
                                           NULL);
         if (!p_this->avio) {
@@ -267,7 +271,7 @@
 
 //        BASICGB28181::avframe_to_cvmat(frame).copyTo(p_this->m_image);
             p_this->m_image = std::move(BASICGB28181::avframe_to_cvmat(p_this->frame));
-
+//            灏唅甯т繚瀛樹负蹇収
             if (p_this->m_SnapshotNotSaveRet && (p_this->pkt.flags & AV_PKT_FLAG_KEY)) {
                 try {
                     std::string strNewName = "./";
@@ -304,7 +308,7 @@
 #ifdef TestCode
                 DBG("emitSigal(\"DecoderImageOK\") begin");
 #endif
-            //瑙﹀彂淇″彿
+            //瑙﹀彂涓婂眰淇″彿
             gSignalLock.emitSigal(p_this->m_camIdx + "DecoderImageOK");
 //#ifdef TestCode
 //        DBG("emitSigal(\"DecoderImageOK\") after");
@@ -349,6 +353,7 @@
         }
         m_camIdx = camIdx;
         DBG("BareFlowDecoderThd camIdx : " << camIdx);
+//        鍚姩瑙g爜绾跨▼
         std::thread t_BareFlowDecoder(BareFlowDecoderThd, this);
         t_BareFlowDecoder.detach();
     );

--
Gitblit v1.8.0