diff options
author | Eino-Ville Talvala <etalvala@google.com> | 2013-03-28 09:08:39 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-03-28 09:08:39 -0700 |
commit | 509f4567b6e4413594c20d01b50bb2bd43ca86a8 (patch) | |
tree | 3aa4ecad0d9ebd0723778364da6a64f8a74beeb0 /include | |
parent | 7dc726b20b3613570d399cb0ca1a99bdf5f0771f (diff) | |
parent | 790b675533efda5b39408fc5fc3af2b8a5c1607b (diff) | |
download | frameworks_av-509f4567b6e4413594c20d01b50bb2bd43ca86a8.zip frameworks_av-509f4567b6e4413594c20d01b50bb2bd43ca86a8.tar.gz frameworks_av-509f4567b6e4413594c20d01b50bb2bd43ca86a8.tar.bz2 |
am 790b6755: am 3a1d8b51: Merge "Camera: Add input side to camera3 HAL device" into jb-mr2-dev
* commit '790b675533efda5b39408fc5fc3af2b8a5c1607b':
Camera: Add input side to camera3 HAL device
Diffstat (limited to 'include')
-rw-r--r-- | include/camera/CameraMetadata.h | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/include/camera/CameraMetadata.h b/include/camera/CameraMetadata.h index 4289126..8eeb2e7 100644 --- a/include/camera/CameraMetadata.h +++ b/include/camera/CameraMetadata.h @@ -49,6 +49,23 @@ class CameraMetadata { CameraMetadata &operator=(const camera_metadata_t *buffer); /** + * Get reference to the underlying metadata buffer. Ownership remains with + * the CameraMetadata object, but non-const CameraMetadata methods will not + * work until unlock() is called. Note that the lock has nothing to do with + * thread-safety, it simply prevents the camera_metadata_t pointer returned + * here from being accidentally invalidated by CameraMetadata operations. + */ + const camera_metadata_t* getAndLock(); + + /** + * Unlock the CameraMetadata for use again. After this unlock, the pointer + * given from getAndLock() may no longer be used. The pointer passed out + * from getAndLock must be provided to guarantee that the right object is + * being unlocked. + */ + status_t unlock(const camera_metadata_t *buffer); + + /** * Release a raw metadata buffer to the caller. After this call, * CameraMetadata no longer references the buffer, and the caller takes * responsibility for freeing the raw metadata buffer (using @@ -154,6 +171,7 @@ class CameraMetadata { private: camera_metadata_t *mBuffer; + bool mLocked; /** * Check if tag has a given type @@ -163,7 +181,7 @@ class CameraMetadata { /** * Base update entry method */ - status_t update(uint32_t tag, const void *data, size_t data_count); + status_t updateImpl(uint32_t tag, const void *data, size_t data_count); /** * Resize metadata buffer if needed by reallocating it and copying it over. |