diff --git a/common/omv_csi.c b/common/omv_csi.c index a7cd05ec0..ed722da75 100644 --- a/common/omv_csi.c +++ b/common/omv_csi.c @@ -1607,6 +1607,11 @@ __weak int omv_csi_snapshot(omv_csi_t *csi, image_t *image, uint32_t flags) { } #endif + // Call the sensor specific post-process. + if (ret == 0 && csi->post_process && !(flags & OMV_CSI_FLAG_NO_POST)) { + ret = csi->post_process(csi, image, flags); + } + if (ret == 0) { // Mark this buffer to be released on the next call. buffer = framebuffer_acquire(csi->fb, FB_FLAG_USED | FB_FLAG_PEEK); diff --git a/common/omv_csi.h b/common/omv_csi.h index d9c73c069..5bc838bd1 100644 --- a/common/omv_csi.h +++ b/common/omv_csi.h @@ -194,6 +194,7 @@ typedef enum { typedef enum { OMV_CSI_FLAG_UPDATE_FB = (1 << 0), OMV_CSI_FLAG_NON_BLOCK = (1 << 1), + OMV_CSI_FLAG_NO_POST = (1 << 2), OMV_CSI_FLAG_IOCTL_ABORT = (1 << 8), } omv_csi_flags_t; @@ -289,6 +290,9 @@ typedef struct _omv_csi_callback_t { typedef int (*omv_csi_snapshot_t) (omv_csi_t *csi, image_t *image, uint32_t flags); +typedef int (*omv_csi_post_process_t) + (omv_csi_t *csi, image_t *image, uint32_t flags); + typedef struct _omv_clk omv_clk_t; typedef struct _omv_clk { @@ -398,6 +402,7 @@ typedef struct _omv_csi { int (*config) (omv_csi_t *csi, omv_csi_config_t config); int (*abort) (omv_csi_t *csi, bool fifo_flush, bool in_irq); int (*snapshot) (omv_csi_t *csi, image_t *image, uint32_t flags); + int (*post_process) (omv_csi_t *csi, image_t *image, uint32_t flags); } omv_csi_t; // CSI array