Skip to content

Commit

Permalink
Limit color frame queue size to prevent over memory use
Browse files Browse the repository at this point in the history
  • Loading branch information
jian-dong committed Dec 10, 2024
1 parent 9ad8fa1 commit f103c74
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions orbbec_camera/src/ob_camera_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1785,6 +1785,9 @@ void OBCameraNode::onNewFrameSetCallback(std::shared_ptr<ob::FrameSet> frame_set
if (enable_stream_[COLOR] && color_frame) {
std::unique_lock<std::mutex> lock(color_frame_queue_lock_);
if (!enable_3d_reconstruction_mode_ || depth_laser_status) {
if(color_frame_queue_.size() > 2) {
color_frame_queue_.pop();
}
color_frame_queue_.push(frame_set);
color_frame_queue_cv_.notify_all();
}
Expand Down

0 comments on commit f103c74

Please sign in to comment.