<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 22 Jun 2021 at 14:20, Naushir Patuck <<a href="mailto:naush@raspberrypi.com">naush@raspberrypi.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
Here is version 2 of this series. The following changes have been introduced<br>
over v1:<br>
<br>
- Rework patch 1/2 to use a unique_ptr to store the parser object in the<br>
CamHelper class.<br>
- Switch to using std::initialiser_list in the constructor of MdParserSmia.<br>
- All suggestions from Laurent's feedback have been addressed in patch 2/2.<br>
<br>
The constructor for the unique_ptr<MdParserSmia> in patch 2/2 looks a bit<br>
awkward now since I have to explicitly write std::initialiser_list within<br>
std::make_unique, but I cannot see nice way around this.<br></blockquote><div><br></div><div>Something like the following could arguably be neater, but functionally equivalent in patch 2/2:</div><div><br></div><div>diff --git a/src/ipa/raspberrypi/cam_helper_imx219.cpp b/src/ipa/raspberrypi/cam_helper_imx219.cpp<br>index 18f5c3e7e520..bd42536085d9 100644<br>--- a/src/ipa/raspberrypi/cam_helper_imx219.cpp<br>+++ b/src/ipa/raspberrypi/cam_helper_imx219.cpp<br>@@ -30,6 +30,7 @@ using namespace RPiController;<br> constexpr uint32_t gainReg = 0x157;<br> constexpr uint32_t expHiReg = 0x15a;<br> constexpr uint32_t expLoReg = 0x15b;<br>+constexpr std::initializer_list<uint32_t> registerList = { expHiReg, expLoReg, gainReg };<br> <br> class CamHelperImx219 : public CamHelper<br> {<br>@@ -53,9 +54,7 @@ private:<br> <br> CamHelperImx219::CamHelperImx219()<br> #if ENABLE_EMBEDDED_DATA<br>- : CamHelper(std::make_unique<MdParserSmia><br>- (std::initializer_list<uint32_t>({ expHiReg, expLoReg, gainReg })),<br>- frameIntegrationDiff)<br>+ : CamHelper(std::make_unique<MdParserSmia>(registerList), frameIntegrationDiff)<br> #else<br> : CamHelper({}, frameIntegrationDiff)<br> #endif<br>diff --git a/src/ipa/raspberrypi/cam_helper_imx477.cpp b/src/ipa/raspberrypi/cam_helper_imx477.cpp<br>index 8869af6620cf..4c7f7fd9561b 100644<br>--- a/src/ipa/raspberrypi/cam_helper_imx477.cpp<br>+++ b/src/ipa/raspberrypi/cam_helper_imx477.cpp<br>@@ -23,6 +23,7 @@ constexpr uint32_t expHiReg = 0x0202;<br> constexpr uint32_t expLoReg = 0x0203;<br> constexpr uint32_t gainHiReg = 0x0204;<br> constexpr uint32_t gainLoReg = 0x0205;<br>+constexpr std::initializer_list<uint32_t> registerList = { expHiReg, expLoReg, gainHiReg, gainLoReg };<br> <br> class CamHelperImx477 : public CamHelper<br> {<br>@@ -46,9 +47,7 @@ private:<br> };<br> <br> CamHelperImx477::CamHelperImx477()<br>- : CamHelper(std::make_unique<MdParserSmia><br>- (std::initializer_list<uint32_t>({ expHiReg, expLoReg, gainHiReg, gainLoReg })),<br>- frameIntegrationDiff)<br>+ : CamHelper(std::make_unique<MdParserSmia>(registerList), frameIntegrationDiff)<br> {<br> }<br></div><div><br></div><div>If folks think this is better, I am happy to change it.</div><div><br></div><div>Naush</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
I have removed all previous tags from 1/2, as this is a completely different<br>
approach to the previous revision.<br>
<br>
Thanks,<br>
Naush<br>
<br>
Naushir Patuck (2):<br>
ipa: raspberrypi: Use a unique_ptr for the metadata parser<br>
ipa: raspberrypi: Generalise the SMIA metadata parser<br>
<br>
src/ipa/raspberrypi/cam_helper.cpp | 38 ++++---<br>
src/ipa/raspberrypi/cam_helper.hpp | 7 +-<br>
src/ipa/raspberrypi/cam_helper_imx219.cpp | 117 ++++----------------<br>
src/ipa/raspberrypi/cam_helper_imx290.cpp | 2 +-<br>
src/ipa/raspberrypi/cam_helper_imx477.cpp | 123 ++++------------------<br>
src/ipa/raspberrypi/cam_helper_ov5647.cpp | 2 +-<br>
src/ipa/raspberrypi/md_parser.hpp | 42 +++++---<br>
src/ipa/raspberrypi/md_parser_smia.cpp | 66 ++++++++++--<br>
8 files changed, 155 insertions(+), 242 deletions(-)<br>
<br>
-- <br>
2.25.1<br>
<br>
</blockquote></div></div>