summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNiklas Söderlund <niklas.soderlund@ragnatech.se>2019-11-21 17:24:57 +0100
committerNiklas Söderlund <niklas.soderlund@ragnatech.se>2020-01-12 16:10:37 +0100
commitfca110915525be2105f5495f5f80943261be6757 (patch)
tree890d1988115ae31af146d32e3df1b5a431869399 /src
parent962d1c17a422636c9e1ac8dcbf72b79b3aed8506 (diff)
libcamera: buffer: Drop private function setRequest()
There is no need to have a private helper function to access a private data member when a friend statement is needed anyhow. Remove the helper function to simplify the code and make it clear that a private member of Buffer is accessed. 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>
Diffstat (limited to 'src')
-rw-r--r--src/libcamera/buffer.cpp8
-rw-r--r--src/libcamera/request.cpp4
2 files changed, 6 insertions, 6 deletions
diff --git a/src/libcamera/buffer.cpp b/src/libcamera/buffer.cpp
index d53e5150..8c8be4ac 100644
--- a/src/libcamera/buffer.cpp
+++ b/src/libcamera/buffer.cpp
@@ -290,7 +290,6 @@ Buffer::Buffer(unsigned int index, const Buffer *metadata)
*
* \return The Request the Buffer belongs to, or nullptr if the buffer is
* either completed or not associated with a request
- * \sa Buffer::setRequest()
*/
/**
@@ -318,10 +317,11 @@ void Buffer::cancel()
}
/**
- * \fn Buffer::setRequest()
- * \brief Set the request this buffer belongs to
+ * \var Buffer::request_
+ * \brief The request this buffer belongs to
*
- * The intended callers are Request::addBuffer() and Request::completeBuffer().
+ * This member is intended to be set by Request::addBuffer() and
+ * Request::completeBuffer().
*/
/**
diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp
index 84a5f558..92330c1a 100644
--- a/src/libcamera/request.cpp
+++ b/src/libcamera/request.cpp
@@ -139,7 +139,7 @@ int Request::addBuffer(std::unique_ptr<Buffer> buffer)
return -EEXIST;
}
- buffer->setRequest(this);
+ buffer->request_ = this;
pending_.insert(buffer.get());
bufferMap_[stream] = buffer.release();
@@ -236,7 +236,7 @@ bool Request::completeBuffer(Buffer *buffer)
int ret = pending_.erase(buffer);
ASSERT(ret == 1);
- buffer->setRequest(nullptr);
+ buffer->request_ = nullptr;
if (buffer->status() == Buffer::BufferCancelled)
cancelled_ = true;