[libcamera-devel] [PATCH v2 3/4] libcamera: pipeline: rpi: Adjust to new implementation

Laurent Pinchart laurent.pinchart at ideasonboard.com
Mon Jan 11 01:56:25 CET 2021


On Fri, Jan 08, 2021 at 12:32:33PM +0100, Jacopo Mondi wrote:
> Hi Sebastian
> 
> On Thu, Dec 31, 2020 at 04:53:35PM +0100, Sebastian Fricke wrote:
> > Remove the construction of a BayerFormat from a V4L2PixelFormat through
> > the old constructor. Add the new 'fromV4L2PixelFormat' static member
> > function.
> 
> Ah here you go. I would squash this in 1/4

Yes, otherwise it breaks bisection. Another option would be to have a
first patch that adds the new function, a second patch that updates the
RPi pipeline handler, and a third patch that removes the constructor.
Given that the change to the pipeline handler is small, it's not worth
splitting it in three patches.

> >
> > Signed-off-by: Sebastian Fricke <sebastian.fricke.linux at gmail.com>
> > ---
> >  src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> > index 7a5f5881..8ca9b9cf 100644
> > --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> > +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> > @@ -358,7 +358,7 @@ CameraConfiguration::Status RPiCameraConfiguration::validate()
> >  			 */
> >  			V4L2PixelFormat fourcc = sensorFormat.fourcc;
> >  			if (data_->flipsAlterBayerOrder_) {
> > -				BayerFormat bayer(fourcc);
> > +				BayerFormat bayer = BayerFormat::fromV4L2PixelFormat(fourcc);
> >  				bayer.order = data_->nativeBayerOrder_;
> >  				bayer = bayer.transform(combined);
> >  				fourcc = bayer.toV4L2PixelFormat();
> > @@ -1007,7 +1007,7 @@ bool PipelineHandlerRPi::match(DeviceEnumerator *enumerator)
> >  	BayerFormat bayerFormat;
> >  	for (const auto &iter : dev->formats()) {
> >  		V4L2PixelFormat v4l2Format = iter.first;
> > -		bayerFormat = BayerFormat(v4l2Format);
> > +		bayerFormat = BayerFormat::fromV4L2PixelFormat(v4l2Format);
> >  		if (bayerFormat.isValid())
> >  			break;
> >  	}

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list