libcamera: framebuffer: Move remaining private data to Private class

Private members of the FrameBuffer class are split between FrameBuffer
and FrameBuffer::Private. There was no real justification for this
split, and keeping some members private in the FrameBuffer class causes
multiple issues:

- Future modifications of the FrameBuffer class without breaking the ABI
  may be more difficult.
- Mutable access to members that should not be modified by applications
  require a friend statement, or going through the Private class.

Move all remaining private members to the Private class to address the
first issue, and add a Private::metadata() function to address the
second problem.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Tested-by: Naushir Patuck <naush@raspberrypi.com>
This commit is contained in:
Laurent Pinchart 2022-10-02 02:21:16 +03:00
parent e0e54965df
commit c20d3f5575
6 changed files with 71 additions and 53 deletions

View file

@ -22,7 +22,7 @@ class FrameBuffer::Private : public Extensible::Private
LIBCAMERA_DECLARE_PUBLIC(FrameBuffer)
public:
Private();
Private(const std::vector<Plane> &planes, uint64_t cookie = 0);
virtual ~Private();
void setRequest(Request *request) { request_ = request; }
@ -31,9 +31,15 @@ public:
Fence *fence() const { return fence_.get(); }
void setFence(std::unique_ptr<Fence> fence) { fence_ = std::move(fence); }
void cancel() { LIBCAMERA_O_PTR()->metadata_.status = FrameMetadata::FrameCancelled; }
void cancel() { metadata_.status = FrameMetadata::FrameCancelled; }
FrameMetadata &metadata() { return metadata_; }
private:
std::vector<Plane> planes_;
FrameMetadata metadata_;
uint64_t cookie_;
std::unique_ptr<Fence> fence_;
Request *request_;
bool isContiguous_;