diff options
-rw-r--r-- | camera/CameraMetadata.cpp | 5 | ||||
-rw-r--r-- | include/camera/CameraMetadata.h | 6 |
2 files changed, 11 insertions, 0 deletions
diff --git a/camera/CameraMetadata.cpp b/camera/CameraMetadata.cpp index 0bfa420..fdd0610 100644 --- a/camera/CameraMetadata.cpp +++ b/camera/CameraMetadata.cpp @@ -208,6 +208,11 @@ status_t CameraMetadata::update(uint32_t tag, const void *data, return res; } +bool CameraMetadata::exists(uint32_t tag) const { + camera_metadata_ro_entry entry; + return find_camera_metadata_ro_entry(mBuffer, tag, &entry) == 0; +} + camera_metadata_entry_t CameraMetadata::find(uint32_t tag) { status_t res; camera_metadata_entry entry; diff --git a/include/camera/CameraMetadata.h b/include/camera/CameraMetadata.h index cf599e1..4289126 100644 --- a/include/camera/CameraMetadata.h +++ b/include/camera/CameraMetadata.h @@ -121,6 +121,12 @@ class CameraMetadata { } /** + * Check if a metadata entry exists for a given tag id + * + */ + bool exists(uint32_t tag) const; + + /** * Get metadata entry by tag id */ camera_metadata_entry find(uint32_t tag); |