libcamera: request: Add hasPendingBuffers() method
Add method to verify if a request has pending buffers yet to be completed. 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:
@@ -106,6 +106,14 @@ Buffer *Request::findBuffer(Stream *stream) const
|
||||
* \return The request completion status
|
||||
*/
|
||||
|
||||
/**
|
||||
* \fn Request::hasPendingBuffers()
|
||||
* \brief Check if a request has buffers yet to be completed
|
||||
*
|
||||
* \return True if the request has buffers pending for completion, false
|
||||
* otherwise
|
||||
*/
|
||||
|
||||
/**
|
||||
* \brief Prepare the resources for the completion handler
|
||||
*/
|
||||
@@ -127,7 +135,7 @@ int Request::prepare()
|
||||
*/
|
||||
void Request::complete(Status status)
|
||||
{
|
||||
ASSERT(pending_.empty());
|
||||
ASSERT(!hasPendingBuffers());
|
||||
status_ = status;
|
||||
}
|
||||
|
||||
@@ -149,7 +157,7 @@ bool Request::completeBuffer(Buffer *buffer)
|
||||
int ret = pending_.erase(buffer);
|
||||
ASSERT(ret == 1);
|
||||
|
||||
return pending_.empty();
|
||||
return !hasPendingBuffers();
|
||||
}
|
||||
|
||||
} /* namespace libcamera */
|
||||
|
||||
Reference in New Issue
Block a user