From 48504ba143fd5e2db625540cafbf953a97a78aec Mon Sep 17 00:00:00 2001
From: Jacopo Mondi <jacopo@jmondi.org>
Date: Wed, 4 Sep 2019 16:18:19 +0200
Subject: android: camera_device: Use correct sizes for static metadata

Use more opportune sizes for the static metadata pack, and for the
dynamic metadata sizes which where wrongly set to use the ones defined
for the static pack.

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
---
 src/android/camera_device.cpp | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

(limited to 'src/android')

diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
index 15f57a7f..dee60e3d 100644
--- a/src/android/camera_device.cpp
+++ b/src/android/camera_device.cpp
@@ -128,11 +128,11 @@ camera_metadata_t *CameraDevice::getStaticMetadata()
 	 * more.
 	 */
 
-	/* \todo Use correct sizes */
-	#define STATIC_ENTRY_CAP 256
-	#define STATIC_DATA_CAP 6688
-	staticMetadata_ = allocate_camera_metadata(STATIC_ENTRY_CAP,
-						   STATIC_DATA_CAP);
+	/*
+	 * \todo Keep this in sync with the actual number of entries.
+	 * Currently: 46 entries, 390 bytes
+	 */
+	staticMetadata_ = allocate_camera_metadata(50, 500);
 
 	/* Color correction static metadata. */
 	std::vector<uint8_t> aberrationModes = {
@@ -966,11 +966,11 @@ camera_metadata_t *CameraDevice::getResultMetadata(int frame_number,
 {
 	int ret;
 
-	/* \todo Use correct sizes */
-	#define RESULT_ENTRY_CAP 256
-	#define RESULT_DATA_CAP 6688
-	camera_metadata_t *resultMetadata =
-		allocate_camera_metadata(STATIC_ENTRY_CAP, STATIC_DATA_CAP);
+	/*
+	 * \todo Keep this in sync with the actual number of entries.
+	 * Currently: 13 entries, 36 bytes
+	 */
+	camera_metadata_t *resultMetadata = allocate_camera_metadata(15, 50);
 
 	const uint8_t ae_state = ANDROID_CONTROL_AE_STATE_CONVERGED;
 	ret = add_camera_metadata_entry(resultMetadata, ANDROID_CONTROL_AE_STATE,
-- 
cgit v1.2.1