Commit 0bb99bec91221dcfa633b75895858c92aa0ccddc

Authored by Hu Chunming
1 parent 3d1ce129

恢复recode代码;删除无用变量

src/decoder/dvpp/FFRecoderTaskManager.cpp
@@ -46,16 +46,16 @@ bool FFRecoderTaskManager::init(AVStream* stream, AVCodecContext* avctx){ @@ -46,16 +46,16 @@ bool FFRecoderTaskManager::init(AVStream* stream, AVCodecContext* avctx){
46 m_avctx = avctx; 46 m_avctx = avctx;
47 m_inStream = stream; 47 m_inStream = stream;
48 48
49 - // m_recoder_thread = new std::thread(  
50 - // [](void* arg) {  
51 - // FFRecoderTaskManager* _this=(FFRecoderTaskManager*)arg;  
52 - // if(_this != nullptr) {  
53 - // _this->recode_thread();  
54 - // }else{  
55 - // LOG_ERROR("recode 线程启动失败 !");  
56 - // }  
57 - // return (void*)0;  
58 - // }, this); 49 + m_recoder_thread = new std::thread(
  50 + [](void* arg) {
  51 + FFRecoderTaskManager* _this=(FFRecoderTaskManager*)arg;
  52 + if(_this != nullptr) {
  53 + _this->recode_thread();
  54 + }else{
  55 + LOG_ERROR("recode 线程启动失败 !");
  56 + }
  57 + return (void*)0;
  58 + }, this);
59 59
60 return true; 60 return true;
61 } 61 }
@@ -203,6 +203,7 @@ void FFRecoderTaskManager::recode_thread() { @@ -203,6 +203,7 @@ void FFRecoderTaskManager::recode_thread() {
203 m_pkt_list_mtx.unlock(); 203 m_pkt_list_mtx.unlock();
204 204
205 string file_name = recoderinfo.recoderPath; 205 string file_name = recoderinfo.recoderPath;
  206 +
206 FFRecoder ffrecoder; 207 FFRecoder ffrecoder;
207 bool bInit = ffrecoder.init(m_inStream, m_avctx, file_name.c_str()); 208 bool bInit = ffrecoder.init(m_inStream, m_avctx, file_name.c_str());
208 if (!bInit) { 209 if (!bInit) {
src/decoder/dvpp/FFRecoderTaskManager.h
@@ -46,18 +46,12 @@ private: @@ -46,18 +46,12 @@ private:
46 std::list<unsigned long long> m_keyframe_nb_list; 46 std::list<unsigned long long> m_keyframe_nb_list;
47 std::list<DataPacket*> m_pkt_list; 47 std::list<DataPacket*> m_pkt_list;
48 mutex m_pkt_list_mtx; 48 mutex m_pkt_list_mtx;
49 - unsigned long long m_last_key_frame_nb;  
50 -  
51 - std::list<unsigned long long> m_intask_frame_nb_list;  
52 49
53 std::list<RecoderInfo> m_recoderinfo_list; 50 std::list<RecoderInfo> m_recoderinfo_list;
54 mutex m_recoderinfo_list_mtx; 51 mutex m_recoderinfo_list_mtx;
55 52
56 bool m_bExit{false}; 53 bool m_bExit{false};
57 54
58 - map<string, thread*> m_id_recoderTask;  
59 - mutex m_task_creat_mtx;  
60 -  
61 AVRational m_time_base; 55 AVRational m_time_base;
62 AVCodecContext* m_avctx; 56 AVCodecContext* m_avctx;
63 AVStream* m_inStream; 57 AVStream* m_inStream;
@@ -65,7 +59,4 @@ private: @@ -65,7 +59,4 @@ private:
65 thread* m_recoder_thread{nullptr}; 59 thread* m_recoder_thread{nullptr};
66 60
67 mq_callback_t mq_publish_func; 61 mq_callback_t mq_publish_func;
68 -  
69 - std::list<DataFrame*> m_frame_list;  
70 - mutex m_frame_list_mtx;  
71 }; 62 };
72 \ No newline at end of file 63 \ No newline at end of file