From b534d9bf29c002a9edc7635a30d8c58c80196d2f Mon Sep 17 00:00:00 2001 From: Yin-Chia Yeh Date: Wed, 24 Jan 2018 16:15:55 -0800 Subject: [PATCH] Camera: add buffer size to Stream So that HALs without device knowledge knows the maximal size it can lock using graphics mapper API. Bug: 64874137 72261675 Change-Id: I7363f5c63d955ab412f9570bf8e5be2a942cf381 --- camera/device/3.4/types.hal | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/camera/device/3.4/types.hal b/camera/device/3.4/types.hal index 77e855f129..75c64ab4a1 100644 --- a/camera/device/3.4/types.hal +++ b/camera/device/3.4/types.hal @@ -30,7 +30,7 @@ import @3.2::CaptureRequest; * by the framework by its buffer resolution and format, and additionally by the * HAL with the gralloc usage flags and the maximum in-flight buffer count. * - * This version extends the @3.2 Stream with the physicalCameraId field. + * This version extends the @3.2 Stream with the physicalCameraId and bufferSize field. */ struct Stream { /** @@ -59,6 +59,21 @@ struct Stream { * instance names returned by getCameraIdList(). */ string physicalCameraId; + + /** + * The size of a buffer from this Stream, in bytes. + * + * For non PixelFormat::BLOB formats, this entry must be 0 and HAL should use + * android.hardware.graphics.mapper lockYCbCr API to get buffer layout. + * + * For BLOB format with dataSpace Dataspace::DEPTH, this must be zero and and HAL must + * determine the buffer size based on ANDROID_DEPTH_MAX_DEPTH_SAMPLES. + * + * For BLOB format with dataSpace Dataspace::JFIF, this must be non-zero and represent the + * maximal size HAL can lock using android.hardware.graphics.mapper lock API. + * + */ + uint32_t bufferSize; }; /**