From 0bb99bec91221dcfa633b75895858c92aa0ccddc Mon Sep 17 00:00:00 2001 From: fiss <2657262686@qq.com> Date: Thu, 31 Aug 2023 10:47:19 +0800 Subject: [PATCH] 恢复recode代码;删除无用变量 --- src/decoder/dvpp/FFRecoderTaskManager.cpp | 21 +++++++++++---------- src/decoder/dvpp/FFRecoderTaskManager.h | 9 --------- 2 files changed, 11 insertions(+), 19 deletions(-) diff --git a/src/decoder/dvpp/FFRecoderTaskManager.cpp b/src/decoder/dvpp/FFRecoderTaskManager.cpp index d83f1c1..f739c24 100644 --- a/src/decoder/dvpp/FFRecoderTaskManager.cpp +++ b/src/decoder/dvpp/FFRecoderTaskManager.cpp @@ -46,16 +46,16 @@ bool FFRecoderTaskManager::init(AVStream* stream, AVCodecContext* avctx){ m_avctx = avctx; m_inStream = stream; - // m_recoder_thread = new std::thread( - // [](void* arg) { - // FFRecoderTaskManager* _this=(FFRecoderTaskManager*)arg; - // if(_this != nullptr) { - // _this->recode_thread(); - // }else{ - // LOG_ERROR("recode 线程启动失败 !"); - // } - // return (void*)0; - // }, this); + m_recoder_thread = new std::thread( + [](void* arg) { + FFRecoderTaskManager* _this=(FFRecoderTaskManager*)arg; + if(_this != nullptr) { + _this->recode_thread(); + }else{ + LOG_ERROR("recode 线程启动失败 !"); + } + return (void*)0; + }, this); return true; } @@ -203,6 +203,7 @@ void FFRecoderTaskManager::recode_thread() { m_pkt_list_mtx.unlock(); string file_name = recoderinfo.recoderPath; + FFRecoder ffrecoder; bool bInit = ffrecoder.init(m_inStream, m_avctx, file_name.c_str()); if (!bInit) { diff --git a/src/decoder/dvpp/FFRecoderTaskManager.h b/src/decoder/dvpp/FFRecoderTaskManager.h index a0d44d4..44c8f3d 100644 --- a/src/decoder/dvpp/FFRecoderTaskManager.h +++ b/src/decoder/dvpp/FFRecoderTaskManager.h @@ -46,18 +46,12 @@ private: std::list m_keyframe_nb_list; std::list m_pkt_list; mutex m_pkt_list_mtx; - unsigned long long m_last_key_frame_nb; - - std::list m_intask_frame_nb_list; std::list m_recoderinfo_list; mutex m_recoderinfo_list_mtx; bool m_bExit{false}; - map m_id_recoderTask; - mutex m_task_creat_mtx; - AVRational m_time_base; AVCodecContext* m_avctx; AVStream* m_inStream; @@ -65,7 +59,4 @@ private: thread* m_recoder_thread{nullptr}; mq_callback_t mq_publish_func; - - std::list m_frame_list; - mutex m_frame_list_mtx; }; \ No newline at end of file -- libgit2 0.21.4