diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2020-12-09 13:13:38 +0200 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2020-12-14 15:46:04 +0200 |
commit | 3129fcae43ce139cb1e158cb5255428afb8952ec (patch) | |
tree | 84e902862aa325a95a40f7241b63e11add6bee0c /src/libcamera/pipeline/ipu3/cio2.h | |
parent | 1c2b54a0173f5ad6d792617246439ec1823bab5a (diff) |
libcamera: pipeline: Manage resources with std::unique_ptr<>
Replace manual resource destruction with std::unique_ptr<> where
applicable. This removes the need for several destructors.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Diffstat (limited to 'src/libcamera/pipeline/ipu3/cio2.h')
-rw-r--r-- | src/libcamera/pipeline/ipu3/cio2.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/libcamera/pipeline/ipu3/cio2.h b/src/libcamera/pipeline/ipu3/cio2.h index 0dca9673..236ad287 100644 --- a/src/libcamera/pipeline/ipu3/cio2.h +++ b/src/libcamera/pipeline/ipu3/cio2.h @@ -33,7 +33,6 @@ public: static constexpr unsigned int CIO2_BUFFER_COUNT = 4; CIO2Device(); - ~CIO2Device(); std::vector<PixelFormat> formats() const; std::vector<SizeRange> sizes() const; @@ -49,8 +48,8 @@ public: int start(); int stop(); - CameraSensor *sensor() { return sensor_; } - const CameraSensor *sensor() const { return sensor_; } + CameraSensor *sensor() { return sensor_.get(); } + const CameraSensor *sensor() const { return sensor_.get(); } int queueBuffer(Request *request, FrameBuffer *rawBuffer); void tryReturnBuffer(FrameBuffer *buffer); @@ -61,8 +60,8 @@ private: void cio2BufferReady(FrameBuffer *buffer); - CameraSensor *sensor_; - V4L2Subdevice *csi2_; + std::unique_ptr<CameraSensor> sensor_; + std::unique_ptr<V4L2Subdevice> csi2_; std::unique_ptr<V4L2VideoDevice> output_; std::vector<std::unique_ptr<FrameBuffer>> buffers_; |