[libcamera-devel] [PATCH/RFC 12/12] cam: Validate camera configuration
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Sat May 18 01:06:21 CEST 2019
From: Niklas Söderlund <niklas.soderlund at ragnatech.se>
Use CameraConfiguration::validate() to validate and possibly update the
stream formats before configuring a camera.
Signed-off-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>
---
src/cam/main.cpp | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/cam/main.cpp b/src/cam/main.cpp
index a962f94c8f59..91785b7fea31 100644
--- a/src/cam/main.cpp
+++ b/src/cam/main.cpp
@@ -140,6 +140,18 @@ static CameraConfiguration *prepareCameraConfig()
cfg.pixelFormat = conf["pixelformat"];
}
+ switch (config->validate()) {
+ case CameraConfiguration::Valid:
+ break;
+ case CameraConfiguration::Adjusted:
+ std::cout << "Adjusted request format" << std::endl;
+ break;
+ case CameraConfiguration::Invalid:
+ delete config;
+ config = nullptr;
+ break;
+ }
+
return config;
}
--
Regards,
Laurent Pinchart
More information about the libcamera-devel
mailing list