From 10545b6b7a4b5e24a9925a9f1644291f71280547 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Wed, 22 Feb 2023 21:49:06 +0100 Subject: [PATCH] camera: match resolutions close to 32x32 blocks (when re-using) --- device/camera/camera_output.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/device/camera/camera_output.c b/device/camera/camera_output.c index 17495a0..9e72899 100644 --- a/device/camera/camera_output.c +++ b/device/camera/camera_output.c @@ -12,9 +12,11 @@ #include "output/rtsp/rtsp.h" #include "output/output.h" +#define MATCH_ALIGN_SIZE 32 + static bool camera_output_matches_capture(buffer_list_t *capture, unsigned target_height, unsigned format) { - if (target_height && capture->fmt.height != target_height && capture->fmt.height != camera_rescaller_align_size(target_height)) { + if (target_height && (capture->fmt.height / MATCH_ALIGN_SIZE) != (target_height / MATCH_ALIGN_SIZE)) { return false; }