From 93f44a10e2e8942e57e62bb210a2ca7d206a51b7 Mon Sep 17 00:00:00 2001
From: zhangmeng <775834166@qq.com>
Date: 星期二, 24 九月 2019 11:26:44 +0800
Subject: [PATCH] add rec audio;

---
 csrc/worker/decoder.hpp |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/csrc/worker/decoder.hpp b/csrc/worker/decoder.hpp
index 0f3f76a..3bb3a18 100644
--- a/csrc/worker/decoder.hpp
+++ b/csrc/worker/decoder.hpp
@@ -5,12 +5,19 @@
 #include <memory>
 #include <list>
 #include <mutex>
+#include <thread>
+#include <atomic>
+#include <condition_variable>
+
+#include "../common.hpp"
+
+struct AVFrame;
 
 namespace ffwrapper
 {
     class FormatIn;
     class cvbridge;
-    class CodedData;
+
 } // namespace ffwrapper
 
 namespace cffmpeg_wrap
@@ -34,9 +41,17 @@
         std::list<BGR24> list_pic_;
         std::mutex mutex_pic_;
 
+        std::unique_ptr<std::thread> thread_;
+        std::atomic_bool    stop_;
+
+        std::list<CPacket> list_pkt_;
+        std::mutex mutex_pkt_;
+     	std::condition_variable cv_;
     private:
         int initDecoder();
+        int saveFrame(AVFrame *frame, int64_t &id);
     public: 
+        void Start();
         int SetFrame(std::shared_ptr<ffwrapper::CodedData> data, int64_t &id);
         void GetFrame(unsigned char **data, int *w, int *h, int64_t *id);
     public:

--
Gitblit v1.8.0