summaryrefslogtreecommitdiffstats
path: root/include/camera/CameraMetadata.h
diff options
context:
space:
mode:
authorIgor Murashkin <iam@google.com>2013-06-11 18:10:18 -0700
committerIgor Murashkin <iam@google.com>2013-06-20 20:31:30 -0700
commite7ee7637747371635a85fedd24d2190bb1f38651 (patch)
treefbae6cce035752d5386260deb4bf0222b6204ac3 /include/camera/CameraMetadata.h
parentb3570568b3f37b3f7018257ece53cbc009b91407 (diff)
downloadframeworks_av-e7ee7637747371635a85fedd24d2190bb1f38651.zip
frameworks_av-e7ee7637747371635a85fedd24d2190bb1f38651.tar.gz
frameworks_av-e7ee7637747371635a85fedd24d2190bb1f38651.tar.bz2
Initial implementation of android.hardware.photography.CameraDevice (service)
* Verified preview streaming requests * Other things *should* work but unverified / unimplemented in client side Missing: * CameraService needs to return static camera info metadata Bug: 9213377 Change-Id: I71568560fcf18d0e2b408ed1c4d0066647314868
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;