[libcamera-devel] [PATCH v4 09/12] pipeline: raspberrypi: Validate MandatoryRequestBuffer in queueRequestDevice()
Naushir Patuck
naush at raspberrypi.com
Fri Dec 9 10:00:47 CET 2022
Add some validation in queueRequestDevice() to ensure that a frame buffer is
provided in a Request if the MandatoryRequestBuffer flag has been set in
the StreamConfiguration for every configured stream.
Signed-off-by: Naushir Patuck <naush at raspberrypi.com>
---
src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
index 45e66839efb9..2c2b79fa021d 100644
--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
@@ -1152,6 +1152,14 @@ int PipelineHandlerRPi::queueRequestDevice(Camera *camera, Request *request)
stream->setExternalBuffer(buffer);
}
+ if (!buffer && (stream->configuration().hints &
+ StreamConfiguration::Hint::MandatoryRequestBuffer)) {
+ LOG(RPI, Error) << "MandatoryRequestBuffer hint set for stream "
+ << stream->name()
+ << ", but no request buffer provided";
+ 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
--
2.25.1
More information about the libcamera-devel
mailing list