summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKieran Bingham <kieran.bingham@ideasonboard.com>2020-10-22 14:16:45 +0100
committerKieran Bingham <kieran.bingham@ideasonboard.com>2021-02-12 14:34:18 +0000
commit74f103486c44f548f326c21df745ef2280a9a7fb (patch)
tree7ebb4a29e06b112a1f54f2d40a9d98985dad21d5
parent41b6d83e6a0c39b31464fce67e69f0d4c5c905cc (diff)
libcamera: buffer: Utilise LIBCAMERA_DISABLE_COPY_AND_MOVE
Convert the existing copy, move and assignment operators to use the new macros. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
-rw-r--r--include/libcamera/buffer.h10
1 files changed, 4 insertions, 6 deletions
diff --git a/include/libcamera/buffer.h b/include/libcamera/buffer.h
index a26c8927..302fe3d3 100644
--- a/include/libcamera/buffer.h
+++ b/include/libcamera/buffer.h
@@ -10,6 +10,7 @@
#include <stdint.h>
#include <vector>
+#include <libcamera/class.h>
#include <libcamera/file_descriptor.h>
namespace libcamera {
@@ -43,12 +44,6 @@ public:
FrameBuffer(const std::vector<Plane> &planes, unsigned int cookie = 0);
- FrameBuffer(const FrameBuffer &) = delete;
- FrameBuffer(FrameBuffer &&) = delete;
-
- FrameBuffer &operator=(const FrameBuffer &) = delete;
- FrameBuffer &operator=(FrameBuffer &&) = delete;
-
const std::vector<Plane> &planes() const { return planes_; }
Request *request() const { return request_; }
@@ -57,7 +52,10 @@ public:
unsigned int cookie() const { return cookie_; }
void setCookie(unsigned int cookie) { cookie_ = cookie; }
+
private:
+ LIBCAMERA_DISABLE_COPY_AND_MOVE(FrameBuffer)
+
friend class Request; /* Needed to update request_. */
friend class V4L2VideoDevice; /* Needed to update metadata_. */