2024-07-28 18:58:22 +02:00
|
|
|
From 06add438e4fc53faca6e016bd582df0e7ac5a271 Mon Sep 17 00:00:00 2001
|
2024-03-17 15:11:22 +01:00
|
|
|
From: Hans de Goede <hdegoede@redhat.com>
|
|
|
|
Date: Wed, 24 Jan 2024 20:44:29 +0100
|
2024-07-28 18:58:22 +02:00
|
|
|
Subject: [PATCH 3/3] libcamera: debayer_cpu: Make the minimum size 1280x720
|
2024-03-17 15:11:22 +01:00
|
|
|
|
|
|
|
pipewire + firefox default to what looks like 640x480 if we export
|
|
|
|
the entire supported cropping range. Hardcode 720p as minsize for now.
|
|
|
|
|
|
|
|
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
|
|
---
|
|
|
|
src/libcamera/software_isp/debayer_cpu.cpp | 15 +++++++++++----
|
|
|
|
1 file changed, 11 insertions(+), 4 deletions(-)
|
|
|
|
|
|
|
|
diff --git a/src/libcamera/software_isp/debayer_cpu.cpp b/src/libcamera/software_isp/debayer_cpu.cpp
|
2024-07-28 18:58:22 +02:00
|
|
|
index 10ea29b1..a354138b 100644
|
2024-03-17 15:11:22 +01:00
|
|
|
--- a/src/libcamera/software_isp/debayer_cpu.cpp
|
|
|
|
+++ b/src/libcamera/software_isp/debayer_cpu.cpp
|
2024-07-28 18:58:22 +02:00
|
|
|
@@ -805,10 +805,17 @@ SizeRange DebayerCpu::sizes(PixelFormat inputFormat, const Size &inputSize)
|
2024-03-17 15:11:22 +01:00
|
|
|
return {};
|
|
|
|
}
|
|
|
|
|
2024-07-28 18:58:22 +02:00
|
|
|
- return SizeRange(Size(patternSize.width, patternSize.height),
|
|
|
|
- Size((inputSize.width - 2 * patternSize.width) & ~(patternSize.width - 1),
|
|
|
|
- (inputSize.height - 2 * borderHeight) & ~(patternSize.height - 1)),
|
|
|
|
- patternSize.width, patternSize.height);
|
2024-03-17 15:11:22 +01:00
|
|
|
+ /*
|
|
|
|
+ * pipewire + firefox default to what looks like 640x480
|
|
|
|
+ * if we export the entire supported cropping range.
|
|
|
|
+ * Hardcode 720p as minsize for now. Minsize should be
|
2024-07-28 18:58:22 +02:00
|
|
|
+ * Size(patternSize.width, patternSize.height)
|
2024-03-17 15:11:22 +01:00
|
|
|
+ */
|
2024-07-28 18:58:22 +02:00
|
|
|
+ unsigned int w = (inputSize.width - 2 * patternSize.width) & ~(patternSize.width - 1);
|
|
|
|
+ unsigned int h = (inputSize.height - 2 * patternSize.height) & ~(patternSize.height - 1);
|
2024-03-17 15:11:22 +01:00
|
|
|
+ return SizeRange(Size(std::min(w, 1280u), std::min(h, 720u)),
|
|
|
|
+ Size(w, h),
|
2024-07-28 18:58:22 +02:00
|
|
|
+ patternSize.width, patternSize.height);
|
2024-03-17 15:11:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
} /* namespace libcamera */
|
|
|
|
--
|
2024-07-28 18:58:22 +02:00
|
|
|
2.45.2
|
2024-03-17 15:11:22 +01:00
|
|
|
|