video analysis2.0拆分,ffmpeg封装go接口库
zhangmeng
2021-07-30 8f44600c2e5d6141aebf49536a6ddbafc6c18d75
csrc/thirdparty/gb28181/include/PsToEs.hpp
@@ -109,13 +109,23 @@
      printf("GB28181API end!\n");
      // m_rtpQueue.clearAll();
      m_rtpQueue.clearAll([](frameBuffInfo *info){
         if (info){
         delete[] info->buff;
         delete info;
         }
      });
      deleteCamera();
   }
   bool pushInfo(unsigned char *data, int datalen) {
      while(m_rtpQueue.count_queue() > 120){
            auto p = m_rtpQueue.popNotWait();
            if (p){
                delete[] p->buff;
                delete p;
            }
        }
      frameBuffInfo *info = new frameBuffInfo();
      info->buff = new unsigned char[datalen];
@@ -155,6 +165,13 @@
            info->buff = new unsigned char[buffinfo->buffLen - len]{};
            memcpy(info->buff, buffinfo->buff + len, buffinfo->buffLen - len);
            while(_this->m_rtpQueue.count_queue() > 120){
                    auto p = _this->m_rtpQueue.popNotWait();
                    if (p){
                        delete[] p->buff;
                        delete p;
                    }
                }
//            printf("/帧长大于info->buffLen:%d\n", info->buffLen);
            _this->m_rtpQueue.push_front_one(info);
//            printf("/帧长大于info->buffLen\n");