[libcamera-devel] [PATCH 2/2] libcamera: pipeline: vivid: Print diagnostic on configuration failure

Laurent Pinchart laurent.pinchart at ideasonboard.com
Tue Nov 3 16:37:24 CET 2020


Hi Kieran,

On Tue, Nov 03, 2020 at 03:32:47PM +0000, Kieran Bingham wrote:
> On 03/11/2020 13:30, Laurent Pinchart wrote:
> > In case the setFormat() call on the video device fails to match the
> > configuration, print both the requested and actual configurations to
> > ease debugging.
> 
> Sounds like it would be helpful. Again I'll add this to the vivid branch.
> 
> Sometime we should move that branch onto a repository at libcamera.org
> rather than my personal external repository - but we can deal with that
> later.

We have a public tree there, so it's whenever you're ready :-) We can
also create a specific tree for this purpose if you think that's best.

> Reviewed-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
> 
> > Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> > ---
> >  src/libcamera/pipeline/vivid/vivid.cpp | 7 ++++++-
> >  1 file changed, 6 insertions(+), 1 deletion(-)
> > 
> > diff --git a/src/libcamera/pipeline/vivid/vivid.cpp b/src/libcamera/pipeline/vivid/vivid.cpp
> > index bf8f82af981f..a0ccbd1e711e 100644
> > --- a/src/libcamera/pipeline/vivid/vivid.cpp
> > +++ b/src/libcamera/pipeline/vivid/vivid.cpp
> > @@ -181,8 +181,13 @@ int PipelineHandlerVivid::configure(Camera *camera, CameraConfiguration *config)
> >  		return ret;
> >  
> >  	if (format.size != cfg.size ||
> > -	    format.fourcc != data->video_->toV4L2PixelFormat(cfg.pixelFormat))
> > +	    format.fourcc != data->video_->toV4L2PixelFormat(cfg.pixelFormat)) {
> > +		LOG(VIVID, Error)
> > +			<< "Requested " << cfg.toString() << ", got "
> > +			<< format.size.toString() << "-"
> > +			<< format.fourcc.toString();
> >  		return -EINVAL;
> > +	}
> >  
> >  	/* Set initial controls specific to VIVID */
> >  	ControlList controls(data->video_->controls());

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list