File tree Expand file tree Collapse file tree 4 files changed +22
-0
lines changed
Expand file tree Collapse file tree 4 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -506,3 +506,9 @@ void cam_give(camera_fb_t *dma_buffer)
506506 }
507507 }
508508}
509+
510+ void cam_give_all (void ) {
511+ for (int x = 0 ; x < cam_obj -> frame_cnt ; x ++ ) {
512+ cam_obj -> frames [x ].en = 1 ;
513+ }
514+ }
Original file line number Diff line number Diff line change @@ -476,3 +476,11 @@ esp_err_t esp_camera_load_from_nvs(const char *key)
476476 return ret ;
477477 }
478478}
479+
480+ void esp_camera_return_all (void ) {
481+ if (s_state == NULL ) {
482+ return ;
483+ }
484+ cam_give_all ();
485+ }
486+
Original file line number Diff line number Diff line change @@ -231,6 +231,12 @@ esp_err_t esp_camera_save_to_nvs(const char *key);
231231 */
232232esp_err_t esp_camera_load_from_nvs (const char * key );
233233
234+ /**
235+ * @brief Return all frame buffers to be reused again.
236+ */
237+ void esp_camera_return_all (void );
238+
239+
234240#ifdef __cplusplus
235241}
236242#endif
Original file line number Diff line number Diff line change @@ -55,6 +55,8 @@ camera_fb_t *cam_take(TickType_t timeout);
5555
5656void cam_give (camera_fb_t * dma_buffer );
5757
58+ void cam_give_all (void );
59+
5860#ifdef __cplusplus
5961}
6062#endif
You can’t perform that action at this time.
0 commit comments