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

Laurent Pinchart laurent.pinchart at ideasonboard.com
Mon Apr 19 21:18:54 CEST 2021


Hi Nícolas,

On Mon, Apr 19, 2021 at 02:38:21PM -0300, Nícolas F. R. A. Prado wrote:
> 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?

I'd have a preference for that, yes.

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list