libcamera: buffer: Add an accessor to the BufferMemory

Buffer instances reference memory, which is modelled internally by a
BufferMemory instance. Store a pointer to the BufferMemory in the Buffer
class, and populate it when the buffer is queued to the camera through a
request. This is useful for applications to access the buffer memory in
the buffer or request completion handler.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
This commit is contained in:
Laurent Pinchart
2019-07-12 22:32:01 +03:00
parent f1199a1011
commit 689e8916ca
8 changed files with 26 additions and 11 deletions

View File

@@ -300,6 +300,17 @@ Buffer::Buffer(unsigned int index, const Buffer *metadata)
* \return The dmabuf file descriptors
*/
/**
* \fn Buffer::mem()
* \brief Retrieve the BufferMemory this buffer is associated with
*
* The association between the buffer and a BufferMemory instance is valid from
* the time the request containing this buffer is queued to a camera to the end
* of that request's completion handler.
*
* \return The BufferMemory this buffer is associated with
*/
/**
* \fn Buffer::bytesused()
* \brief Retrieve the number of bytes occupied by the data in the buffer