Commit 5a84488ed79de16fb0848b984e376e5fc3acfd66

Authored by Hu Chunming
1 parent c9cf03be

添加农村事件开关

src/ai_platform/MultiSourceProcess.cpp
@@ -736,8 +736,6 @@ int CMultiSourceProcess::algorthim_vpt(vector<DeviceMemory*> vec_gpuMem){ @@ -736,8 +736,6 @@ int CMultiSourceProcess::algorthim_vpt(vector<DeviceMemory*> vec_gpuMem){
736 /* for pedestrian safety det. 行人安全分析算法模块 */ 736 /* for pedestrian safety det. 行人安全分析算法模块 */
737 // algorthim_pedestrian_safety(vpt_interest_task_id, vpt_interest_imgs,vptResult); 737 // algorthim_pedestrian_safety(vpt_interest_task_id, vpt_interest_imgs,vptResult);
738 738
739 - // 农村违法分析的快照缓存  
740 - m_snapshot_reprocessing->update_village_bestsnapshot(vec_vptMem, vptResult, deleteObjectID);  
741 // 逆行 739 // 逆行
742 algorthim_retrograde(vpt_interest_task_id, vec_vptMem, vptResult); 740 algorthim_retrograde(vpt_interest_task_id, vec_vptMem, vptResult);
743 retrograde_snapshot(vpt_interest_task_id, deleteObjectID); 741 retrograde_snapshot(vpt_interest_task_id, deleteObjectID);
@@ -745,6 +743,11 @@ int CMultiSourceProcess::algorthim_vpt(vector<DeviceMemory*> vec_gpuMem){ @@ -745,6 +743,11 @@ int CMultiSourceProcess::algorthim_vpt(vector<DeviceMemory*> vec_gpuMem){
745 algorthim_trespass(vpt_interest_task_id, vec_vptMem, vptResult, deleteObjectID); 743 algorthim_trespass(vpt_interest_task_id, vec_vptMem, vptResult, deleteObjectID);
746 trespass_snapshot(vpt_interest_task_id, deleteObjectID); 744 trespass_snapshot(vpt_interest_task_id, deleteObjectID);
747 745
  746 +// #endif
  747 +
  748 +#ifdef USE_VILLAGE
  749 + // 农村违法分析的快照缓存
  750 + m_snapshot_reprocessing->update_village_bestsnapshot(vec_vptMem, vptResult, deleteObjectID);
748 // 三轮车载人 751 // 三轮车载人
749 algorithm_tricycle_manned(vpt_interest_task_id, vec_vptMem, vptResult); 752 algorithm_tricycle_manned(vpt_interest_task_id, vec_vptMem, vptResult);
750 // 货车载人 753 // 货车载人
@@ -752,8 +755,7 @@ int CMultiSourceProcess::algorthim_vpt(vector<DeviceMemory*> vec_gpuMem){ @@ -752,8 +755,7 @@ int CMultiSourceProcess::algorthim_vpt(vector<DeviceMemory*> vec_gpuMem){
752 // 二轮车超员/未戴盔 755 // 二轮车超员/未戴盔
753 algorithm_motor_hs_process(vpt_interest_task_id, vec_vptMem, vptResult); 756 algorithm_motor_hs_process(vpt_interest_task_id, vec_vptMem, vptResult);
754 manned_snapshot(vpt_interest_task_id, vec_vptMem, deleteObjectID); 757 manned_snapshot(vpt_interest_task_id, vec_vptMem, deleteObjectID);
755 -  
756 -// #endif 758 +#endif
757 759
758 // if(vptResult.size() > 0){ 760 // if(vptResult.size() > 0){
759 // cout << vptResult[0].obj_count<< endl; 761 // cout << vptResult[0].obj_count<< endl;
src/decoder/dvpp/DvppDecoder.cpp
@@ -150,7 +150,9 @@ AVCodecContext* DvppDecoder::init_FFmpeg(FFDecConfig config){ @@ -150,7 +150,9 @@ AVCodecContext* DvppDecoder::init_FFmpeg(FFDecConfig config){
150 pix_fmt = (AVPixelFormat)codecpar->format; 150 pix_fmt = (AVPixelFormat)codecpar->format;
151 m_fps = av_q2d(stream ->avg_frame_rate); 151 m_fps = av_q2d(stream ->avg_frame_rate);
152 152
  153 +#ifdef USE_VILLAGE
153 m_recoderManager.init(stream, avctx); 154 m_recoderManager.init(stream, avctx);
  155 +#endif
154 156
155 LOG_INFO("[{}]- init ffmpeg success! input:{} frame_width:{} frame_height:{} fps:{} ", m_dec_name, input_file, frame_width, frame_height, m_fps); 157 LOG_INFO("[{}]- init ffmpeg success! input:{} frame_width:{} frame_height:{} fps:{} ", m_dec_name, input_file, frame_width, frame_height, m_fps);
156 158
@@ -397,7 +399,9 @@ void DvppDecoder::read_thread() { @@ -397,7 +399,9 @@ void DvppDecoder::read_thread() {
397 } 399 }
398 400
399 frame_nb++; 401 frame_nb++;
  402 +#ifdef USE_VILLAGE
400 m_recoderManager.cache_pkt(pkt, frame_nb); 403 m_recoderManager.cache_pkt(pkt, frame_nb);
  404 +#endif
401 405
402 m_pktQueue_mutex.lock(); 406 m_pktQueue_mutex.lock();
403 DataPacket* data_pkt = new DataPacket(); 407 DataPacket* data_pkt = new DataPacket();
src/decoder/dvpp/FFRecoderTaskManager.cpp
@@ -30,7 +30,7 @@ static bool is_key_frame(AVPacket *pkt) { @@ -30,7 +30,7 @@ static bool is_key_frame(AVPacket *pkt) {
30 } 30 }
31 31
32 FFRecoderTaskManager::FFRecoderTaskManager(){ 32 FFRecoderTaskManager::FFRecoderTaskManager(){
33 - 33 + m_recoder_thread = nullptr;
34 } 34 }
35 35
36 FFRecoderTaskManager::~FFRecoderTaskManager(){ 36 FFRecoderTaskManager::~FFRecoderTaskManager(){
src/demo/demo.cpp
@@ -743,8 +743,8 @@ void test_gpu(int gpuID){ @@ -743,8 +743,8 @@ void test_gpu(int gpuID){
743 743
744 744
745 // string task_id = createTask(handle, algor_vec, 3 + gpuID * 10); 745 // string task_id = createTask(handle, algor_vec, 3 + gpuID * 10);
746 - // string task_id1 = createTask(handle, algor_vec2, 5);  
747 - string task_id2 = createTask(handle, algor_vec, 1); 746 + string task_id1 = createTask(handle, algor_vec2, 5);
  747 + // string task_id2 = createTask(handle, algor_vec, 1);
748 748
749 // test_snapshot(handle); 749 // test_snapshot(handle);
750 750