[5/8] libcamera: request: Add function to reset metadata
diff mbox series

Message ID 20241206160747.97176-6-jacopo.mondi@ideasonboard.com
State New
Headers show
Series
  • libcamera: Support partial metadata completion
Related show

Commit Message

Jacopo Mondi Dec. 6, 2024, 4:07 p.m. UTC
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@ideasonboard.com>
---
 include/libcamera/internal/request.h   | 5 +++++
 src/libcamera/pipeline/rpi/vc4/vc4.cpp | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

Patch
diff mbox series

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. */