From 635ebee7b8e9529178ba7cb8b651e32b76c6c9ad Mon Sep 17 00:00:00 2001 From: Emilian Peev Date: Tue, 12 Mar 2019 18:05:35 -0700 Subject: [PATCH] Camera: Add low latency snapshot use case id Additionally initializey the stream id to invalid negative value in case the Hal tries to verify it during stream combination queries. Bug: 128450197 Test: Camera CTS Change-Id: Ife058e22ef72ee84be82799ed397ca49cd8ea99f --- .../include/camera/NdkCameraMetadataTags.h | 32 +++++++++++++------ .../api2/CameraDeviceClient.cpp | 1 + 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/camera/ndk/include/camera/NdkCameraMetadataTags.h b/camera/ndk/include/camera/NdkCameraMetadataTags.h index c26ca69efb..acf699925c 100644 --- a/camera/ndk/include/camera/NdkCameraMetadataTags.h +++ b/camera/ndk/include/camera/NdkCameraMetadataTags.h @@ -7762,7 +7762,9 @@ typedef enum acamera_metadata_enum_acamera_scaler_cropping_type { typedef enum acamera_metadata_enum_acamera_scaler_available_recommended_stream_configurations { /** *

Preview must only include non-stalling processed stream configurations with - * output formats like YUV_420_888, IMPLEMENTATION_DEFINED, etc.

+ * output formats like + * {@link AIMAGE_FORMAT_YUV_420_888 }, + * {@link AIMAGE_FORMAT_PRIVATE }, etc.

*/ ACAMERA_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_PREVIEW = 0x0, @@ -7777,19 +7779,20 @@ typedef enum acamera_metadata_enum_acamera_scaler_available_recommended_stream_c /** *

Video snapshot must include stream configurations at least as big as - * the maximum RECORD resolutions and only with format BLOB + DATASPACE_JFIF - * format/dataspace combination (JPEG). Additionally the configurations shouldn't cause - * preview glitches and also be able to run at 30 fps.

+ * the maximum RECORD resolutions and only with + * {@link AIMAGE_FORMAT_JPEG JPEG output format}. + * Additionally the configurations shouldn't cause preview glitches and also be able to + * run at 30 fps.

*/ ACAMERA_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_VIDEO_SNAPSHOT = 0x2, /** *

Recommended snapshot stream configurations must include at least one with - * size close to ACAMERA_SENSOR_INFO_ACTIVE_ARRAY_SIZE with BLOB + DATASPACE_JFIF - * format/dataspace combination (JPEG). Taking into account restrictions on aspect - * ratio, alignment etc. the area of the maximum suggested size shouldn’t be less than - * 97% of the sensor array size area.

+ * size close to ACAMERA_SENSOR_INFO_ACTIVE_ARRAY_SIZE and + * {@link AIMAGE_FORMAT_JPEG JPEG output format}. + * Taking into account restrictions on aspect ratio, alignment etc. the area of the + * maximum suggested size shouldn’t be less than 97% of the sensor array size area.

* * @see ACAMERA_SENSOR_INFO_ACTIVE_ARRAY_SIZE */ @@ -7808,9 +7811,20 @@ typedef enum acamera_metadata_enum_acamera_scaler_available_recommended_stream_c */ ACAMERA_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_RAW = 0x5, - ACAMERA_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_PUBLIC_END + /** + *

If supported, the recommended low latency stream configurations must have + * end-to-end latency that does not exceed 200 ms. under standard operating conditions + * (reasonable light levels, not loaded system) and using template + * TEMPLATE_STILL_CAPTURE. This is primarily for listing configurations for the + * {@link AIMAGE_FORMAT_JPEG JPEG output format} + * however other supported output formats can be added as well.

+ */ + ACAMERA_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_LOW_LATENCY_SNAPSHOT = 0x6, + ACAMERA_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_PUBLIC_END + = 0x7, + /** *

Vendor defined use cases. These depend on the vendor implementation.

*/ diff --git a/services/camera/libcameraservice/api2/CameraDeviceClient.cpp b/services/camera/libcameraservice/api2/CameraDeviceClient.cpp index b512f2b6b1..c7a4f2bfad 100644 --- a/services/camera/libcameraservice/api2/CameraDeviceClient.cpp +++ b/services/camera/libcameraservice/api2/CameraDeviceClient.cpp @@ -604,6 +604,7 @@ void CameraDeviceClient::mapStreamInfo(const OutputStreamInfo &streamInfo, stream->v3_2.usage = Camera3Device::mapToConsumerUsage(u); stream->v3_2.dataSpace = Camera3Device::mapToHidlDataspace(streamInfo.dataSpace); stream->v3_2.rotation = Camera3Device::mapToStreamRotation(rotation); + stream->v3_2.id = -1; // Invalid stream id stream->physicalCameraId = std::string(physicalId.string()); stream->bufferSize = 0; }