[PATCH v2] libcamera: Make FrameBuffer status default to FrameSuccess

Harvey Yang chenghaoyang at chromium.org
Mon Sep 9 07:34:19 CEST 2024


From: Han-Lin Chen <hanlinchen at chromium.org>

To solve issues when platforms not following V4L2 spec and frame
buffers not going through V4L2VideoDevice, setting default values
to FrameMetadata's member variables.

Signed-off-by: Han-Lin Chen <hanlinchen at chromium.org>
Co-developed-by: Harvey Yang <chenghaoyang at chromium.org>
---
 include/libcamera/framebuffer.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/libcamera/framebuffer.h b/include/libcamera/framebuffer.h
index ff839243..8dae747c 100644
--- a/include/libcamera/framebuffer.h
+++ b/include/libcamera/framebuffer.h
@@ -32,9 +32,9 @@ struct FrameMetadata {
 		unsigned int bytesused;
 	};
 
-	Status status;
-	unsigned int sequence;
-	uint64_t timestamp;
+	Status status = FrameSuccess;
+	unsigned int sequence = 0;
+	uint64_t timestamp = 0;
 
 	Span<Plane> planes() { return planes_; }
 	Span<const Plane> planes() const { return planes_; }
-- 
2.46.0.469.g59c65b2a67-goog



More information about the libcamera-devel mailing list