Commit e24744056584c15ceb100484af44f5ceeff56a4a
1 parent
936f5977
修复traffic_light 卡死导致显存暴增问题
Showing
2 changed files
with
27 additions
and
13 deletions
src/ai_platform/MultiSourceProcess.cpp
@@ -1533,8 +1533,10 @@ void CMultiSourceProcess::algorithm_traffic_light_process(vector<string>& vpt_in | @@ -1533,8 +1533,10 @@ void CMultiSourceProcess::algorithm_traffic_light_process(vector<string>& vpt_in | ||
1533 | algor_map->find(algorithm_type_t::NONMOTOR_RUNNING_REDLIGHTS) != algor_map->end()) { | 1533 | algor_map->find(algorithm_type_t::NONMOTOR_RUNNING_REDLIGHTS) != algor_map->end()) { |
1534 | 1534 | ||
1535 | m_RoadSegTaskMtx.lock(); | 1535 | m_RoadSegTaskMtx.lock(); |
1536 | - if (!m_RoadSegTaskMap[task_id].isseg) continue; | ||
1537 | - else { | 1536 | + if (!m_RoadSegTaskMap[task_id].isseg){ |
1537 | + m_RoadSegTaskMtx.unlock(); | ||
1538 | + continue; | ||
1539 | + } else { | ||
1538 | interest_traffic_region.push_back(m_RoadSegTaskMap[task_id].traffic_region); | 1540 | interest_traffic_region.push_back(m_RoadSegTaskMap[task_id].traffic_region); |
1539 | interest_labels.push_back(m_RoadSegTaskMap[task_id].labels); | 1541 | interest_labels.push_back(m_RoadSegTaskMap[task_id].labels); |
1540 | } | 1542 | } |
@@ -1601,17 +1603,16 @@ void CMultiSourceProcess::algorithm_roadseg_correlation_process(vector<string>& | @@ -1601,17 +1603,16 @@ void CMultiSourceProcess::algorithm_roadseg_correlation_process(vector<string>& | ||
1601 | } | 1603 | } |
1602 | m_RoadSegTaskMtx.unlock(); | 1604 | m_RoadSegTaskMtx.unlock(); |
1603 | 1605 | ||
1604 | - | ||
1605 | - sy_img img; | ||
1606 | - img.w_ = mem->getWidth(); | ||
1607 | - img.h_ = mem->getHeight(); | ||
1608 | - img.c_ = mem->getChannel(); | ||
1609 | - img.data_ = mem->getMem(); | ||
1610 | - sy_interest_imgs.push_back(img); | ||
1611 | - | ||
1612 | - interest_task_id.emplace_back(task_id); | ||
1613 | - interest_imgs.emplace_back(vpt_interest_imgs[i]); | ||
1614 | - interest_vpt_result.emplace_back(vptResult[i]); | 1606 | + sy_img img; |
1607 | + img.w_ = mem->getWidth(); | ||
1608 | + img.h_ = mem->getHeight(); | ||
1609 | + img.c_ = mem->getChannel(); | ||
1610 | + img.data_ = mem->getMem(); | ||
1611 | + sy_interest_imgs.push_back(img); | ||
1612 | + | ||
1613 | + interest_task_id.emplace_back(task_id); | ||
1614 | + interest_imgs.emplace_back(vpt_interest_imgs[i]); | ||
1615 | + interest_vpt_result.emplace_back(vptResult[i]); | ||
1615 | } | 1616 | } |
1616 | } | 1617 | } |
1617 | 1618 |
src/decoder/dvpp/DvppDecoder.cpp
@@ -804,6 +804,19 @@ void DvppDecoder::doVdppVdecCallBack(acldvppStreamDesc *input, acldvppPicDesc *o | @@ -804,6 +804,19 @@ void DvppDecoder::doVdppVdecCallBack(acldvppStreamDesc *input, acldvppPicDesc *o | ||
804 | break; | 804 | break; |
805 | } | 805 | } |
806 | 806 | ||
807 | + if (m_bReal) { | ||
808 | + // 实时流缓存长度大于25时做丢帧处理 | ||
809 | + m_decoded_data_queue_mtx.lock(); | ||
810 | + if(m_decoded_data_queue.size() >= 25){ | ||
811 | + m_decoded_data_queue_mtx.unlock(); | ||
812 | + LOG_WARN("[{}]- m_decoded_data_queue >= 25 ", m_dec_name); | ||
813 | + acldvppFree(outputDataDev); | ||
814 | + outputDataDev = nullptr; | ||
815 | + break; | ||
816 | + } | ||
817 | + m_decoded_data_queue_mtx.unlock(); | ||
818 | + } | ||
819 | + | ||
807 | bool bCached = false; | 820 | bool bCached = false; |
808 | if(width > 0 && height > 0 && outputSize > 0){ | 821 | if(width > 0 && height > 0 && outputSize > 0){ |
809 | 822 |