Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 635ebee7 authored by Emilian Peev's avatar Emilian Peev
Browse files

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
parent ede17f72
Loading
Loading
Loading
Loading
+23 −9
Original line number Diff line number Diff line
@@ -7762,7 +7762,9 @@ typedef enum acamera_metadata_enum_acamera_scaler_cropping_type {
typedef enum acamera_metadata_enum_acamera_scaler_available_recommended_stream_configurations {
    /**
     * <p>Preview must only include non-stalling processed stream configurations with
     * output formats like YUV_420_888, IMPLEMENTATION_DEFINED, etc.</p>
     * output formats like
     * {@link AIMAGE_FORMAT_YUV_420_888 },
     * {@link AIMAGE_FORMAT_PRIVATE }, etc.</p>
     */
    ACAMERA_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_PREVIEW
                                                                      = 0x0,
@@ -7777,19 +7779,20 @@ typedef enum acamera_metadata_enum_acamera_scaler_available_recommended_stream_c

    /**
     * <p>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.</p>
     * 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.</p>
     */
    ACAMERA_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_VIDEO_SNAPSHOT
                                                                      = 0x2,

    /**
     * <p>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.</p>
     * 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.</p>
     *
     * @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
    /**
     * <p>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.</p>
     */
    ACAMERA_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_LOW_LATENCY_SNAPSHOT
                                                                      = 0x6,

    ACAMERA_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS_PUBLIC_END
                                                                      = 0x7,

    /**
     * <p>Vendor defined use cases. These depend on the vendor implementation.</p>
     */
+1 −0
Original line number Diff line number Diff line
@@ -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;
}