common/csi: Add post-processing op.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
This commit is contained in:
iabdalkader 2025-08-09 12:03:09 +02:00
parent 9112cf2aae
commit 1f1e2b59e9
2 changed files with 10 additions and 0 deletions

View File

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

View File

@ -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