<div dir="ltr"><div dir="ltr">Hi David,<div><br></div><div>Thank you for this fix!</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 3 Jan 2023 at 11:33, David Plowman via libcamera-devel <<a href="mailto:libcamera-devel@lists.libcamera.org">libcamera-devel@lists.libcamera.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">The intention is that the "main" colour space is the colour space of<br>
the largest non-raw stream. Unfortunately the use of "config_[i].size"<br>
is clearly incorrect, and has been copied from prior versions of the<br>
code. This small change merely corrects the error.<br>
<br>
Signed-off-by: David Plowman <<a href="mailto:david.plowman@raspberrypi.com" target="_blank">david.plowman@raspberrypi.com</a>><br></blockquote><div><br></div><div>Reviewed-by: Naushir Patuck <<a href="mailto:naush@raspberrypi.com">naush@raspberrypi.com</a>></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
---<br>
src/libcamera/camera.cpp | 6 ++++--<br>
1 file changed, 4 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp<br>
index 2d947a44..0da167a7 100644<br>
--- a/src/libcamera/camera.cpp<br>
+++ b/src/libcamera/camera.cpp<br>
@@ -361,6 +361,7 @@ CameraConfiguration::Status CameraConfiguration::validateColorSpaces(ColorSpaceF<br>
* largest non-raw stream with a defined color space (if there is one).<br>
*/<br>
std::optional<ColorSpace> colorSpace;<br>
+ Size size;<br>
<br>
for (auto [i, cfg] : utils::enumerate(config_)) {<br>
if (!cfg.colorSpace)<br>
@@ -369,9 +370,10 @@ CameraConfiguration::Status CameraConfiguration::validateColorSpaces(ColorSpaceF<br>
if (cfg.colorSpace->adjust(cfg.pixelFormat))<br>
status = Adjusted;<br>
<br>
- if (cfg.colorSpace != ColorSpace::Raw &&<br>
- (!colorSpace || cfg.size > config_[i].size))<br>
+ if (cfg.colorSpace != ColorSpace::Raw && cfg.size > size) {<br>
colorSpace = cfg.colorSpace;<br>
+ size = cfg.size;<br>
+ }<br>
}<br>
<br>
if (!colorSpace || !(flags & ColorSpaceFlag::StreamsShareColorSpace))<br>
-- <br>
2.30.2<br>
<br>
</blockquote></div></div>