summaryrefslogtreecommitdiff
path: root/src/ipa/rpi/vc4/vc4.cpp
diff options
context:
space:
mode:
authorNaushir Patuck <naush@raspberrypi.com>2023-12-04 16:19:01 +0000
committerKieran Bingham <kieran.bingham@ideasonboard.com>2024-01-09 15:39:03 +0000
commit0110d9915e6bbea06707a9b62f313d3ec44a059a (patch)
tree867d981f2dceb8669c66c0ce510db6c8a9252f44 /src/ipa/rpi/vc4/vc4.cpp
parent12ffe28e1c6d43bd2a4e4bc15d36821d78f42e74 (diff)
ipa: vc4: Implement the StatsOutputEnable vendor control
Implement the StatsOutputEnable control for the VC4 IPA. When set, this outputs the ISP statistics as a uint8_t span through the Bcm2835StatsOutput metadata control. To get this working, IpaBase::libcameraMetadata_ is moved from a private to a protected member variable. This makes it accessable to the VC4 derived IPA class. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/ipa/rpi/vc4/vc4.cpp')
-rw-r--r--src/ipa/rpi/vc4/vc4.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/ipa/rpi/vc4/vc4.cpp b/src/ipa/rpi/vc4/vc4.cpp
index c165a5b8..d2159a51 100644
--- a/src/ipa/rpi/vc4/vc4.cpp
+++ b/src/ipa/rpi/vc4/vc4.cpp
@@ -11,6 +11,7 @@
#include <linux/bcm2835-isp.h>
#include <libcamera/base/log.h>
+#include <libcamera/base/span.h>
#include <libcamera/control_ids.h>
#include <libcamera/ipa/ipa_module_info.h>
@@ -245,6 +246,12 @@ RPiController::StatisticsPtr IpaVc4::platformProcessStats(Span<uint8_t> mem)
stats->focus_stats[i].contrast_val_num[1][1],
stats->focus_stats[i].contrast_val_num[1][0] });
+ if (statsMetadataOutput_) {
+ Span<const uint8_t> statsSpan(reinterpret_cast<const uint8_t *>(stats),
+ sizeof(bcm2835_isp_stats));
+ libcameraMetadata_.set(controls::rpi::Bcm2835StatsOutput, statsSpan);
+ }
+
return statistics;
}