diff options
author | Umang Jain <umang.jain@ideasonboard.com> | 2021-10-28 22:32:54 +0530 |
---|---|---|
committer | Umang Jain <umang.jain@ideasonboard.com> | 2021-11-08 17:34:45 +0530 |
commit | 1b30992b623e15f6be9ea9f425d14dfa6c372c8d (patch) | |
tree | c0c5ff021860919eccbf229bb51fe615c3a371e6 /src/android/camera_request.h | |
parent | 701266653c7a4b5cb0213e6a6003f0aea0401f6b (diff) |
android: Camera3RequestDescriptor: Provide a constructor for StreamBuffer
Provide a constructor for StreamBuffer and use that while populating
Camera3RequestDescriptor::buffers_ vector. Also provide the default
move-constructor (required as StreamBuffer is stored in a vector in
Camera3RequestDescriptor) and destructor for the StreamBuffer struct.
Also declare a default move assignment operator and disable the
copy constructor and move operator explicitly with
LIBCAMERA_DISABLE_COPY().
While at it, initialize pointers members in the StreamBuffer struct
to nullptr, with StreamBuffer::status set to Status::Success by default.
Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'src/android/camera_request.h')
-rw-r--r-- | src/android/camera_request.h | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/android/camera_request.h b/src/android/camera_request.h index cfafa445..8d1204e5 100644 --- a/src/android/camera_request.h +++ b/src/android/camera_request.h @@ -34,15 +34,26 @@ public: }; struct StreamBuffer { + StreamBuffer(CameraStream *stream, + const camera3_stream_buffer_t &buffer, + Camera3RequestDescriptor *request); + ~StreamBuffer(); + + StreamBuffer(StreamBuffer &&); + StreamBuffer &operator=(StreamBuffer &&); + CameraStream *stream; buffer_handle_t *camera3Buffer; std::unique_ptr<libcamera::FrameBuffer> frameBuffer; int fence; - Status status; - libcamera::FrameBuffer *internalBuffer; - const libcamera::FrameBuffer *srcBuffer; + Status status = Status::Success; + libcamera::FrameBuffer *internalBuffer = nullptr; + const libcamera::FrameBuffer *srcBuffer = nullptr; std::unique_ptr<CameraBuffer> dstBuffer; Camera3RequestDescriptor *request; + + private: + LIBCAMERA_DISABLE_COPY(StreamBuffer) }; /* Keeps track of streams requiring post-processing. */ |