summaryrefslogtreecommitdiff
path: root/camera/device/3.4/default/CameraDeviceSession.cpp
diff options
context:
space:
mode:
authorYin-Chia Yeh <yinchiayeh@google.com>2019-02-13 15:18:16 -0800
committerYin-Chia Yeh <yinchiayeh@google.com>2019-02-14 14:18:01 -0800
commit9e3079b0de9ce00681c623eddc6613ae4d96b6f5 (patch)
tree453ede7fa200b64f9fd1682a29090599900efc49 /camera/device/3.4/default/CameraDeviceSession.cpp
parent71e6298ea6fa05e1bb1cd26d64a8f1d43091497e (diff)
Camera: remove stream_configuration_counter from camera3.h
Handle the race issue in the wrapper HAL instead of letting HAL implementation handing it. Test: Pixel 3 + camera CTS + GCA Bug: 120986771 Change-Id: Iff97fcaa969bea6668679c57642e4322c4ca5c19
Diffstat (limited to 'camera/device/3.4/default/CameraDeviceSession.cpp')
-rw-r--r--camera/device/3.4/default/CameraDeviceSession.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/camera/device/3.4/default/CameraDeviceSession.cpp b/camera/device/3.4/default/CameraDeviceSession.cpp
index c937834928..e00b3f83d0 100644
--- a/camera/device/3.4/default/CameraDeviceSession.cpp
+++ b/camera/device/3.4/default/CameraDeviceSession.cpp
@@ -128,7 +128,9 @@ void CameraDeviceSession::configureStreams_3_4_Impl(
}
camera3_stream_configuration_t stream_list{};
- stream_list.stream_configuration_counter = streamConfigCounter;
+ // Block reading mStreamConfigCounter until configureStream returns
+ Mutex::Autolock _sccl(mStreamConfigCounterLock);
+ mStreamConfigCounter = streamConfigCounter;
hidl_vec<camera3_stream_t*> streams;
stream_list.session_parameters = paramBuffer;
if (!preProcessConfigurationLocked_3_4(requestedConfiguration, &stream_list, &streams)) {