video analysis2.0拆分,ffmpeg封装go接口库
zhangmeng
2019-10-28 f2fb5eb58ae50bb35f2d0ae2673a596adc06cb00
csrc/thirdparty/gb28181/include/PsToEs.hpp
@@ -67,6 +67,16 @@
      while (!q.empty()) q.pop_front();
      pthread_mutex_unlock(&mtx);
    }
   void clearAll(std::function<void(T)> fn){
      pthread_mutex_lock(&mtx);
      while (!q.empty()){
         T value = q.front();
         fn(value);
         q.pop_front();
      }
      pthread_mutex_unlock(&mtx);
   }
private:
    deque<T> q;
    pthread_mutex_t mtx;
@@ -87,7 +97,11 @@
   ~GB28181API(){
      printf("GB28181API end!\n");
      m_rtpQueue.clearAll();
      // m_rtpQueue.clearAll();
      m_rtpQueue.clearAll([](frameBuffInfo *info){
         delete[] info->buff;
         delete info;
      });
      deleteCamera();
   }