camera: Add support for quad bayer sensors.

Bug: 152813564

Test: Camera CTS

Change-Id: I4aaf7c9f25518e29c4b408bc0b498c618214862e
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
This commit is contained in:
Jayant Chowdhary 2020-11-18 18:15:15 -08:00
parent 91c9697d54
commit 62af06812f
3 changed files with 323 additions and 0 deletions

View file

@ -15,6 +15,11 @@ hidl_interface {
"android.hardware.camera.device@3.4",
"android.hardware.camera.device@3.5",
"android.hardware.camera.device@3.6",
"android.hardware.camera.metadata@3.2",
"android.hardware.camera.metadata@3.3",
"android.hardware.camera.metadata@3.4",
"android.hardware.camera.metadata@3.5",
"android.hardware.camera.metadata@3.6",
"android.hardware.graphics.common@1.0",
"android.hidl.base@1.0",
],

View file

@ -21,6 +21,8 @@ import @3.2::StreamConfigurationMode;
import @3.4::CaptureRequest;
import @3.4::Stream;
import android.hardware.camera.metadata@3.6::CameraMetadataEnumAndroidSensorPixelMode;
/**
* Stream:
*
@ -57,6 +59,14 @@ struct Stream {
* usage flag.
*/
int32_t groupId;
/**
* The sensor pixel modes used by this stream. This can assist the camera
* HAL in decision making about stream combination support.
* If this is empty, the HAL must assume that this stream will only be used
* with ANDROID_SENSOR_PIXEL_MODE set to ANDROID_SENSOR_PIXEL_MODE_DEFAULT.
*/
vec<CameraMetadataEnumAndroidSensorPixelMode> sensorPixelModesUsed;
};
/**

View file

@ -36,6 +36,43 @@ import android.hardware.camera.metadata@3.5;
* '/system/media/camera/docs/docs.html' in the corresponding Android source tree.</p>
*/
enum CameraMetadataTag : @3.5::CameraMetadataTag {
/** android.control.availableHighSpeedVideoConfigurationsMaximumResolution [static, int32[], hidden]
*
* <p>List of available high speed video size, fps range and max batch size configurations
* supported by the camera device, in the format of
* (width, height, fps_min, fps_max, batch_size_max),
* when ANDROID_SENSOR_PIXEL_MODE is set to
* <a href="https://developer.android.com/reference/android/hardware/camera2/CameraMetadata.html#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION">CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION</a>.</p>
*
* @see ANDROID_SENSOR_PIXEL_MODE
*/
ANDROID_CONTROL_AVAILABLE_HIGH_SPEED_VIDEO_CONFIGURATIONS_MAXIMUM_RESOLUTION = android.hardware.camera.metadata@3.5::CameraMetadataTag:ANDROID_CONTROL_END_3_5,
ANDROID_CONTROL_END_3_6,
/** android.lens.distortionMaximumResolution [static, float[], public]
*
* <p>The correction coefficients to correct for this camera device's
* radial and tangential lens distortion for a
* CaptureRequest with ANDROID_SENSOR_PIXEL_MODE set to
* <a href="https://developer.android.com/reference/android/hardware/camera2/CameraMetadata.html#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION">CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION</a>.</p>
*
* @see ANDROID_SENSOR_PIXEL_MODE
*/
ANDROID_LENS_DISTORTION_MAXIMUM_RESOLUTION = android.hardware.camera.metadata@3.3::CameraMetadataTag:ANDROID_LENS_END_3_3,
/** android.lens.intrinsicCalibrationMaximumResolution [static, float[], public]
*
* <p>The parameters for this camera device's intrinsic
* calibration when ANDROID_SENSOR_PIXEL_MODE is set to
* <a href="https://developer.android.com/reference/android/hardware/camera2/CameraMetadata.html#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION">CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION</a>.</p>
*
* @see ANDROID_SENSOR_PIXEL_MODE
*/
ANDROID_LENS_INTRINSIC_CALIBRATION_MAXIMUM_RESOLUTION,
ANDROID_LENS_END_3_6,
/** android.scaler.defaultSecureImageSize [static, int32[], public]
*
* <p>Default YUV/PRIVATE size to use for requesting secure image buffers.</p>
@ -50,14 +87,237 @@ enum CameraMetadataTag : @3.5::CameraMetadataTag {
*/
ANDROID_SCALER_PHYSICAL_CAMERA_MULTI_RESOLUTION_STREAM_CONFIGURATIONS,
/** android.scaler.availableStreamConfigurationsMaximumResolution [static, enum[], ndk_public]
*
* <p>The available stream configurations that this
* camera device supports (i.e. format, width, height, output/input stream) for a
* CaptureRequest with ANDROID_SENSOR_PIXEL_MODE set to
* <a href="https://developer.android.com/reference/android/hardware/camera2/CameraMetadata.html#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION">CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION</a>.</p>
*
* @see ANDROID_SENSOR_PIXEL_MODE
*/
ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION,
/** android.scaler.availableMinFrameDurationsMaximumResolution [static, int64[], ndk_public]
*
* <p>This lists the minimum frame duration for each
* format/size combination when the camera device is sent a CaptureRequest with
* ANDROID_SENSOR_PIXEL_MODE set to
* <a href="https://developer.android.com/reference/android/hardware/camera2/CameraMetadata.html#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION">CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION</a>.</p>
*
* @see ANDROID_SENSOR_PIXEL_MODE
*/
ANDROID_SCALER_AVAILABLE_MIN_FRAME_DURATIONS_MAXIMUM_RESOLUTION,
/** android.scaler.availableStallDurationsMaximumResolution [static, int64[], ndk_public]
*
* <p>This lists the maximum stall duration for each
* output format/size combination when CaptureRequests are submitted with
* ANDROID_SENSOR_PIXEL_MODE set to
* <a href="https://developer.android.com/reference/android/hardware/camera2/CameraMetadata.html#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION">CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION</a></p>
*
* @see ANDROID_SENSOR_PIXEL_MODE
*/
ANDROID_SCALER_AVAILABLE_STALL_DURATIONS_MAXIMUM_RESOLUTION,
/** android.scaler.availableInputOutputFormatsMapMaximumResolution [static, int32, hidden]
*
* <p>The mapping of image formats that are supported by this
* camera device for input streams, to their corresponding output formats, when
* ANDROID_SENSOR_PIXEL_MODE is set to
* <a href="https://developer.android.com/reference/android/hardware/camera2/CameraMetadata.html#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION">CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION</a>.</p>
*
* @see ANDROID_SENSOR_PIXEL_MODE
*/
ANDROID_SCALER_AVAILABLE_INPUT_OUTPUT_FORMATS_MAP_MAXIMUM_RESOLUTION,
ANDROID_SCALER_END_3_6,
/** android.sensor.opaqueRawSizeMaximumResolution [static, int32[], system]
*
* <p>Size in bytes for all the listed opaque RAW buffer sizes when
* ANDROID_SENSOR_PIXEL_MODE is set to
* <a href="https://developer.android.com/reference/android/hardware/camera2/CameraMetadata.html#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION">CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION</a>.</p>
*
* @see ANDROID_SENSOR_PIXEL_MODE
*/
ANDROID_SENSOR_OPAQUE_RAW_SIZE_MAXIMUM_RESOLUTION = android.hardware.camera.metadata@3.2::CameraMetadataTag:ANDROID_SENSOR_END,
/** android.sensor.pixelMode [dynamic, enum, public]
*
* <p>Switches sensor pixel mode between maximum resolution mode and default mode.</p>
*/
ANDROID_SENSOR_PIXEL_MODE,
/** android.sensor.rawBinningFactorUsed [dynamic, enum, public]
*
* <p>Whether <code>RAW</code> images requested have their bayer pattern as described by
* ANDROID_SENSOR_INFO_BINNING_FACTOR.</p>
*
* @see ANDROID_SENSOR_INFO_BINNING_FACTOR
*/
ANDROID_SENSOR_RAW_BINNING_FACTOR_USED,
ANDROID_SENSOR_END_3_6,
/** android.sensor.info.activeArraySizeMaximumResolution [static, int32[], public]
*
* <p>The area of the image sensor which corresponds to active pixels after any geometric
* distortion correction has been applied, when the sensor runs in maximum resolution mode.</p>
*/
ANDROID_SENSOR_INFO_ACTIVE_ARRAY_SIZE_MAXIMUM_RESOLUTION = android.hardware.camera.metadata@3.2::CameraMetadataTag:ANDROID_SENSOR_INFO_END,
/** android.sensor.info.pixelArraySizeMaximumResolution [static, int32[], public]
*
* <p>Dimensions of the full pixel array, possibly
* including black calibration pixels, when the sensor runs in maximum resolution mode.
* Analogous to ANDROID_SENSOR_INFO_PIXEL_ARRAY_SIZE, when ANDROID_SENSOR_PIXEL_MODE is
* set to
* <a href="https://developer.android.com/reference/android/hardware/camera2/CameraMetadata.html#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION">CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION</a>.</p>
*
* @see ANDROID_SENSOR_INFO_PIXEL_ARRAY_SIZE
* @see ANDROID_SENSOR_PIXEL_MODE
*/
ANDROID_SENSOR_INFO_PIXEL_ARRAY_SIZE_MAXIMUM_RESOLUTION,
/** android.sensor.info.preCorrectionActiveArraySizeMaximumResolution [static, int32[], public]
*
* <p>The area of the image sensor which corresponds to active pixels prior to the
* application of any geometric distortion correction, when the sensor runs in maximum
* resolution mode. This key must be used for crop / metering regions, only when
* ANDROID_SENSOR_PIXEL_MODE is set to
* <a href="https://developer.android.com/reference/android/hardware/camera2/CameraMetadata.html#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION">CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION</a>.</p>
*
* @see ANDROID_SENSOR_PIXEL_MODE
*/
ANDROID_SENSOR_INFO_PRE_CORRECTION_ACTIVE_ARRAY_SIZE_MAXIMUM_RESOLUTION,
/** android.sensor.info.binningFactor [static, int32[], public]
*
* <p>Dimensions of the group of pixels which are under the same color filter.
* This specifies the width and height (pair of integers) of the group of pixels which fall
* under the same color filter for ULTRA_HIGH_RESOLUTION sensors.</p>
*/
ANDROID_SENSOR_INFO_BINNING_FACTOR,
ANDROID_SENSOR_INFO_END_3_6,
/** android.depth.availableDepthStreamConfigurationsMaximumResolution [static, enum[], ndk_public]
*
* <p>The available depth dataspace stream
* configurations that this camera device supports
* (i.e. format, width, height, output/input stream) when a CaptureRequest is submitted with
* ANDROID_SENSOR_PIXEL_MODE set to
* <a href="https://developer.android.com/reference/android/hardware/camera2/CameraMetadata.html#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION">CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION</a>.</p>
*
* @see ANDROID_SENSOR_PIXEL_MODE
*/
ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION = android.hardware.camera.metadata@3.4::CameraMetadataTag:ANDROID_DEPTH_END_3_4,
/** android.depth.availableDepthMinFrameDurationsMaximumResolution [static, int64[], ndk_public]
*
* <p>This lists the minimum frame duration for each
* format/size combination for depth output formats when a CaptureRequest is submitted with
* ANDROID_SENSOR_PIXEL_MODE set to
* <a href="https://developer.android.com/reference/android/hardware/camera2/CameraMetadata.html#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION">CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION</a>.</p>
*
* @see ANDROID_SENSOR_PIXEL_MODE
*/
ANDROID_DEPTH_AVAILABLE_DEPTH_MIN_FRAME_DURATIONS_MAXIMUM_RESOLUTION,
/** android.depth.availableDepthStallDurationsMaximumResolution [static, int64[], ndk_public]
*
* <p>This lists the maximum stall duration for each
* output format/size combination for depth streams for CaptureRequests where
* ANDROID_SENSOR_PIXEL_MODE is set to
* <a href="https://developer.android.com/reference/android/hardware/camera2/CameraMetadata.html#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION">CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION</a>.</p>
*
* @see ANDROID_SENSOR_PIXEL_MODE
*/
ANDROID_DEPTH_AVAILABLE_DEPTH_STALL_DURATIONS_MAXIMUM_RESOLUTION,
/** android.depth.availableDynamicDepthStreamConfigurationsMaximumResolution [static, enum[], ndk_public]
*
* <p>The available dynamic depth dataspace stream
* configurations that this camera device supports (i.e. format, width, height,
* output/input stream) for CaptureRequests where ANDROID_SENSOR_PIXEL_MODE is set to
* <a href="https://developer.android.com/reference/android/hardware/camera2/CameraMetadata.html#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION">CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION</a>.</p>
*
* @see ANDROID_SENSOR_PIXEL_MODE
*/
ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION,
/** android.depth.availableDynamicDepthMinFrameDurationsMaximumResolution [static, int64[], ndk_public]
*
* <p>This lists the minimum frame duration for each
* format/size combination for dynamic depth output streams for CaptureRequests where
* ANDROID_SENSOR_PIXEL_MODE is set to
* <a href="https://developer.android.com/reference/android/hardware/camera2/CameraMetadata.html#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION">CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION</a>.</p>
*
* @see ANDROID_SENSOR_PIXEL_MODE
*/
ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_MIN_FRAME_DURATIONS_MAXIMUM_RESOLUTION,
/** android.depth.availableDynamicDepthStallDurationsMaximumResolution [static, int64[], ndk_public]
*
* <p>This lists the maximum stall duration for each
* output format/size combination for dynamic depth streams for CaptureRequests where
* ANDROID_SENSOR_PIXEL_MODE is set to
* <a href="https://developer.android.com/reference/android/hardware/camera2/CameraMetadata.html#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION">CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION</a>.</p>
*
* @see ANDROID_SENSOR_PIXEL_MODE
*/
ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STALL_DURATIONS_MAXIMUM_RESOLUTION,
ANDROID_DEPTH_END_3_6,
/** android.heic.availableHeicStreamConfigurationsMaximumResolution [static, enum[], ndk_public]
*
* <p>The available HEIC (ISO/IEC 23008-12) stream
* configurations that this camera device supports
* (i.e. format, width, height, output/input stream).</p>
*/
ANDROID_HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION = android.hardware.camera.metadata@3.4::CameraMetadataTag:ANDROID_HEIC_END_3_4,
/** android.heic.availableHeicMinFrameDurationsMaximumResolution [static, int64[], ndk_public]
*
* <p>This lists the minimum frame duration for each
* format/size combination for HEIC output formats for CaptureRequests where
* ANDROID_SENSOR_PIXEL_MODE is set to
* <a href="https://developer.android.com/reference/android/hardware/camera2/CameraMetadata.html#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION">CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION</a>.</p>
*
* @see ANDROID_SENSOR_PIXEL_MODE
*/
ANDROID_HEIC_AVAILABLE_HEIC_MIN_FRAME_DURATIONS_MAXIMUM_RESOLUTION,
/** android.heic.availableHeicStallDurationsMaximumResolution [static, int64[], ndk_public]
*
* <p>This lists the maximum stall duration for each
* output format/size combination for HEIC streams for CaptureRequests where
* ANDROID_SENSOR_PIXEL_MODE is set to
* <a href="https://developer.android.com/reference/android/hardware/camera2/CameraMetadata.html#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION">CameraMetadata#SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION</a>.</p>
*
* @see ANDROID_SENSOR_PIXEL_MODE
*/
ANDROID_HEIC_AVAILABLE_HEIC_STALL_DURATIONS_MAXIMUM_RESOLUTION,
ANDROID_HEIC_END_3_6,
};
/*
* Enumeration definitions for the various entries that need them
*/
/** android.request.availableCapabilities enumeration values added since v3.5
* @see ANDROID_REQUEST_AVAILABLE_CAPABILITIES
*/
enum CameraMetadataEnumAndroidRequestAvailableCapabilities :
@3.5::CameraMetadataEnumAndroidRequestAvailableCapabilities {
ANDROID_REQUEST_AVAILABLE_CAPABILITIES_ULTRA_HIGH_RESOLUTION_SENSOR,
ANDROID_REQUEST_AVAILABLE_CAPABILITIES_REMOSAIC_REPROCESSING,
};
/** android.scaler.physicalCameraMultiResolutionStreamConfigurations enumeration values
* @see ANDROID_SCALER_PHYSICAL_CAMERA_MULTI_RESOLUTION_STREAM_CONFIGURATIONS
*/
@ -65,3 +325,51 @@ enum CameraMetadataEnumAndroidScalerPhysicalCameraMultiResolutionStreamConfigura
ANDROID_SCALER_PHYSICAL_CAMERA_MULTI_RESOLUTION_STREAM_CONFIGURATIONS_OUTPUT,
ANDROID_SCALER_PHYSICAL_CAMERA_MULTI_RESOLUTION_STREAM_CONFIGURATIONS_INPUT,
};
/** android.scaler.availableStreamConfigurationsMaximumResolution enumeration values
* @see ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION
*/
enum CameraMetadataEnumAndroidScalerAvailableStreamConfigurationsMaximumResolution : uint32_t {
ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION_OUTPUT,
ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION_INPUT,
};
/** android.sensor.pixelMode enumeration values
* @see ANDROID_SENSOR_PIXEL_MODE
*/
enum CameraMetadataEnumAndroidSensorPixelMode : uint32_t {
ANDROID_SENSOR_PIXEL_MODE_DEFAULT,
ANDROID_SENSOR_PIXEL_MODE_MAXIMUM_RESOLUTION,
};
/** android.sensor.rawBinningFactorUsed enumeration values
* @see ANDROID_SENSOR_RAW_BINNING_FACTOR_USED
*/
enum CameraMetadataEnumAndroidSensorRawBinningFactorUsed : uint32_t {
ANDROID_SENSOR_RAW_BINNING_FACTOR_USED_TRUE,
ANDROID_SENSOR_RAW_BINNING_FACTOR_USED_FALSE,
};
/** android.depth.availableDepthStreamConfigurationsMaximumResolution enumeration values
* @see ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION
*/
enum CameraMetadataEnumAndroidDepthAvailableDepthStreamConfigurationsMaximumResolution : uint32_t {
ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION_OUTPUT,
ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION_INPUT,
};
/** android.depth.availableDynamicDepthStreamConfigurationsMaximumResolution enumeration values
* @see ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION
*/
enum CameraMetadataEnumAndroidDepthAvailableDynamicDepthStreamConfigurationsMaximumResolution : uint32_t {
ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION_OUTPUT,
ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION_INPUT,
};
/** android.heic.availableHeicStreamConfigurationsMaximumResolution enumeration values
* @see ANDROID_HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION
*/
enum CameraMetadataEnumAndroidHeicAvailableHeicStreamConfigurationsMaximumResolution : uint32_t {
ANDROID_HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION_OUTPUT,
ANDROID_HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION_INPUT,
};