summaryrefslogtreecommitdiff
path: root/src/cam/capture.cpp
diff options
context:
space:
mode:
authorNiklas Söderlund <niklas.soderlund@ragnatech.se>2019-11-21 20:12:38 +0100
committerNiklas Söderlund <niklas.soderlund@ragnatech.se>2020-01-12 16:10:37 +0100
commit5967363c0b99a59f3526c51917572b807324e389 (patch)
tree134a8e070813bca1dfbf72e10d4443e951757e8d /src/cam/capture.cpp
parentdea689e1f260b904697a9c2f3d05b7b5068d85e1 (diff)
libcamera: buffer: Move captured metadata to FrameMetadata
Move the metadata retrieved when dequeuing a V4L2 buffer into a FrameMetadata object. This is done as a step to migrate to the FrameBuffer interface as the functions added to Buffer around FrameMetadata match the ones in FrameBuffer. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/cam/capture.cpp')
-rw-r--r--src/cam/capture.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/cam/capture.cpp b/src/cam/capture.cpp
index 1a4dbe7c..da942f56 100644
--- a/src/cam/capture.cpp
+++ b/src/cam/capture.cpp
@@ -154,9 +154,18 @@ void Capture::requestComplete(Request *request)
Buffer *buffer = it->second;
const std::string &name = streamName_[stream];
+ const FrameMetadata &metadata = buffer->metadata();
+
info << " " << name
- << " seq: " << std::setw(6) << std::setfill('0') << buffer->sequence()
- << " bytesused: " << buffer->bytesused();
+ << " seq: " << std::setw(6) << std::setfill('0') << metadata.sequence
+ << " bytesused: ";
+
+ unsigned int nplane = 0;
+ for (const FrameMetadata::Plane &plane : metadata.planes) {
+ info << plane.bytesused;
+ if (++nplane < metadata.planes.size())
+ info << "/";
+ }
if (writer_)
writer_->write(buffer, name);