[libcamera-devel] [PATCH v4 09/11] android: jpeg: Use CameraBuffer::jpegBufferSize()
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Tue Mar 2 16:07:51 CET 2021
Hi Jacopo,
Thank you for the patch.
On Tue, Mar 02, 2021 at 03:18:42PM +0100, Jacopo Mondi wrote:
> 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>
Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> ---
> 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;
--
Regards,
Laurent Pinchart
More information about the libcamera-devel
mailing list