libcamera: request: In addBuffer() do not fetch stream from Buffer
In the FrameBuffer interface the stream will not be available from the buffer object as the buffer might be allocated externally. The application needs to explicitly state which stream the buffer is being added for to the request. Extend the addBuffer() function to get this information explicitly from the caller. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
@@ -113,6 +113,7 @@ Request::~Request()
|
||||
|
||||
/**
|
||||
* \brief Store a Buffer with its associated Stream in the Request
|
||||
* \param[in] stream The stream the buffer belongs to
|
||||
* \param[in] buffer The Buffer to store in the request
|
||||
*
|
||||
* Ownership of the buffer is passed to the request. It will be deleted when
|
||||
@@ -125,9 +126,8 @@ Request::~Request()
|
||||
* \retval -EEXIST The request already contains a buffer for the stream
|
||||
* \retval -EINVAL The buffer does not reference a valid Stream
|
||||
*/
|
||||
int Request::addBuffer(std::unique_ptr<Buffer> buffer)
|
||||
int Request::addBuffer(Stream *stream, std::unique_ptr<Buffer> buffer)
|
||||
{
|
||||
Stream *stream = buffer->stream();
|
||||
if (!stream) {
|
||||
LOG(Request, Error) << "Invalid stream reference";
|
||||
return -EINVAL;
|
||||
|
||||
Reference in New Issue
Block a user