From patchwork Wed Sep 4 12:54:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 1917 Return-Path: Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id BA48261926 for ; Wed, 4 Sep 2019 14:53:04 +0200 (CEST) X-Originating-IP: 2.224.242.101 Received: from uno.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101]) (Authenticated sender: jacopo@jmondi.org) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 4964724000B; Wed, 4 Sep 2019 12:53:03 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Cc: Jacopo Mondi , kamesan@google.com, jcliang@google.com, shik@google.com, wtlee@google.com, Laurent Pinchart Date: Wed, 4 Sep 2019 14:54:22 +0200 Message-Id: <20190904125427.13943-3-jacopo@jmondi.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190904125427.13943-1-jacopo@jmondi.org> References: <20190904125427.13943-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 2/7] android: camera_device: Use correct sizes for static metadata X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Sep 2019 12:53:04 -0000 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 Signed-off-by: Jacopo Mondi Reviewed-by: Niklas Söderlund --- src/android/camera_device.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index 15f57a7fe731..dee60e3d2931 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 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,