libcamera: camera: Pass the stream set to allocate/freeBuffers()

Pipeline handlers might need to perform allocation of internal buffers,
setup operations, or simple sanity check before going into the
per-stream buffer allocation.

As of now, PipelineHandler::allocateBuffers() is called once for each
active stream, leaving no space for stream-independent configuration.

Change this by providing to the pipeline handlers the full set of active
streams, and ask them to loop over them to perform per-streams
memory allocations and freeing.

Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
Jacopo Mondi
2019-04-17 15:42:24 +02:00
parent 4e1dc9004f
commit 911bc4aa41
6 changed files with 43 additions and 28 deletions
+4 -2
View File
@@ -58,8 +58,10 @@ public:
streamConfiguration(Camera *camera, const std::vector<StreamUsage> &usages) = 0;
virtual int configureStreams(Camera *camera, const CameraConfiguration &config) = 0;
virtual int allocateBuffers(Camera *camera, Stream *stream) = 0;
virtual int freeBuffers(Camera *camera, Stream *stream) = 0;
virtual int allocateBuffers(Camera *camera,
const std::set<Stream *> &streams) = 0;
virtual int freeBuffers(Camera *camera,
const std::set<Stream *> &streams) = 0;
virtual int start(Camera *camera) = 0;
virtual void stop(Camera *camera);