pipeline: simple: Consider output sizes when choosing pipe config
When a converter or the software ISP is used, output sizes do not equal input sizes - they notably can be smaller. Previous to this patch only capture sizes were considered, in some cases resulting in configs with too small maximum output sizes being selected, such as 1912x1080 for stream sizes of 1920x1080. Check that the maximum output sizes are big enough instead, while continuing to minimize capture sizes. Closes: https://gitlab.freedesktop.org/camera/libcamera/-/issues/236 Signed-off-by: Robert Mader <robert.mader@collabora.com> Reviewed-by: Milan Zamazal <mzamazal@redhat.com> Acked-by: Umang Jain <uajain@igalia.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
committed by
Kieran Bingham
parent
48560d72cd
commit
94d32fdc55
@@ -1164,15 +1164,16 @@ CameraConfiguration::Status SimpleCameraConfiguration::validate()
|
||||
pipeConfig_ = nullptr;
|
||||
|
||||
for (const SimpleCameraData::Configuration *pipeConfig : *configs) {
|
||||
const Size &size = pipeConfig->captureSize;
|
||||
const Size &captureSize = pipeConfig->captureSize;
|
||||
const Size &maxOutputSize = pipeConfig->outputSizes.max;
|
||||
|
||||
if (size.width >= maxStreamSize.width &&
|
||||
size.height >= maxStreamSize.height) {
|
||||
if (!pipeConfig_ || size < pipeConfig_->captureSize)
|
||||
if (maxOutputSize.width >= maxStreamSize.width &&
|
||||
maxOutputSize.height >= maxStreamSize.height) {
|
||||
if (!pipeConfig_ || captureSize < pipeConfig_->captureSize)
|
||||
pipeConfig_ = pipeConfig;
|
||||
}
|
||||
|
||||
if (!maxPipeConfig || maxPipeConfig->captureSize < size)
|
||||
if (!maxPipeConfig || maxPipeConfig->captureSize < captureSize)
|
||||
maxPipeConfig = pipeConfig;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user