Camera3Device: Add dumpsys monitoring of request/result metadata
Add new -m dumpsys option to cameraservice dump for monitoring
changes in selected metadata values in requests and results.
This option takes a comma-separated list of metadata keys, or the
shortcut value "3a", which expands to all the "android.control" tags.
In subsequent dumpsys calls, the last 100 changes to the tags being
monitored are listed.
The monitoring must be turned on once the camera device is running.
Bug:
Change-Id: If8938b30611ccafa86c2c4a06e57fc72680f827b
diff --git a/include/camera/CameraMetadata.h b/include/camera/CameraMetadata.h
index 28f47a1..d284477 100644
--- a/include/camera/CameraMetadata.h
+++ b/include/camera/CameraMetadata.h
@@ -18,12 +18,15 @@
#define ANDROID_CLIENT_CAMERA2_CAMERAMETADATA_CPP
#include "system/camera_metadata.h"
+
#include <utils/String8.h>
#include <utils/Vector.h>
#include <binder/Parcelable.h>
namespace android {
+class VendorTagDescriptor;
+
/**
* A convenience wrapper around the C-based camera_metadata_t library.
*/
@@ -137,6 +140,8 @@
const camera_metadata_rational_t *data, size_t data_count);
status_t update(uint32_t tag,
const String8 &string);
+ status_t update(const camera_metadata_ro_entry &entry);
+
template<typename T>
status_t update(uint32_t tag, Vector<T> data) {
@@ -206,6 +211,15 @@
static status_t writeToParcel(Parcel &parcel,
const camera_metadata_t* metadata);
+ /**
+ * Find tag id for a given tag name, also checking vendor tags if available.
+ * On success, returns OK and writes the tag id into tag.
+ *
+ * This is a slow method.
+ */
+ static status_t getTagFromName(const char *name,
+ const VendorTagDescriptor* vTags, uint32_t *tag);
+
private:
camera_metadata_t *mBuffer;
mutable bool mLocked;
diff --git a/include/camera/VendorTagDescriptor.h b/include/camera/VendorTagDescriptor.h
index 4c1cab6..60e2d2d 100644
--- a/include/camera/VendorTagDescriptor.h
+++ b/include/camera/VendorTagDescriptor.h
@@ -81,8 +81,10 @@
/**
* Convenience method to get a vector containing all vendor tag
* sections, or an empty vector if none are defined.
+ * The pointer is valid for the lifetime of the VendorTagDescriptor,
+ * or until readParcel or copyFrom is invoked.
*/
- SortedVector<String8> getAllSectionNames() const;
+ const SortedVector<String8>* getAllSectionNames() const;
/**
* Lookup the tag id for a given tag name and section.