Browse Source

Initial esp_camera_available_frames implementation

pull/723/head
Pablo Garrido 5 months ago
parent
commit
59f1d083ea
No known key found for this signature in database
GPG Key ID: 37D74C7E8C6361A5
  1. 5
      driver/cam_hal.c
  2. 7
      driver/esp_camera.c
  3. 5
      driver/include/esp_camera.h
  4. 2
      driver/private_include/cam_hal.h

5
driver/cam_hal.c

@ -535,3 +535,8 @@ void cam_give_all(void) { @@ -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);
}

7
driver/esp_camera.c

@ -490,3 +490,10 @@ void esp_camera_return_all(void) { @@ -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();
}

5
driver/include/esp_camera.h

@ -240,6 +240,11 @@ esp_err_t esp_camera_load_from_nvs(const char *key); @@ -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
}

2
driver/private_include/cam_hal.h

@ -57,6 +57,8 @@ void cam_give(camera_fb_t *dma_buffer); @@ -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

Loading…
Cancel
Save