diff options
author | Eino-Ville Talvala <etalvala@google.com> | 2013-02-27 18:02:26 -0800 |
---|---|---|
committer | Eino-Ville Talvala <etalvala@google.com> | 2013-03-27 16:54:34 -0700 |
commit | 3b53bc9b41c262d22f094406e3751bc5a41ef2ef (patch) | |
tree | 7e27e2d5bf18e3bb973adc272f92bcb33bb5ef69 /include/camera/CameraMetadata.h | |
parent | 8be20f50711a94426f1394ec113672e41c1224e8 (diff) | |
download | frameworks_av-3b53bc9b41c262d22f094406e3751bc5a41ef2ef.zip frameworks_av-3b53bc9b41c262d22f094406e3751bc5a41ef2ef.tar.gz frameworks_av-3b53bc9b41c262d22f094406e3751bc5a41ef2ef.tar.bz2 |
Camera: Add input side to camera3 HAL device
- Stream creation/deletion
- Request submission
- Request thread loop
- Add get() to CameraMetadata to allow HAL submission while retaining
ownership.
Change-Id: I271f72bcbe9557eded43cbcbfe789109857f8144
Diffstat (limited to 'include/camera/CameraMetadata.h')
-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. |