[libcamera-devel] [PATCH v5 09/12] pipeline: raspberrypi: Validate OptionalStream in queueRequestDevice()
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Sun Jan 22 22:35:41 CET 2023
On Fri, Jan 20, 2023 at 11:11:32AM +0000, Kieran Bingham via libcamera-devel wrote:
> Quoting Naushir Patuck via libcamera-devel (2023-01-18 08:59:50)
> > Add some validation in queueRequestDevice() to ensure that a frame buffer is
> > provided in a Request if the MandatoryRequestBuffer flag has not been set in
> > the StreamConfiguration for every configured stream.
>
> I think this should be handled in the core. This shouldn't be pipeline
> specific. We mustn't have different behaviours in different pipelines.
Agreed. A test in lc-compliance would also be good.
> (That's why it's important we get this right globally)
>
> > Signed-off-by: Naushir Patuck <naush at raspberrypi.com>
> > ---
> > src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 7 +++++++
> > 1 file changed, 7 insertions(+)
> >
> > diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> > index 13d0ab4c4968..39f48e0a57fb 100644
> > --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> > +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> > @@ -1153,6 +1153,13 @@ int PipelineHandlerRPi::queueRequestDevice(Camera *camera, Request *request)
> > stream->setExternalBuffer(buffer);
> > }
> >
> > + if (!(stream->configuration().hints & StreamConfiguration::Hint::OptionalStream) &&
> > + !buffer) {
> > + LOG(RPI, Error) << "No buffer provided for mandatory stream "
> > + << stream->name();
> > + return -EINVAL;
> > + }
> > +
> > /*
> > * If no buffer is provided by the request for this stream, we
> > * queue a nullptr to the stream to signify that it must use an
--
Regards,
Laurent Pinchart
More information about the libcamera-devel
mailing list