From 5c6937bd141acb5bbf6ea190aaf10c5bc9a92325 Mon Sep 17 00:00:00 2001 From: iabdalkader Date: Mon, 5 Apr 2021 02:59:30 +0200 Subject: [PATCH] Remove update_jpeg_buffer arg. --- src/omv/imlib/framebuffer.c | 2 +- src/omv/imlib/framebuffer.h | 3 +-- src/omv/modules/py_fir.c | 2 +- src/omv/modules/py_image.c | 6 +++--- src/omv/modules/py_imageio.c | 2 +- src/omv/modules/py_sensor.c | 2 +- src/omv/ports/nrf/sensor.c | 2 +- src/omv/ports/stm32/sensor.c | 2 +- src/omv/sensors/lepton.c | 2 +- 9 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/omv/imlib/framebuffer.c b/src/omv/imlib/framebuffer.c index 9be467439..f42368736 100644 --- a/src/omv/imlib/framebuffer.c +++ b/src/omv/imlib/framebuffer.c @@ -113,7 +113,7 @@ static void initialize_jpeg_buf_from_image(image_t *img) } } -void framebuffer_update_jpeg_buffer(bool swapfb) +void framebuffer_update_jpeg_buffer() { static int overflow_count = 0; diff --git a/src/omv/imlib/framebuffer.h b/src/omv/imlib/framebuffer.h index 663e24e2b..7176b6989 100644 --- a/src/omv/imlib/framebuffer.h +++ b/src/omv/imlib/framebuffer.h @@ -74,8 +74,7 @@ void framebuffer_initialize_image(image_t *img); // Compress src image to the JPEG buffer if src is mutable, otherwise copy src to the JPEG buffer // if the src is JPEG and fits in the JPEG buffer, or encode and stream src image to the IDE if not. -// If src == NULL use main framebuffer as source image. -void framebuffer_update_jpeg_buffer(bool swapfb); +void framebuffer_update_jpeg_buffer(); // Set the framebuffer w, h and bpp. void framebuffer_set(int32_t w, int32_t h, int32_t bpp); diff --git a/src/omv/modules/py_fir.c b/src/omv/modules/py_fir.c index e971d93de..c75773eb6 100644 --- a/src/omv/modules/py_fir.c +++ b/src/omv/modules/py_fir.c @@ -1088,7 +1088,7 @@ mp_obj_t py_fir_snapshot(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) } if (copy_to_fb) { - framebuffer_update_jpeg_buffer(false); + framebuffer_update_jpeg_buffer(); } image_t dst_img; diff --git a/src/omv/modules/py_image.c b/src/omv/modules/py_image.c index 4993795c9..4d1861003 100644 --- a/src/omv/modules/py_image.c +++ b/src/omv/modules/py_image.c @@ -940,7 +940,7 @@ static mp_obj_t py_image_to(int bpp, const uint16_t *default_color_palette, bool } if (copy_to_fb && copy) { - framebuffer_update_jpeg_buffer(false); + framebuffer_update_jpeg_buffer(); } image_t dst_img; @@ -1205,7 +1205,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_KW(py_image_save_obj, 2, py_image_save); static mp_obj_t py_image_flush(mp_obj_t img_obj) { - framebuffer_update_jpeg_buffer(false); + framebuffer_update_jpeg_buffer(); return mp_const_none; } STATIC MP_DEFINE_CONST_FUN_OBJ_1(py_image_flush_obj, py_image_flush); @@ -6574,7 +6574,7 @@ mp_obj_t py_image_load_image(uint n_args, const mp_obj_t *args, mp_map_t *kw_arg } if (copy_to_fb) { - framebuffer_update_jpeg_buffer(false); + framebuffer_update_jpeg_buffer(); } return py_image_from_struct(&image); diff --git a/src/omv/modules/py_imageio.c b/src/omv/modules/py_imageio.c index b2b92f180..40ca91a0f 100644 --- a/src/omv/modules/py_imageio.c +++ b/src/omv/modules/py_imageio.c @@ -156,7 +156,7 @@ mp_obj_t py_imageio_read(uint n_args, const mp_obj_t *args, mp_map_t *kw_args) } if (copy_to_fb) { - framebuffer_update_jpeg_buffer(false); + framebuffer_update_jpeg_buffer(); } if (0) { diff --git a/src/omv/modules/py_sensor.c b/src/omv/modules/py_sensor.c index 8b772b41b..1df41e11a 100644 --- a/src/omv/modules/py_sensor.c +++ b/src/omv/modules/py_sensor.c @@ -100,7 +100,7 @@ static mp_obj_t py_sensor_shutdown(mp_obj_t enable) static mp_obj_t py_sensor_flush() { - framebuffer_update_jpeg_buffer(NULL); + framebuffer_update_jpeg_buffer(); return mp_const_none; } diff --git a/src/omv/ports/nrf/sensor.c b/src/omv/ports/nrf/sensor.c index 01dd177a5..9ef1eeab8 100644 --- a/src/omv/ports/nrf/sensor.c +++ b/src/omv/ports/nrf/sensor.c @@ -998,7 +998,7 @@ int sensor_snapshot(sensor_t *sensor, image_t *image, uint32_t flags) // Compress the framebuffer for the IDE preview, only if it's not the first frame, // the framebuffer is enabled and the image sensor does not support JPEG encoding. // Note: This doesn't run unless the IDE is connected and the framebuffer is enabled. - framebuffer_update_jpeg_buffer(false); + framebuffer_update_jpeg_buffer(); noInterrupts(); diff --git a/src/omv/ports/stm32/sensor.c b/src/omv/ports/stm32/sensor.c index d7c7b20e1..c6b5c6383 100644 --- a/src/omv/ports/stm32/sensor.c +++ b/src/omv/ports/stm32/sensor.c @@ -1282,7 +1282,7 @@ int sensor_snapshot(sensor_t *sensor, image_t *image, uint32_t flags) // Compress the framebuffer for the IDE preview, only if it's not the first frame, // the framebuffer is enabled and the image sensor does not support JPEG encoding. // Note: This doesn't run unless the IDE is connected and the framebuffer is enabled. - framebuffer_update_jpeg_buffer(false); + framebuffer_update_jpeg_buffer(); // Make sure the raw frame fits into the FB. It will be switched from RGB565 to BAYER // first to save space before being cropped until it fits. diff --git a/src/omv/sensors/lepton.c b/src/omv/sensors/lepton.c index 61baac338..c24593d1e 100644 --- a/src/omv/sensors/lepton.c +++ b/src/omv/sensors/lepton.c @@ -484,7 +484,7 @@ static int sensor_check_buffsize(sensor_t *sensor) static int snapshot(sensor_t *sensor, image_t *image, uint32_t flags) { - framebuffer_update_jpeg_buffer(false); + framebuffer_update_jpeg_buffer(); if (sensor_check_buffsize(sensor) == -1) { return -1;