summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKieran Bingham <kieran.bingham@ideasonboard.com>2021-03-24 16:59:03 +0000
committerKieran Bingham <kieran.bingham@ideasonboard.com>2021-03-29 12:18:02 +0100
commitdcc024760a8d4eb35b7d0ca285f566bb1b3e773b (patch)
treeb8e9f952dfb9dfe257b2608ea004bd811a38e253 /src
parent70238ceca5b2f0be1330ecb9664ae0f59f151152 (diff)
libcamera: buffer: Break friendship with Request
The FrameBuffer class is only friends with Request so that the request can be associated with the buffers. FrameBuffer already has a helper to setRequest(), so let's use that directly instead. Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src')
-rw-r--r--src/libcamera/request.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp
index 0071667e..3ad83f3b 100644
--- a/src/libcamera/request.cpp
+++ b/src/libcamera/request.cpp
@@ -118,8 +118,9 @@ void Request::reuse(ReuseFlag flags)
pending_.clear();
if (flags & ReuseBuffers) {
for (auto pair : bufferMap_) {
- pair.second->request_ = this;
- pending_.insert(pair.second);
+ FrameBuffer *buffer = pair.second;
+ buffer->setRequest(this);
+ pending_.insert(buffer);
}
} else {
bufferMap_.clear();
@@ -187,7 +188,7 @@ int Request::addBuffer(const Stream *stream, FrameBuffer *buffer)
return -EEXIST;
}
- buffer->request_ = this;
+ buffer->setRequest(this);
pending_.insert(buffer);
bufferMap_[stream] = buffer;
@@ -294,7 +295,7 @@ bool Request::completeBuffer(FrameBuffer *buffer)
int ret = pending_.erase(buffer);
ASSERT(ret == 1);
- buffer->request_ = nullptr;
+ buffer->setRequest(nullptr);
if (buffer->metadata().status == FrameMetadata::FrameCancelled)
cancelled_ = true;