summaryrefslogtreecommitdiffstats
path: root/include/camera/CameraMetadata.h
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2013-11-22 10:35:20 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2013-11-22 10:35:20 -0800
commit5bf2560ce9b70bee077e0c264ac06648f0f63acc (patch)
treef17ecec5321e8d583d045135f29f14f3c7418e71 /include/camera/CameraMetadata.h
parenteb76f318e9daf91dbf195bcb74852b3bd736a32a (diff)
parentb2059ff384eee8ffb70a7ec8fc5570405201c734 (diff)
downloadframeworks_av-5bf2560ce9b70bee077e0c264ac06648f0f63acc.zip
frameworks_av-5bf2560ce9b70bee077e0c264ac06648f0f63acc.tar.gz
frameworks_av-5bf2560ce9b70bee077e0c264ac06648f0f63acc.tar.bz2
Merge commit 'b2059ff384eee8ffb70a7ec8fc5570405201c734' into HEAD
Diffstat (limited to 'include/camera/CameraMetadata.h')
-rw-r--r--include/camera/CameraMetadata.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/include/camera/CameraMetadata.h b/include/camera/CameraMetadata.h
index 8eeb2e7..fe2bd19 100644
--- a/include/camera/CameraMetadata.h
+++ b/include/camera/CameraMetadata.h
@@ -22,6 +22,7 @@
#include <utils/Vector.h>
namespace android {
+class Parcel;
/**
* A convenience wrapper around the C-based camera_metadata_t library.
@@ -159,6 +160,12 @@ class CameraMetadata {
status_t erase(uint32_t tag);
/**
+ * Swap the underlying camera metadata between this and the other
+ * metadata object.
+ */
+ void swap(CameraMetadata &other);
+
+ /**
* Dump contents into FD for debugging. The verbosity levels are
* 0: Tag entry information only, no data values
* 1: Level 0 plus at most 16 data values per entry
@@ -169,6 +176,31 @@ class CameraMetadata {
*/
void dump(int fd, int verbosity = 1, int indentation = 0) const;
+ /**
+ * Serialization over Binder
+ */
+
+ // Metadata object is unchanged when reading from parcel fails.
+ status_t readFromParcel(Parcel *parcel);
+ status_t writeToParcel(Parcel *parcel) const;
+
+ /**
+ * Caller becomes the owner of the new metadata
+ * 'const Parcel' doesnt prevent us from calling the read functions.
+ * which is interesting since it changes the internal state
+ *
+ * NULL can be returned when no metadata was sent, OR if there was an issue
+ * unpacking the serialized data (i.e. bad parcel or invalid structure).
+ */
+ static status_t readFromParcel(const Parcel &parcel,
+ camera_metadata_t** out);
+ /**
+ * Caller retains ownership of metadata
+ * - Write 2 (int32 + blob) args in the current position
+ */
+ static status_t writeToParcel(Parcel &parcel,
+ const camera_metadata_t* metadata);
+
private:
camera_metadata_t *mBuffer;
bool mLocked;