summaryrefslogtreecommitdiff
path: root/src/libcamera/pipeline/simple/converter.cpp
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-12-09 13:13:38 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-12-14 15:46:04 +0200
commit3129fcae43ce139cb1e158cb5255428afb8952ec (patch)
tree84e902862aa325a95a40f7241b63e11add6bee0c /src/libcamera/pipeline/simple/converter.cpp
parent1c2b54a0173f5ad6d792617246439ec1823bab5a (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/simple/converter.cpp')
-rw-r--r--src/libcamera/pipeline/simple/converter.cpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/libcamera/pipeline/simple/converter.cpp b/src/libcamera/pipeline/simple/converter.cpp
index 67e6e864..a6a8e139 100644
--- a/src/libcamera/pipeline/simple/converter.cpp
+++ b/src/libcamera/pipeline/simple/converter.cpp
@@ -24,7 +24,6 @@ namespace libcamera {
LOG_DECLARE_CATEGORY(SimplePipeline)
SimpleConverter::SimpleConverter(MediaDevice *media)
- : m2m_(nullptr)
{
/*
* Locate the video node. There's no need to validate the pipeline
@@ -38,17 +37,12 @@ SimpleConverter::SimpleConverter(MediaDevice *media)
if (it == entities.end())
return;
- m2m_ = new V4L2M2MDevice((*it)->deviceNode());
+ m2m_ = std::make_unique<V4L2M2MDevice>((*it)->deviceNode());
m2m_->output()->bufferReady.connect(this, &SimpleConverter::outputBufferReady);
m2m_->capture()->bufferReady.connect(this, &SimpleConverter::captureBufferReady);
}
-SimpleConverter::~SimpleConverter()
-{
- delete m2m_;
-}
-
int SimpleConverter::open()
{
if (!m2m_)