summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2019-02-17 04:03:48 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2019-02-17 04:03:48 +0000
commiteb487c159a8aae60abcf900ec5d50be54a7daa9d (patch)
tree1199a4550adc3ccb6537207d95bffd01213d74c4
parent86a60cbbfc0cab332d8193c1c11f48eb4b9fe6f9 (diff)
parentd8771edc84dd01cf70150f796c8821b91cbe7c16 (diff)
downloadlibhardware-eb487c159a8aae60abcf900ec5d50be54a7daa9d.tar.gz
Snap for 5316819 from d8771edc84dd01cf70150f796c8821b91cbe7c16 to qt-release
Change-Id: I9e59779485c2897852dad3aff50b1979d828c9c9
-rw-r--r--include/hardware/camera3.h60
-rw-r--r--tests/hardware/struct-offset.cpp3
2 files changed, 60 insertions, 3 deletions
diff --git a/include/hardware/camera3.h b/include/hardware/camera3.h
index 03db10cd..aa3e227b 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.
+ *
*/
/**
@@ -2200,7 +2204,9 @@ typedef enum camera3_buffer_request_status {
/**
* request_stream_buffers() call failed for all streams and no buffers are
- * returned at all due to unknown reason.
+ * returned at all. This can happen for unknown reasons or a combination
+ * of different failure reasons per stream. For the latter case, caller can
+ * check per stream failure reason returned in camera3_stream_buffer_ret.
*/
CAMERA3_BUF_REQ_FAILED_UNKNOWN = 4,
@@ -3489,8 +3495,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);
}