[v2,2/2] lc-compliance: Ensure stream's colorspace is set after validate()
diff mbox series

Message ID 20250701112922.62285-3-uajain@igalia.com
State New
Headers show
Series
  • lc-compliance: Ensure stream's colorspace is set after validate()
Related show

Commit Message

Umang Jain July 1, 2025, 11:29 a.m. UTC
StreamConfiguration::colorspace is a std::optional<> and if unset by
the user, it should be populated by the pipeline handler after the
CameraConfiguration::validate().

Add a EXPECT_TRUE() check to ensure that each stream in the
CameraConfiguration has a colorspace set.

Signed-off-by: Umang Jain <uajain@igalia.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
 src/apps/lc-compliance/helpers/capture.cpp | 3 +++
 1 file changed, 3 insertions(+)

Patch
diff mbox series

diff --git a/src/apps/lc-compliance/helpers/capture.cpp b/src/apps/lc-compliance/helpers/capture.cpp
index 2a3fa3b6..e767e45e 100644
--- a/src/apps/lc-compliance/helpers/capture.cpp
+++ b/src/apps/lc-compliance/helpers/capture.cpp
@@ -52,6 +52,9 @@  void Capture::configure(libcamera::Span<const libcamera::StreamRole> roles)
 		FAIL() << "Configuration not valid";
 	}
 
+	for (auto &cfg : *config_)
+		EXPECT_TRUE(cfg.colorSpace) << cfg << " - colorspace not set.";
+
 	if (camera_->configure(config_.get())) {
 		config_.reset();
 		FAIL() << "Failed to configure camera";