summaryrefslogtreecommitdiff
path: root/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcamera/pipeline/uvcvideo/uvcvideo.cpp')
-rw-r--r--src/libcamera/pipeline/uvcvideo/uvcvideo.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp
index 87b0f03d..e54f45bb 100644
--- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp
+++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp
@@ -9,6 +9,7 @@
#include <fstream>
#include <iomanip>
#include <math.h>
+#include <memory>
#include <tuple>
#include <libcamera/camera.h>
@@ -35,21 +36,16 @@ class UVCCameraData : public CameraData
{
public:
UVCCameraData(PipelineHandler *pipe)
- : CameraData(pipe), video_(nullptr)
+ : CameraData(pipe)
{
}
- ~UVCCameraData()
- {
- delete video_;
- }
-
int init(MediaDevice *media);
void addControl(uint32_t cid, const ControlInfo &v4l2info,
ControlInfoMap::Map *ctrls);
void bufferReady(FrameBuffer *buffer);
- V4L2VideoDevice *video_;
+ std::unique_ptr<V4L2VideoDevice> video_;
Stream stream_;
};
@@ -499,7 +495,7 @@ int UVCCameraData::init(MediaDevice *media)
}
/* Create and open the video device. */
- video_ = new V4L2VideoDevice(*entity);
+ video_ = std::make_unique<V4L2VideoDevice>(*entity);
ret = video_->open();
if (ret)
return ret;