[PATCH v1 1/2] gstreamer: allocator: Recognize FrameBufferAllocator errors

Barnabás Pőcze pobrn at protonmail.com
Sun Dec 15 19:20:57 CET 2024


Another thing: FrameBufferAllocator does not consider it an error
if the underlying Camera's `exportFrameBuffers()` returns.
This should be clarified.


2024. december 15., vasárnap 19:18 keltezéssel, Barnabás Pőcze <pobrn at protonmail.com> írta:

> `FrameBufferAllocator::allocate()` might return a negative error code,
> but currently this is handled the same way as success. So instead
> of continuing, abort the construction.
> 
> Signed-off-by: Barnabás Pőcze pobrn at protonmail.com
> 
> ---
> src/gstreamer/gstlibcameraallocator.cpp | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/gstreamer/gstlibcameraallocator.cpp b/src/gstreamer/gstlibcameraallocator.cpp
> index 7e4c904da..b0c84893a 100644
> --- a/src/gstreamer/gstlibcameraallocator.cpp
> +++ b/src/gstreamer/gstlibcameraallocator.cpp
> @@ -214,7 +214,7 @@ gst_libcamera_allocator_new(std::shared_ptr<Camera> camera,
> 
> Stream *stream = streamCfg.stream();
> 
> ret = self->fb_allocator->allocate(stream);
> 
> - if (ret == 0)
> + if (ret <= 0)
> return nullptr;
> 
> GQueue *pool = g_queue_new();
> --
> 2.47.1


More information about the libcamera-devel mailing list