Initial esp_camera_available_frames implementation

This commit is contained in:
Pablo Garrido
2025-02-12 13:37:36 +01:00
parent 4467667b71
commit 59f1d083ea
4 changed files with 19 additions and 0 deletions

View File

@ -535,3 +535,8 @@ void cam_give_all(void) {
cam_obj->frames[x].en = 1;
}
}
bool cam_get_available_frames(void)
{
return 0 < uxQueueMessagesWaiting(cam_obj->frame_buffer_queue);
}

View File

@ -490,3 +490,10 @@ void esp_camera_return_all(void) {
cam_give_all();
}
bool esp_camera_available_frames(void)
{
if (s_state == NULL) {
return false;
}
return cam_get_available_frames();
}

View File

@ -240,6 +240,11 @@ esp_err_t esp_camera_load_from_nvs(const char *key);
*/
void esp_camera_return_all(void);
/**
* @brief Check if there are available frames to be immediately acquired
*/
bool esp_camera_available_frames(void);
#ifdef __cplusplus
}

View File

@ -57,6 +57,8 @@ void cam_give(camera_fb_t *dma_buffer);
void cam_give_all(void);
bool cam_get_available_frames(void);
#ifdef __cplusplus
}
#endif