diff options
author | Emilian Peev <epeev@google.com> | 2019-01-24 17:23:19 -0800 |
---|---|---|
committer | Emilian Peev <epeev@google.com> | 2019-02-12 11:06:57 -0800 |
commit | d22172150ffff737bc818c3ba058177cb110e18b (patch) | |
tree | 4362cf4f42083ad26574424f4c59fcea28a28058 | |
parent | 3e11b21931c26012cba3d33187384db3e8b7a95b (diff) | |
download | libhardware-d22172150ffff737bc818c3ba058177cb110e18b.tar.gz |
camera3: Add support for session parameter queries
Enable Hal to trigger or skip stream reconfiguration
based on session parameter updates.
Bug: 122609098
Test: Manual using application,
VtsHalCameraProviderV2_4TargetTest
--hal_service_instance=android.hardware.camera.provider@2.4::ICameraProvider/legacy/0
--gtest_filter=CameraHidlTest.configureStreamsWithSessionParameters
Change-Id: Ie931e7cb7f46257276cc1796fccd301c85a90d85
-rw-r--r-- | include/hardware/camera3.h | 56 | ||||
-rw-r--r-- | tests/hardware/struct-offset.cpp | 3 |
2 files changed, 57 insertions, 2 deletions
diff --git a/include/hardware/camera3.h b/include/hardware/camera3.h index 03db10cd..bafb3867 100644 --- a/include/hardware/camera3.h +++ b/include/hardware/camera3.h @@ -200,6 +200,10 @@ * segments and thumbnail (without main image bitstream). Camera framework * uses such stream togerther with a HAL YUV_420_888/IMPLEMENTATION_DEFINED * stream to encode HEIC (ISO/IEC 23008-12) image. + * + * - Add is_reconfiguration_required() to camera3_device_ops_t to enable HAL to skip or + * trigger stream reconfiguration depending on new session parameter values. + * */ /** @@ -3489,8 +3493,58 @@ typedef struct camera3_device_ops { uint32_t num_streams, const camera3_stream_t* const* streams); + /** + * is_reconfiguration_required: + * + * <= CAMERA_DEVICE_API_VERISON_3_5: + * + * Not defined and must be NULL + * + * >= CAMERA_DEVICE_API_VERISON_3_6: + * + * Check whether complete stream reconfiguration is required for possible new session + * parameter values. + * + * This method must be called by the camera framework in case the client changes + * the value of any advertised session parameters. Depending on the specific values + * the HAL can decide whether a complete stream reconfiguration is required. In case + * the HAL returns -ENVAL, the camera framework must skip the internal reconfiguration. + * In case Hal returns 0, the framework must reconfigure the streams and pass the + * new session parameter values accordingly. + * This call may be done by the framework some time before the request with new parameters + * is submitted to the HAL, and the request may be cancelled before it ever gets submitted. + * Therefore, the HAL must not use this query as an indication to change its behavior in any + * way. + * ------------------------------------------------------------------------ + * + * Preconditions: + * + * The framework can call this method at any time after active + * session configuration. There must be no impact on the performance of + * pending camera requests in any way. In particular there must not be + * any glitches or delays during normal camera streaming. + * + * Performance requirements: + * HW and SW camera settings must not be changed and there must not be + * a user-visible impact on camera performance. + * + * @param oldSessionParams The currently applied session parameters. + * @param newSessionParams The new session parameters set by client. + * + * @return Status Status code for the operation, one of: + * 0: In case the stream reconfiguration is required + * + * -EINVAL: In case the stream reconfiguration is not required. + * + * -ENOSYS: In case the camera device does not support the + * reconfiguration query. + */ + int (*is_reconfiguration_required)(const struct camera3_device*, + const camera_metadata_t* old_session_params, + const camera_metadata_t* new_session_params); + /* reserved for future use */ - void *reserved[7]; + void *reserved[6]; } camera3_device_ops_t; /********************************************************************** diff --git a/tests/hardware/struct-offset.cpp b/tests/hardware/struct-offset.cpp index 855ad108..0cf145a1 100644 --- a/tests/hardware/struct-offset.cpp +++ b/tests/hardware/struct-offset.cpp @@ -231,5 +231,6 @@ void CheckOffsets(void) { CHECK_MEMBER_AT(camera3_device_ops_t, dump, 24, 48); CHECK_MEMBER_AT(camera3_device_ops_t, flush, 28, 56); CHECK_MEMBER_AT(camera3_device_ops_t, signal_stream_flush, 32, 64); - CHECK_MEMBER_AT(camera3_device_ops_t, reserved, 36, 72); + CHECK_MEMBER_AT(camera3_device_ops_t, is_reconfiguration_required, 36, 72); + CHECK_MEMBER_AT(camera3_device_ops_t, reserved, 40, 80); } |