From d3ea8e78852ba91245fdb9069363c1149e99c3b0 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Tue, 29 Jun 2021 11:44:59 +0100 Subject: ipa: raspberrypi: Use a unique_ptr for the metadata parser The derived CamHelper class now allocates a metadata parser object through a unique_ptr that is passed to the base class constructor. This automates the lifetime management of the parser object. Signed-off-by: Naushir Patuck Reviewed-by: David Plowman Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart --- src/ipa/raspberrypi/cam_helper.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/ipa/raspberrypi/cam_helper.hpp') diff --git a/src/ipa/raspberrypi/cam_helper.hpp b/src/ipa/raspberrypi/cam_helper.hpp index b19c95f6..fc3139e2 100644 --- a/src/ipa/raspberrypi/cam_helper.hpp +++ b/src/ipa/raspberrypi/cam_helper.hpp @@ -6,6 +6,7 @@ */ #pragma once +#include #include #include @@ -67,7 +68,7 @@ class CamHelper { public: static CamHelper *Create(std::string const &cam_name); - CamHelper(MdParser *parser, unsigned int frameIntegrationDiff); + CamHelper(std::unique_ptr parser, unsigned int frameIntegrationDiff); virtual ~CamHelper(); void SetCameraMode(const CameraMode &mode); virtual void Prepare(libcamera::Span buffer, @@ -92,7 +93,7 @@ protected: void parseEmbeddedData(libcamera::Span buffer, Metadata &metadata); - MdParser *parser_; + std::unique_ptr parser_; CameraMode mode_; private: -- cgit v1.2.1