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>
This commit is contained in:
parent
70238ceca5
commit
dcc024760a
2 changed files with 5 additions and 5 deletions
|
@ -56,7 +56,6 @@ public:
|
||||||
private:
|
private:
|
||||||
LIBCAMERA_DISABLE_COPY_AND_MOVE(FrameBuffer)
|
LIBCAMERA_DISABLE_COPY_AND_MOVE(FrameBuffer)
|
||||||
|
|
||||||
friend class Request; /* Needed to update request_. */
|
|
||||||
friend class V4L2VideoDevice; /* Needed to update metadata_. */
|
friend class V4L2VideoDevice; /* Needed to update metadata_. */
|
||||||
|
|
||||||
std::vector<Plane> planes_;
|
std::vector<Plane> planes_;
|
||||||
|
|
|
@ -118,8 +118,9 @@ void Request::reuse(ReuseFlag flags)
|
||||||
pending_.clear();
|
pending_.clear();
|
||||||
if (flags & ReuseBuffers) {
|
if (flags & ReuseBuffers) {
|
||||||
for (auto pair : bufferMap_) {
|
for (auto pair : bufferMap_) {
|
||||||
pair.second->request_ = this;
|
FrameBuffer *buffer = pair.second;
|
||||||
pending_.insert(pair.second);
|
buffer->setRequest(this);
|
||||||
|
pending_.insert(buffer);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
bufferMap_.clear();
|
bufferMap_.clear();
|
||||||
|
@ -187,7 +188,7 @@ int Request::addBuffer(const Stream *stream, FrameBuffer *buffer)
|
||||||
return -EEXIST;
|
return -EEXIST;
|
||||||
}
|
}
|
||||||
|
|
||||||
buffer->request_ = this;
|
buffer->setRequest(this);
|
||||||
pending_.insert(buffer);
|
pending_.insert(buffer);
|
||||||
bufferMap_[stream] = buffer;
|
bufferMap_[stream] = buffer;
|
||||||
|
|
||||||
|
@ -294,7 +295,7 @@ bool Request::completeBuffer(FrameBuffer *buffer)
|
||||||
int ret = pending_.erase(buffer);
|
int ret = pending_.erase(buffer);
|
||||||
ASSERT(ret == 1);
|
ASSERT(ret == 1);
|
||||||
|
|
||||||
buffer->request_ = nullptr;
|
buffer->setRequest(nullptr);
|
||||||
|
|
||||||
if (buffer->metadata().status == FrameMetadata::FrameCancelled)
|
if (buffer->metadata().status == FrameMetadata::FrameCancelled)
|
||||||
cancelled_ = true;
|
cancelled_ = true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue