summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKieran Bingham <kieran.bingham@ideasonboard.com>2022-02-16 12:29:48 +0000
committerKieran Bingham <kieran.bingham@ideasonboard.com>2022-03-22 22:24:13 +0000
commitbb97f3bbd96a9d347e1b7f6cb68d94efaf8db574 (patch)
tree9b62995b1c6d7fe2bbccd645ebe9a4f9eb13a79a
parentbfd04a8133c45f8e43f6093395171068ca955bc9 (diff)
simple-cam: processRequest: Report Request metadata
The completed Request can contain extra data associated with the completed capture to report IPA state or properties of the capture to the application. Process and report any metadata that is associated with the request when it completes, to demonstrate the extra metadata available to be processed. Now that there is substantially more information than one line per completed request, start each completed Request with a blank line to separate from previous completions and report the state of the Request itself with its .toString() helper. Suggested-by: Nejc Galof <galof.nejc@gmail.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
-rw-r--r--simple-cam.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/simple-cam.cpp b/simple-cam.cpp
index e282463..4de1b7d 100644
--- a/simple-cam.cpp
+++ b/simple-cam.cpp
@@ -46,6 +46,29 @@ static void requestComplete(Request *request)
static void processRequest(Request *request)
{
+ std::cout << std::endl
+ << "Request completed: " << request->toString() << std::endl;
+
+ /*
+ * When a request has completed, it is populated with a metadata control
+ * list that allows an application to determine various properties of
+ * the completed request. This can include the timestamp of the Sensor
+ * capture, or its gain and exposure values, or properties from the IPA
+ * such as the state of the 3A algorithms.
+ *
+ * ControlValue types have a toString, so to examine each request, print
+ * all the metadata for inspection. A custom application can parse each
+ * of these items and process them according to its needs.
+ */
+ const ControlList &requestMetadata = request->metadata();
+ for (const auto &ctrl : requestMetadata) {
+ const ControlId *id = controls::controls.at(ctrl.first);
+ const ControlValue &value = ctrl.second;
+
+ std::cout << "\t" << id->name() << " = " << value.toString()
+ << std::endl;
+ }
+
/*
* Each buffer has its own FrameMetadata to describe its state, or the
* usage of each buffer. While in our simple capture we only provide one