From bb97f3bbd96a9d347e1b7f6cb68d94efaf8db574 Mon Sep 17 00:00:00 2001 From: Kieran Bingham Date: Wed, 16 Feb 2022 12:29:48 +0000 Subject: 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 Signed-off-by: Kieran Bingham --- simple-cam.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) 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 -- cgit v1.2.1