android: camera_buffer: Add method to get the JPEG blob size

To maintain compatibility with platforms that do not provide a memory
backend implementation add a method to be return the size of the buffer
used for JPEG encoding capped to a maximum size.

Platforms that implement a memory backend will always calculate the
correct buffer size.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
Jacopo Mondi 2021-02-25 17:51:54 +01:00
parent eba862b0e3
commit 1223da76a2
2 changed files with 16 additions and 0 deletions

View file

@ -26,6 +26,8 @@ public:
libcamera::Span<const uint8_t> plane(unsigned int plane) const;
libcamera::Span<uint8_t> plane(unsigned int plane);
size_t jpegBufferSize(size_t maxJpegBufferSize) const;
};
#endif /* __ANDROID_CAMERA_BUFFER_H__ */