[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(+)

Comments

Kieran Bingham July 10, 2025, 7:46 a.m. UTC | #1
Quoting Umang Jain (2025-07-01 12:29:22)
> 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>

From Robert, for Patchwork:

Tested-by: Robert Mader <robert.mader@collabora.com>

> ---
>  src/apps/lc-compliance/helpers/capture.cpp | 3 +++
>  1 file changed, 3 insertions(+)
> 
> 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";
> -- 
> 2.50.0
>

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";