From bfd04a8133c45f8e43f6093395171068ca955bc9 Mon Sep 17 00:00:00 2001 From: Kieran Bingham Date: Wed, 16 Feb 2022 12:27:24 +0000 Subject: 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 Signed-off-by: Kieran Bingham --- simple-cam.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'simple-cam.cpp') 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; -- cgit v1.2.1