[libcamera-devel] [PATCH v4 09/11] android: jpeg: Use CameraBuffer::jpegBufferSize()

Jacopo Mondi jacopo at jmondi.org
Tue Mar 2 15:18:42 CET 2021


Use the newly introduced function to retrieve the size of
the JPEG encoding destination buffer, in order to calculate where
the JPEG_BLOB_ID should be placed.

Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>
---
 src/android/jpeg/post_processor_jpeg.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/android/jpeg/post_processor_jpeg.cpp b/src/android/jpeg/post_processor_jpeg.cpp
index 83244ce6769e..3bf16996a147 100644
--- a/src/android/jpeg/post_processor_jpeg.cpp
+++ b/src/android/jpeg/post_processor_jpeg.cpp
@@ -183,7 +183,7 @@ int PostProcessorJpeg::process(const FrameBuffer &source,
 
 	/* Fill in the JPEG blob header. */
 	uint8_t *resultPtr = destination->plane(0).data()
-			   + destination->plane(0).size()
+			   + destination->jpegBufferSize(cameraDevice_->maxJpegBufferSize())
 			   - sizeof(struct camera3_jpeg_blob);
 	auto *blob = reinterpret_cast<struct camera3_jpeg_blob *>(resultPtr);
 	blob->jpeg_blob_id = CAMERA3_JPEG_BLOB_ID;
-- 
2.30.0



More information about the libcamera-devel mailing list