summaryrefslogtreecommitdiffstats
path: root/modules/camera/Camera.h
diff options
context:
space:
mode:
authorAlex Ray <aray@google.com>2013-07-17 14:23:04 -0700
committerAlex Ray <aray@google.com>2013-07-26 16:36:43 -0700
commit0f82f5a73a9ea6462706c807dc1a5a2cf2333ea1 (patch)
tree1388dda744ecaa72ef27135eb13d001afb015883 /modules/camera/Camera.h
parentba9c8badb7683f76eaa3f40f3b930410682bab69 (diff)
downloadhardware_libhardware-0f82f5a73a9ea6462706c807dc1a5a2cf2333ea1.zip
hardware_libhardware-0f82f5a73a9ea6462706c807dc1a5a2cf2333ea1.tar.gz
hardware_libhardware-0f82f5a73a9ea6462706c807dc1a5a2cf2333ea1.tar.bz2
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
Diffstat (limited to 'modules/camera/Camera.h')
-rw-r--r--modules/camera/Camera.h5
1 files changed, 4 insertions, 1 deletions
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 @@ class Camera {
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 @@ class Camera {
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