[libcamera-devel] [PATCH v2 5/6] android: Increase result metadata size

Umang Jain umang.jain at ideasonboard.com
Tue Jan 4 04:25:46 CET 2022


Hi Paul,

On 12/21/21 4:56 AM, Paul Elder wrote:
> Increase the initial size of the result metadata, as we will be adding
> more entries in the near future.
>
> Signed-off-by: Paul Elder <paul.elder at ideasonboard.com>
> Reviewed-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
> ---
>   src/android/camera_device.cpp | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
> index f28fdd6a..83825736 100644
> --- a/src/android/camera_device.cpp
> +++ b/src/android/camera_device.cpp
> @@ -1313,7 +1313,7 @@ CameraDevice::getResultMetadata(const Camera3RequestDescriptor &descriptor) cons
>   	 * Total bytes for JPEG metadata: 82
>   	 */
>   	std::unique_ptr<CameraMetadata> resultMetadata =
> -		std::make_unique<CameraMetadata>(44, 166);
> +		std::make_unique<CameraMetadata>(88, 166);


I know the CameraMetadata only takes a hint of #number of entries and 
#bytes and it can re-allocate on the fly, but bumping up the entries 
without the #bytes (as Jacopo pointed), seems a bit spurious. Would it 
be helpful to recording a specific reason behind this in the commit 
message? I am sure someone looking at the `git log` at this patch in 
future, would get confused and would potentially treat it as  a bug.


>   	if (!resultMetadata->isValid()) {
>   		LOG(HAL, Error) << "Failed to allocate result metadata";
>   		return nullptr;


More information about the libcamera-devel mailing list