From 78875938e950fb28c90e0ee387cf4c19be7e1d00 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Thu, 2 Sep 2021 01:56:07 +0300 Subject: libcamera: framebuffer: Move planes check to constructor The FrameBuffer::planes() function checks that planes are correctly initialized with an offset. This can be done at construction time instead, as the planes are constant. The backtrace generated by the assertion will show where the faulty frame buffer is created instead of where it is used, easing debugging. As the runtime overhead is reduced, there's no real need to drop the assertion in the future anymore, it can be useful to ensure that the planes are correctly populated by the caller. Drop the comment that calls for removing the check. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham Reviewed-by: Hirokazu Honda --- include/libcamera/framebuffer.h | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'include') diff --git a/include/libcamera/framebuffer.h b/include/libcamera/framebuffer.h index d5aeff00..fd68ed0a 100644 --- a/include/libcamera/framebuffer.h +++ b/include/libcamera/framebuffer.h @@ -51,14 +51,7 @@ public: FrameBuffer(const std::vector &planes, unsigned int cookie = 0); - const std::vector &planes() const - { - /* \todo Remove the assertions after sufficient testing */ - for (const auto &plane : planes_) - assert(plane.offset != Plane::kInvalidOffset); - return planes_; - } - + const std::vector &planes() const { return planes_; } Request *request() const; const FrameMetadata &metadata() const { return metadata_; } -- cgit v1.2.1