modules: camera: Separate locking for static characteristics
Static camera characteristics can be queried on any device at any time.
Separate the locking for it from the rest of the device to eliminate any
contention between operations on the device and static characteristic
initialization.
Change-Id: I8076378699f274e70c6318e537df4758972de9db
diff --git a/modules/camera/Camera.h b/modules/camera/Camera.h
index 16e1439..be672f9 100644
--- a/modules/camera/Camera.h
+++ b/modules/camera/Camera.h
@@ -54,7 +54,7 @@
private:
// Separate initialization method for static metadata
- int initStaticInfo();
+ camera_metadata_t *initStaticInfo();
// Reuse a stream already created by this device
Stream *reuseStream(camera3_stream_t *astream);
// Destroy all streams in a stream array, and the array itself
@@ -89,6 +89,9 @@
const camera3_callback_ops_t *mCallbackOps;
// Lock protecting the Camera object for modifications
pthread_mutex_t mMutex;
+ // Lock protecting only static camera characteristics, which may
+ // be accessed without the camera device open
+ pthread_mutex_t mStaticInfoMutex;
// Array of handles to streams currently in use by the device
Stream **mStreams;
// Number of streams in mStreams