libcamera: stream: Shorten access to the bufferPool

All interactions with the Stream's buffers currently go through the
BufferPool. In order to shorten accessing the buffers array, and eventually
restrict access to the Stream's internal buffer pool, provide operations to
access, create and destroy buffers.

It is still possible to access the pool for pipeline handlers to
populate it by exporting buffers from a video device to Stream's pool.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
This commit is contained in:
Jacopo Mondi 2019-06-28 10:03:02 +02:00 committed by Laurent Pinchart
parent 5085bc03bc
commit be3e3ebc92
5 changed files with 42 additions and 6 deletions

View file

@ -71,11 +71,15 @@ public:
std::unique_ptr<Buffer> createBuffer(unsigned int index);
BufferPool &bufferPool() { return bufferPool_; }
std::vector<BufferMemory> &buffers() { return bufferPool_.buffers(); }
const StreamConfiguration &configuration() const { return configuration_; }
protected:
friend class Camera;
void createBuffers(unsigned int count);
void destroyBuffers();
BufferPool bufferPool_;
StreamConfiguration configuration_;
};