CameraBuf: avoid busy waiting on safe_queue (#20643)

* 20ms timeout

* Update camera_common.cc

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
albatross
Dean Lee 2021-04-12 07:49:38 +08:00 committed by GitHub
parent f98049a0ef
commit e562a69a4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

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");