CameraBuf: avoid busy waiting on safe_queue (#20643)

* 20ms timeout

* Update camera_common.cc

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: e562a69a4d6e1669aebdc24386f170a5a27b5f95
This commit is contained in:
Dean Lee
2021-04-12 07:49:38 +08:00
committed by GitHub
parent a2cd7bfdeb
commit 56d306c03b

View File

@@ -105,7 +105,7 @@ CameraBuf::~CameraBuf() {
}
bool CameraBuf::acquire() {
if (!safe_queue.try_pop(cur_buf_idx, 1)) return false;
if (!safe_queue.try_pop(cur_buf_idx, 50)) return false;
if (camera_bufs_metadata[cur_buf_idx].frame_id == -1) {
LOGE("no frame data? wtf");