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 <naush@raspberrypi.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Naushir Patuck 2021-06-29 11:44:59 +01:00 committed by Laurent Pinchart
parent 9d44551404
commit d3ea8e7885
7 changed files with 11 additions and 11 deletions

View file

@ -58,9 +58,9 @@ private:
CamHelperImx219::CamHelperImx219()
#if ENABLE_EMBEDDED_DATA
: CamHelper(new MdParserImx219(), frameIntegrationDiff)
: CamHelper(std::make_unique<MdParserImx219>(), frameIntegrationDiff)
#else
: CamHelper(nullptr, frameIntegrationDiff)
: CamHelper({}, frameIntegrationDiff)
#endif
{
}