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>
This commit is contained in:
Jacopo Mondi 2019-09-04 16:18:19 +02:00
parent b4893fce68
commit 48504ba143

View file

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