summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/libcamera/pipeline/ipu3/ipu3.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
index 64f639fc..80f4a7bf 100644
--- a/src/libcamera/pipeline/ipu3/ipu3.cpp
+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
@@ -210,18 +210,16 @@ void PipelineHandlerIPU3::registerCameras()
* registered. The 'camera' shared pointer goes out of scope
* and deletes the Camera it manages.
*/
- V4L2Device *videoDev = createVideoDevice(id);
- if (!videoDev) {
+ std::unique_ptr<IPU3CameraData> data = utils::make_unique<IPU3CameraData>();
+ data->dev_ = createVideoDevice(id);
+ if (!data->dev_) {
LOG(IPU3, Error)
<< "Failed to register camera["
<< numCameras << "] \"" << cameraName << "\"";
continue;
}
- IPU3CameraData *data = new IPU3CameraData();
- data->dev_ = videoDev;
- setCameraData(camera.get(),
- std::move(std::unique_ptr<IPU3CameraData>(data)));
+ setCameraData(camera.get(), std::move(data));
registerCamera(std::move(camera));
LOG(IPU3, Info)