[PATCH v1 3/3] libcamera: pipeline: virtual: Set `FrameError` on error
Kieran Bingham
kieran.bingham at ideasonboard.com
Mon Feb 3 12:06:15 CET 2025
Quoting Barnabás Pőcze (2025-02-03 10:43:34)
> Do not cancel, simply set the buffer's status to `FrameError`
> to notify the user about the error condition.
>
> Signed-off-by: Barnabás Pőcze <pobrn at protonmail.com>
> ---
> src/libcamera/pipeline/virtual/virtual.cpp | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/libcamera/pipeline/virtual/virtual.cpp b/src/libcamera/pipeline/virtual/virtual.cpp
> index 1a75f35aa..cbba08c82 100644
> --- a/src/libcamera/pipeline/virtual/virtual.cpp
> +++ b/src/libcamera/pipeline/virtual/virtual.cpp
> @@ -322,7 +322,7 @@ int PipelineHandlerVirtual::queueRequestDevice([[maybe_unused]] Camera *camera,
>
> if (streamConfig.frameGenerator->generateFrame(
> stream->configuration().size, buffer))
> - buffer->_d()->cancel();
> + fmd.status = FrameMetadata::Status::FrameError;
I think this sounds right. I always worry we don't handle frame buffers
correctly for errors vs shutdown paths where I think buffers get marked
as error/cancel to let the application know not to re-submit them.
I think that API all feels awkward, but I suspect what you're doing here
is correct as this is just if there is an error to generate the frame.
Can the generateFrame return errors? What might happen?
anyway, it sounds correct already:
Reviewed-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
>
> completeBuffer(request, buffer);
> break;
> --
> 2.48.1
>
>
More information about the libcamera-devel
mailing list