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

Niklas Söderlund niklas.soderlund at ragnatech.se
Wed Oct 21 13:39:15 CEST 2020


Hi Laurent,

Thanks for your work.

On 2020-10-21 03:24:18 +0300, Laurent Pinchart wrote:
> 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>

Reviewed-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>

> ---
>  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
> 
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel at lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel

-- 
Regards,
Niklas Söderlund


More information about the libcamera-devel mailing list