summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKieran Bingham <kieran.bingham@ideasonboard.com>2022-02-16 12:27:24 +0000
committerKieran Bingham <kieran.bingham@ideasonboard.com>2022-03-22 22:23:01 +0000
commitbfd04a8133c45f8e43f6093395171068ca955bc9 (patch)
tree198bb40a1c3c096a8f0dad1a6b9c595b299d3857
parent02f7db4426001cfade29fd422f3564c54e5347fb (diff)
simple-cam: processRequest: Report timestamp and enhance description
Report the timestamp of the completed buffers when the processRequest() call handles a request and improve the description to discuss more of the operations that can be done here. Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
-rw-r--r--simple-cam.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/simple-cam.cpp b/simple-cam.cpp
index 71a715a..e282463 100644
--- a/simple-cam.cpp
+++ b/simple-cam.cpp
@@ -46,8 +46,17 @@ static void requestComplete(Request *request)
static void processRequest(Request *request)
{
+ /*
+ * 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
+ * buffer per request, a request can have a buffer for each stream that
+ * is established when configuring the camera.
+ *
+ * This allows a viewfinder and a still image to be processed at the
+ * same time, or to allow obtaining the RAW capture buffer from the
+ * sensor along with the image as processed by the ISP.
+ */
const Request::BufferMap &buffers = request->buffers();
-
for (auto bufferPair : buffers) {
// (Unused) Stream *stream = bufferPair.first;
FrameBuffer *buffer = bufferPair.second;
@@ -55,6 +64,7 @@ static void processRequest(Request *request)
/* Print some information about the buffer which has completed. */
std::cout << " seq: " << std::setw(6) << std::setfill('0') << metadata.sequence
+ << " timestamp: " << metadata.timestamp
<< " bytesused: ";
unsigned int nplane = 0;