[PATCH v3 4/8] libcamera: simple: Identify requested stream roles

Milan Zamazal mzamazal at redhat.com
Wed Mar 5 20:26:11 CET 2025


Currently, raw streams don't work in the simple pipeline and the
requested stream roles are ignored.  In order to support raw streams, we
now track in SimpleCameraData whether raw and/or processed streams are
requested.  We also check that at most one raw stream is requested,
there is no reason to have more.

That information will be used in the followup patches.

Signed-off-by: Milan Zamazal <mzamazal at redhat.com>
---
 src/libcamera/pipeline/simple/simple.cpp | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp
index c805639c..0c6e0f44 100644
--- a/src/libcamera/pipeline/simple/simple.cpp
+++ b/src/libcamera/pipeline/simple/simple.cpp
@@ -298,6 +298,8 @@ public:
 	};
 	std::queue<RequestOutputs> conversionQueue_;
 	bool useConversion_;
+	bool processedRequested_;
+	bool rawRequested_;
 
 	std::unique_ptr<Converter> converter_;
 	std::unique_ptr<SoftwareIsp> swIsp_;
@@ -1175,6 +1177,20 @@ SimplePipelineHandler::generateConfiguration(Camera *camera, Span<const StreamRo
 	if (roles.empty())
 		return config;
 
+	data->processedRequested_ = false;
+	data->rawRequested_ = false;
+	for (auto &role : roles)
+		if (role == StreamRole::Raw) {
+			if (data->rawRequested_) {
+				LOG(SimplePipeline, Error)
+					<< "Can't capture multiple raw streams";
+				return nullptr;
+			}
+			data->rawRequested_ = true;
+		} else {
+			data->processedRequested_ = true;
+		}
+
 	/* Create the formats map. */
 	std::map<PixelFormat, std::vector<SizeRange>> formats;
 
-- 
2.48.1



More information about the libcamera-devel mailing list