[libcamera-devel] [PATCH] libcamera: rkisp1: Generate configuration from main path if only one role

Paul Elder paul.elder at ideasonboard.com
Wed Jun 22 09:46:08 CEST 2022


The current logic for generating configurations assumes that we have
multiple roles. The consequence of this is that if only one role is
requested, and it is for viewfinder or recording, then the self path's
configuration generator would be used instead of the main path's. This
is what causes the default resolution on the rkisp1 pipeline handler to
be 1920x1920 (since it's the max resolution of the self path). Note that
the main path is still used for streaming, just that it is using self
path's default configuraion (if it isn't changed by the application).

This patch skips all the logic for determining which path to assign to
which role in the event that only one role is requested. In this case,
we simply generate the configuration from the math path. This makes the
default resolution for a single stream 2592x1944.

Signed-off-by: Paul Elder <paul.elder at ideasonboard.com>
---
 src/libcamera/pipeline/rkisp1/rkisp1.cpp | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
index 7cf36524..43b76e14 100644
--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp
+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
@@ -515,6 +515,16 @@ CameraConfiguration *PipelineHandlerRkISP1::generateConfiguration(Camera *camera
 	if (roles.empty())
 		return config;
 
+	if (roles.size() == 1) {
+		StreamConfiguration cfg = data->mainPath_->generateConfiguration(
+			data->sensor_->resolution());
+
+		config->addConfiguration(cfg);
+		config->validate();
+
+		return config;
+	}
+
 	bool mainPathAvailable = true;
 	bool selfPathAvailable = true;
 	for (const StreamRole role : roles) {
-- 
2.30.2



More information about the libcamera-devel mailing list