[PATCH 5/8] libcamera: request: Add function to reset metadata
Jacopo Mondi
jacopo.mondi at ideasonboard.com
Fri Dec 6 17:07:43 CET 2024
In order to prepare to restrict access to the metadata list stored
in a request, provide a function that allows pipeline handlers to
reset the metadata pack.
The only user is at the moment the vc4 pipeline handler.
Signed-off-by: Jacopo Mondi <jacopo.mondi at ideasonboard.com>
---
include/libcamera/internal/request.h | 5 +++++
src/libcamera/pipeline/rpi/vc4/vc4.cpp | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/include/libcamera/internal/request.h b/include/libcamera/internal/request.h
index 4e7d05b1e028..98b7c6d6dfdf 100644
--- a/include/libcamera/internal/request.h
+++ b/include/libcamera/internal/request.h
@@ -40,6 +40,11 @@ public:
void cancel();
void reset();
+ void resetMetadata()
+ {
+ _o<Request>()->metadata().clear();
+ }
+
void prepare(std::chrono::milliseconds timeout = 0ms);
Signal<> prepared;
diff --git a/src/libcamera/pipeline/rpi/vc4/vc4.cpp b/src/libcamera/pipeline/rpi/vc4/vc4.cpp
index fd8d84b14f15..bddc8a87d9e1 100644
--- a/src/libcamera/pipeline/rpi/vc4/vc4.cpp
+++ b/src/libcamera/pipeline/rpi/vc4/vc4.cpp
@@ -945,7 +945,7 @@ void Vc4CameraData::tryRunPipeline()
* related controls. We clear it first because the request metadata
* may have been populated if we have dropped the previous frame.
*/
- request->metadata().clear();
+ request->_d()->resetMetadata();
fillRequestMetadata(bayerFrame.controls, request);
/* Set our state to say the pipeline is active. */
--
2.47.1
More information about the libcamera-devel
mailing list