Camera: Enable session parameter reconfiguration queries
Check with Hal whether stream reconfiguration is required
in case of session parameter updates.
Bug: 122609098
Test: Manual using application,
vts-tradefed run commandAndExit vts --skip-all-system-status-check
--skip-preconditions --module VtsHalCameraProviderV2_4Target -l INFO
Change-Id: Ic02525871aa079393b28b2da53764093f95f881d
diff --git a/camera/device/3.5/default/CameraDeviceSession.cpp b/camera/device/3.5/default/CameraDeviceSession.cpp
index 0770f04..d9c6eef 100644
--- a/camera/device/3.5/default/CameraDeviceSession.cpp
+++ b/camera/device/3.5/default/CameraDeviceSession.cpp
@@ -356,6 +356,35 @@
d->returnStreamBuffers(num_buffers, buffers);
}
+Return<void> CameraDeviceSession::isReconfigurationRequired(
+ const V3_2::CameraMetadata& oldSessionParams, const V3_2::CameraMetadata& newSessionParams,
+ ICameraDeviceSession::isReconfigurationRequired_cb _hidl_cb) {
+ if (mDevice->ops->is_reconfiguration_required != nullptr) {
+ const camera_metadata_t *oldParams, *newParams;
+ V3_2::implementation::convertFromHidl(oldSessionParams, &oldParams);
+ V3_2::implementation::convertFromHidl(newSessionParams, &newParams);
+ auto ret = mDevice->ops->is_reconfiguration_required(mDevice, oldParams, newParams);
+ switch (ret) {
+ case 0:
+ _hidl_cb(Status::OK, true);
+ break;
+ case -EINVAL:
+ _hidl_cb(Status::OK, false);
+ break;
+ case -ENOSYS:
+ _hidl_cb(Status::METHOD_NOT_SUPPORTED, true);
+ break;
+ default:
+ _hidl_cb(Status::INTERNAL_ERROR, true);
+ break;
+ };
+ } else {
+ _hidl_cb(Status::METHOD_NOT_SUPPORTED, true);
+ }
+
+ return Void();
+}
+
} // namespace implementation
} // namespace V3_5
} // namespace device