[libcamera-devel] [PATCH 2/2] libcamera: pipeline: simple: Set format on sink pad during propagation

Laurent Pinchart laurent.pinchart at ideasonboard.com
Wed Oct 21 02:24:18 CEST 2020


When propagating formats through the media controller pipeline, the
simple pipeline handler retrieves the format on sink pads and sets it on
source pads. This assumes that subdevs will propagate formats
internally, as required by the V4L2 subdev API. However, in some cases,
propagation isn't properly handled by the subdev driver.

When can work around this issue by setting the format on source pads
instead of getting it. This will have the effect of trying to propgate
the same format through the pipeline, possibly overriding the default
format propagated by subdev drivers. It will however not cause the
pipeline configuration to be invalid, as subdevs are required to
constraint the format set on their sources based on the configuration of
the sources, and this requirement is better implemented in kernel driver
than the format propagation requirement.

Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
---
 src/libcamera/pipeline/simple/simple.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp
index 4b6f708e8fee..45ecefc59851 100644
--- a/src/libcamera/pipeline/simple/simple.cpp
+++ b/src/libcamera/pipeline/simple/simple.cpp
@@ -386,7 +386,7 @@ int SimpleCameraData::setupFormats(V4L2SubdeviceFormat *format,
 
 		if (source->entity() != sensor_->entity()) {
 			V4L2Subdevice *subdev = pipe->subdev(source->entity());
-			ret = subdev->getFormat(source->index(), format, whence);
+			ret = subdev->setFormat(source->index(), format, whence);
 			if (ret < 0)
 				return ret;
 		}
-- 
Regards,

Laurent Pinchart



More information about the libcamera-devel mailing list