[libcamera-devel] [PATCH v2 1/2] libcamera: framebuffer_allocator: Make allocate() accept count

Nícolas F. R. A. Prado nfraprado at collabora.com
Mon Apr 19 19:38:21 CEST 2021


Em 2021-04-16 19:28, Nícolas F. R. A. Prado escreveu:

> Add a 'count' argument to FrameBufferAllocator::allocate() so that a
> custom amount of buffers can be allocated. If 0 is passed, the pipeline
> handler allocates the default amount, which is the configured
> bufferCount.
>
> Signed-off-by: Nícolas F. R. A. Prado <nfraprado at collabora.com>
> ---
> include/libcamera/camera.h | 3 ++-
> include/libcamera/framebuffer_allocator.h | 2 +-
> include/libcamera/internal/pipeline_handler.h | 3 ++-
> src/cam/capture.cpp | 2 +-
> src/lc-compliance/simple_capture.cpp | 8 ++++----
> src/lc-compliance/simple_capture.h | 2 +-
> src/libcamera/camera.cpp | 5 +++--
> src/libcamera/framebuffer_allocator.cpp | 5 +++--
> src/libcamera/pipeline/ipu3/ipu3.cpp | 9 ++++++---
> src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 9 ++++++---
> src/libcamera/pipeline/rkisp1/rkisp1.cpp | 9 ++++++---
> src/libcamera/pipeline/simple/simple.cpp | 9 ++++++---
> src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 9 ++++++---
> src/libcamera/pipeline/vimc/vimc.cpp | 9 ++++++---
> src/libcamera/pipeline_handler.cpp | 1 +
> src/qcam/main_window.cpp | 2 +-
> test/camera/capture.cpp | 2 +-
> test/camera/statemachine.cpp | 2 +-
> test/mapped-buffer.cpp | 2 +-
> 19 files changed, 58 insertions(+), 35 deletions(-)
>

[ ... ]

> diff --git a/src/libcamera/pipeline_handler.cpp
> b/src/libcamera/pipeline_handler.cpp
> index 3b3150bdbbf7..ab5f21a01438 100644
> --- a/src/libcamera/pipeline_handler.cpp
> +++ b/src/libcamera/pipeline_handler.cpp
> @@ -323,6 +323,7 @@ const ControlList &PipelineHandler::properties(const Camera
> *camera) const
> * \param[in] camera The camera
> * \param[in] stream The stream to allocate buffers for
> * \param[out] buffers Array of buffers successfully allocated
> + * \param[in] count The amount of buffers to allocate

Should the 'count' parameter come before 'buffers' so that all 'in' are before
all 'out' parameters?

Thanks,
Nícolas


More information about the libcamera-devel mailing list