[libcamera-devel] [PATCH] pipeline: raspberrypi: Set sensor default orientation before configure()

Naushir Patuck naush at raspberrypi.com
Mon Aug 10 10:30:14 CEST 2020


Hi Laurent,

On Mon, 10 Aug 2020 at 06:38, Laurent Pinchart
<laurent.pinchart at ideasonboard.com> wrote:
>
> Hi Naush,
>
> On Fri, Aug 07, 2020 at 01:12:01PM +0100, Naushir Patuck wrote:
> > Hi all,
> >
> > Just a gentle ping for the below change to be submitted when you can.
>
> I know I have a fairly large backlog of RPi libcamera patches to review,
> I apologize about that, even more so as I will have very little time
> this week. I'll do my best and try to address as much of the backlog as
> possible on Thursday.

No problem at all :)

Regards,
Naush


>
> > On Tue, 21 Jul 2020 at 10:23, Naushir Patuck <naush at raspberrypi.com> wrote:
> > >
> > > The default sensor orientation must be set early on in match() to ensure
> > > generateConfiguration() and configure() return out the correct Bayer
> > > ordering to the application. This is particularly important for RAW
> > > capture streams.
> > >
> > > Signed-off-by: Naushir Patuck <naush at raspberrypi.com>
> > > ---
> > >  src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 14 +++++++-------
> > >  1 file changed, 7 insertions(+), 7 deletions(-)
> > >
> > > diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> > > index bf1c7714..e9084afd 100644
> > > --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> > > +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> > > @@ -962,6 +962,13 @@ bool PipelineHandlerRPi::match(DeviceEnumerator *enumerator)
> > >         /* Initialize the camera properties. */
> > >         data->properties_ = data->sensor_->properties();
> > >
> > > +       /* Configure the H/V flip controls based on the sensor rotation. */
> > > +       ControlList ctrls(data->unicam_[Unicam::Image].dev()->controls());
> > > +       int32_t rotation = data->properties_.get(properties::Rotation);
> > > +       ctrls.set(V4L2_CID_HFLIP, static_cast<int32_t>(!!rotation));
> > > +       ctrls.set(V4L2_CID_VFLIP, static_cast<int32_t>(!!rotation));
> > > +       data->unicam_[Unicam::Image].dev()->setControls(&ctrls);
> > > +
> > >         /*
> > >          * List the available output streams.
> > >          * Currently cannot do Unicam streams!
> > > @@ -1165,13 +1172,6 @@ int RPiCameraData::configureIPA()
> > >                                               { V4L2_CID_EXPOSURE, result.data[1] } });
> > >                         sensorMetadata_ = result.data[2];
> > >                 }
> > > -
> > > -               /* Configure the H/V flip controls based on the sensor rotation. */
> > > -               ControlList ctrls(unicam_[Unicam::Image].dev()->controls());
> > > -               int32_t rotation = sensor_->properties().get(properties::Rotation);
> > > -               ctrls.set(V4L2_CID_HFLIP, static_cast<int32_t>(!!rotation));
> > > -               ctrls.set(V4L2_CID_VFLIP, static_cast<int32_t>(!!rotation));
> > > -               unicam_[Unicam::Image].dev()->setControls(&ctrls);
> > >         }
> > >
> > >         if (result.operation & RPI_IPA_CONFIG_SENSOR) {
>
> --
> Regards,
>
> Laurent Pinchart


More information about the libcamera-devel mailing list