[libcamera-devel] [PATCH v4 08/12] libcamera: camera: Refuse empty requests
Niklas Söderlund
niklas.soderlund at ragnatech.se
Sun Apr 14 22:08:44 CEST 2019
Hi Jacopo,
Thanks for your work.
On 2019-04-09 21:25:44 +0200, Jacopo Mondi wrote:
> Requests that do not contain any Stream should not be forwarded to
> the pipeline handlers. Return -EINVAL if the request does not contain
> any Stream to capture from.
>
> Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>
> ---
> src/libcamera/camera.cpp | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp
> index cb392ca3b7e7..bd73ff69c3da 100644
> --- a/src/libcamera/camera.cpp
> +++ b/src/libcamera/camera.cpp
> @@ -728,6 +728,7 @@ Request *Camera::createRequest()
> * \return 0 on success or a negative error code otherwise
> * \retval -ENODEV The camera has been disconnected from the system
> * \retval -EACCES The camera is not running so requests can't be queued
> + * \retval -EINVAL The request does not contain any stream to capture from
> */
> int Camera::queueRequest(Request *request)
> {
> @@ -743,6 +744,9 @@ int Camera::queueRequest(Request *request)
> return ret;
> }
>
> + if (request->empty())
> + return -EINVAL;
> +
Should this be moved inside Request::prepare() ?
> return pipe_->queueRequest(this, request);
> }
>
> --
> 2.21.0
>
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel at lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel
--
Regards,
Niklas Söderlund
More information about the libcamera-devel
mailing list