[libcamera-devel] [PATCH v3 13/22] libcamera: pipeline_handler: Fatal if registering camera without media devices

Laurent Pinchart laurent.pinchart at ideasonboard.com
Sat Jul 4 23:21:25 CEST 2020


Hi Paul,

Thank you for the patch.

On Sat, Jul 04, 2020 at 10:31:31PM +0900, Paul Elder wrote:
> Pipeline handlers must acquire media devices via
> PipelineHander::acquireMediaDevice so that the media devices can be
> registered with the pipeline handler, so that they can be automatically
> added to the devnum map for the v4l2 compatibility layer to use. Die
> fatally if any camera trying to be registered has not acquired any media
> devices via acquireMediaDevice.
> 
> Signed-off-by: Paul Elder <paul.elder at ideasonboard.com>
> 
> ---
> No change in v3
> ---
>  src/libcamera/pipeline_handler.cpp | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp
> index de5ca09..8a6c9c2 100644
> --- a/src/libcamera/pipeline_handler.cpp
> +++ b/src/libcamera/pipeline_handler.cpp
> @@ -496,6 +496,10 @@ void PipelineHandler::registerCamera(std::shared_ptr<Camera> camera,
>  	cameraData_[camera.get()] = std::move(data);
>  	cameras_.push_back(camera);
>  
> +	if (!mediaDevices_.size())

	if (mediaDevices_.empty())

Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>

> +		LOG(Pipeline, Fatal)
> +			<< "Registering camera with no media devices!";
> +
>  	/*
>  	 * Walk the entity list and map the devnums of all capture video nodes
>  	 * to the camera.

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list