@@ -246,6 +246,7 @@ int CameraSession::start()
+ "-stream" + std::to_string(index);
}
+ camera_->metadataAvailable.connect(this, &CameraSession::metadataAvailable);
camera_->requestCompleted.connect(this, &CameraSession::requestComplete);
#ifdef HAVE_KMS
@@ -407,6 +408,22 @@ int CameraSession::queueRequest(Request *request)
return camera_->queueRequest(request);
}
+void CameraSession::metadataAvailable(Request *request,
+ std::unordered_set<const ControlId *> ids)
+{
+ const ControlList &metadata = request->metadata();
+
+ std::cerr << "EARLY METADATA COMPLETION FOR REQUEST: "
+ << request->sequence() << std::endl;
+
+ for (const auto id : ids) {
+ const ControlValue &value = metadata.get(id->id());
+
+ std::cout << "\t" << id->name() << " = "
+ << value.toString() << std::endl;
+ }
+}
+
void CameraSession::requestComplete(Request *request)
{
if (request->status() == Request::RequestCancelled)
@@ -53,6 +53,8 @@ private:
int startCapture();
int queueRequest(libcamera::Request *request);
+ void metadataAvailable(libcamera::Request *request,
+ std::unordered_set<const libcamera::ControlId *> ids);
void requestComplete(libcamera::Request *request);
void processRequest(libcamera::Request *request);
void sinkRelease(libcamera::Request *request);
Handle the Camera::metadataAvailable signal and print the metadata list. Use the --metadata option of cam to validate that the metadata list in Request::metadata() matches the accumulated results. Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> --- src/apps/cam/camera_session.cpp | 17 +++++++++++++++++ src/apps/cam/camera_session.h | 2 ++ 2 files changed, 19 insertions(+)