Skip to content

Commit

Permalink
修复mp4录制模块未丢弃锁导致卡顿的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
lam2003 committed May 15, 2019
1 parent 6d52cfd commit b8ac736
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
7 changes: 5 additions & 2 deletions monitor/record/mp4_record.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,19 +117,22 @@ void MP4RecordImpl::RecordThread()

if (RecordNeedToQuit())
{
lock.unlock();
muxer.Close();
init = false;
while (run_ && RecordNeedToQuit())
usleep(500000); //500ms
}
else if (RecordNeedToSegment(start_time))
{
lock.unlock();
muxer.Close();
init = false;
}

if (run_ && init_)
else if (run_)
{
cond_.wait(lock);
}
}
muxer.Close();
}
Expand Down
1 change: 1 addition & 0 deletions monitor/video_detect/video_detect_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ void VideoDetectImpl::OnFrame(const VIDEO_FRAME_INFO_S &frame)

ccbloc = (IVE_CCBLOB_S *)(dst_mem_info_.pu8VirAddr);

log_d("move objs num:%d,trigger thresh:%d", ccbloc->u8RegionNum, trigger_thresh_);
mux_.lock();
if (ccbloc->u8RegionNum >= trigger_thresh_ && listener_)
listener_->OnTrigger(ccbloc->u8RegionNum);
Expand Down
2 changes: 1 addition & 1 deletion monitor/video_process/video_process_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ int32_t VideoProcessImpl::StartVPSSDetectChn(const Params &params)
VPSS_CHN_ATTR_S chn_attr;
memset(&chn_attr, 0, sizeof(chn_attr));
chn_attr.s32SrcFrameRate = FRAME_RATE;
chn_attr.s32DstFrameRate = params.frame_rate;
chn_attr.s32DstFrameRate = 5;

ret = HI_MPI_VPSS_SetChnAttr(NVR_VPSS_GRP, NVR_VPSS_DETECT_CHN, &chn_attr);
if (HI_SUCCESS != ret)
Expand Down

0 comments on commit b8ac736

Please sign in to comment.